move transform to generated data
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "Gen.h"
|
||||
|
||||
#include "bx/math.h"
|
||||
|
||||
namespace Gen
|
||||
{
|
||||
bool IsValid(const ModelHandle& h)
|
||||
@@ -364,4 +366,93 @@ namespace Gen
|
||||
out = Vec3{l1.x + u * LbMinusLa.x, l1.y + u * LbMinusLa.y, l1.z + u * LbMinusLa.z};
|
||||
return true;
|
||||
}
|
||||
|
||||
void Translate(Transform& trans, Vec3 offset)
|
||||
{
|
||||
trans.Position += Vec3{offset.x, offset.y, offset.z};
|
||||
}
|
||||
|
||||
void TranslateLocal(Transform& trans, Vec3 offset)
|
||||
{
|
||||
Vec3 localOffset = GlobalToLocalDirection(trans, offset);
|
||||
trans.Position += Vec3{localOffset.x, localOffset.y, localOffset.z};
|
||||
}
|
||||
|
||||
void Rotate(Transform& trans, Vec3 rotation)
|
||||
{
|
||||
float rot[16]{0};
|
||||
bx::mtxRotateXYZ(rot, rotation.x, rotation.y, rotation.z);
|
||||
float temp[16]{0};
|
||||
bx::mtxMul(temp, rot, trans.Rotation.M);
|
||||
bx::memCopy(trans.Rotation.M, temp, sizeof(temp));
|
||||
}
|
||||
|
||||
void RotateLocal(Transform& trans, Vec3 rotation)
|
||||
{
|
||||
float rot[16]{0};
|
||||
bx::mtxRotateXYZ(rot, rotation.x, rotation.y, rotation.z);
|
||||
float temp[16]{0};
|
||||
bx::mtxMul(temp, trans.Rotation.M, rot);
|
||||
bx::memCopy(trans.Rotation.M, temp, sizeof(temp));
|
||||
}
|
||||
|
||||
Vec3 AxisRight(const Mat4& trans)
|
||||
{
|
||||
return {trans.M[0], trans.M[1], trans.M[2]};
|
||||
}
|
||||
|
||||
Vec3 AxisUp(const Mat4& trans)
|
||||
{
|
||||
return {trans.M[4], trans.M[5], trans.M[6]};
|
||||
}
|
||||
|
||||
Vec3 AxisForward(const Mat4& trans)
|
||||
{
|
||||
return {trans.M[8], trans.M[9], trans.M[10]};
|
||||
}
|
||||
|
||||
void UpdateMatrix(Transform& trans)
|
||||
{
|
||||
Mat4 pos;
|
||||
Mat4 scale;
|
||||
bx::mtxTranslate(pos.M, trans.Position.x, trans.Position.y, trans.Position.z);
|
||||
bx::mtxScale(scale.M, trans.Scale.x, trans.Scale.y, trans.Scale.z);
|
||||
Mat4 temp;
|
||||
bx::mtxMul(temp.M, scale.M, trans.Rotation.M);
|
||||
bx::mtxMul(trans.M.M, temp.M, pos.M);
|
||||
bx::mtxInverse(trans.MI.M, trans.M.M);
|
||||
}
|
||||
|
||||
Vec3 GlobalToLocalDirection(Transform& trans, Vec3 global)
|
||||
{
|
||||
UpdateMatrix(trans);
|
||||
float in[4]{global.x, global.y, global.z, 0.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, Transpose(trans.MI).M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
Vec3 GlobalToLocalPoint(Transform& trans, Vec3 global)
|
||||
{
|
||||
UpdateMatrix(trans);
|
||||
float in[4]{global.x, global.y, global.z, 1.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, trans.MI.M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
Vec3 LocalToGlobalDirection(Transform& trans, Vec3 local)
|
||||
{
|
||||
UpdateMatrix(trans);
|
||||
float in[4]{local.x, local.y, local.z, 0.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, Transpose(trans.M).M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
Vec3 LocalToGlobalPoint(Transform& trans, Vec3 local)
|
||||
{
|
||||
UpdateMatrix(trans);
|
||||
float in[4]{local.x, local.y, local.z, 1.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, trans.M.M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
} // namespace Gen
|
||||
|
||||
@@ -77,4 +77,17 @@ namespace Gen
|
||||
Vec3 CrossProduct(Vec3 a, Vec3 b);
|
||||
Vec3 CrossProductFromPlane(Vec3 a, Vec3 b, Vec3 c);
|
||||
bool RayPlaneIntersect(Vec3 l1, Vec3 l2, Vec3 p1, Vec3 p2, Vec3 p3, Vec3& out);
|
||||
|
||||
void Translate(Transform& trans, Vec3 offset);
|
||||
void TranslateLocal(Transform& trans, Vec3 offset);
|
||||
void Rotate(Transform& trans, Vec3 rotation);
|
||||
void RotateLocal(Transform& trans, Vec3 rotation);
|
||||
Vec3 LocalToGlobalPoint(Transform& trans, Vec3 local);
|
||||
Vec3 LocalToGlobalDirection(Transform& trans, Vec3 local);
|
||||
Vec3 GlobalToLocalPoint(Transform& trans, Vec3 global);
|
||||
Vec3 GlobalToLocalDirection(Transform& trans, Vec3 global);
|
||||
Vec3 AxisRight(const Mat4& mat);
|
||||
Vec3 AxisUp(const Mat4& mat);
|
||||
Vec3 AxisForward(const Mat4& mat);
|
||||
void UpdateMatrix(Transform& trans);
|
||||
} // namespace Gen
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
#include "../engine/Shared.h"
|
||||
#include "Gen.h"
|
||||
#include "Global.h"
|
||||
#include "Instance.h"
|
||||
|
||||
#include "bx/bx.h"
|
||||
#include "bx/math.h"
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -53,114 +50,3 @@ namespace Game
|
||||
return reinterpret_cast<void*>(ptrAligned);
|
||||
}
|
||||
} // namespace Game
|
||||
|
||||
void Transform::CreateTransform(float* out, bx::Vec3 pos, bx::Quaternion rot, bx::Vec3 scale)
|
||||
{
|
||||
if (out == nullptr) return;
|
||||
float rMat[16]{0};
|
||||
float tMat[16]{0};
|
||||
float sMat[16]{0};
|
||||
bx::mtxFromQuaternion(rMat, bx::Quaternion{rot.x, rot.y, rot.z, rot.w});
|
||||
bx::mtxTranslate(tMat, pos.x, pos.y, pos.z);
|
||||
bx::mtxScale(sMat, scale.x, scale.y, scale.z);
|
||||
float buf[16]{0};
|
||||
bx::mtxMul(buf, rMat, sMat);
|
||||
bx::mtxMul(out, buf, tMat);
|
||||
}
|
||||
|
||||
void Transform::Translate(Vec3 offset)
|
||||
{
|
||||
Position = bx::add(Position, {offset.x, offset.y, offset.z});
|
||||
}
|
||||
|
||||
void Transform::TranslateLocal(Vec3 offset)
|
||||
{
|
||||
Vec3 localOffset = GlobalToLocalDirection(offset);
|
||||
Position = bx::add(Position, {localOffset.x, localOffset.y, localOffset.z});
|
||||
}
|
||||
|
||||
void Transform::Rotate(Vec3 rotation)
|
||||
{
|
||||
float rot[16]{0};
|
||||
bx::mtxRotateXYZ(rot, rotation.x, rotation.y, rotation.z);
|
||||
float temp[16]{0};
|
||||
bx::mtxMul(temp, rot, Rotation.M);
|
||||
bx::memCopy(Rotation.M, temp, sizeof(temp));
|
||||
}
|
||||
|
||||
void Transform::RotateLocal(Vec3 rotation)
|
||||
{
|
||||
float rot[16]{0};
|
||||
bx::mtxRotateXYZ(rot, rotation.x, rotation.y, rotation.z);
|
||||
float temp[16]{0};
|
||||
bx::mtxMul(temp, Rotation.M, rot);
|
||||
bx::memCopy(Rotation.M, temp, sizeof(temp));
|
||||
}
|
||||
|
||||
Vec3 Transform::Right() const
|
||||
{
|
||||
return {M.M[0], M.M[1], M.M[2]};
|
||||
}
|
||||
|
||||
Vec3 Transform::Up() const
|
||||
{
|
||||
return {M.M[4], M.M[5], M.M[6]};
|
||||
}
|
||||
|
||||
Vec3 Transform::Forward() const
|
||||
{
|
||||
return {M.M[8], M.M[9], M.M[10]};
|
||||
}
|
||||
|
||||
void Transform::UpdateMatrix()
|
||||
{
|
||||
Mat4 pos;
|
||||
Mat4 scale;
|
||||
bx::mtxTranslate(pos.M, Position.x, Position.y, Position.z);
|
||||
bx::mtxScale(scale.M, Scale.x, Scale.y, Scale.z);
|
||||
Mat4 temp;
|
||||
bx::mtxMul(temp.M, scale.M, Rotation.M);
|
||||
bx::mtxMul(M.M, temp.M, pos.M);
|
||||
bx::mtxInverse(MI.M, M.M);
|
||||
}
|
||||
|
||||
Vec3 Transform::GlobalToLocalDirection(Vec3 global)
|
||||
{
|
||||
UpdateMatrix();
|
||||
float in[4]{global.x, global.y, global.z, 0.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, Transpose(MI).M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
Vec3 Transform::GlobalToLocalPoint(Vec3 global)
|
||||
{
|
||||
UpdateMatrix();
|
||||
float in[4]{global.x, global.y, global.z, 1.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, MI.M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
Vec3 Transform::LocalToGlobalDirection(Vec3 local)
|
||||
{
|
||||
UpdateMatrix();
|
||||
float in[4]{local.x, local.y, local.z, 0.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, Transpose(M).M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
Vec3 Transform::LocalToGlobalPoint(Vec3 local)
|
||||
{
|
||||
UpdateMatrix();
|
||||
float in[4]{local.x, local.y, local.z, 1.0f};
|
||||
float out[4]{0.0f};
|
||||
bx::vec4MulMtx(out, in, M.M);
|
||||
return {out[0], out[1], out[2]};
|
||||
}
|
||||
void Transform::SetPosition(Vec3 pos)
|
||||
{
|
||||
Position = {pos.x, pos.y, pos.z};
|
||||
}
|
||||
Vec3 Transform::GetPosition()
|
||||
{
|
||||
return {Position.x, Position.y, Position.z};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../gen/Generated.h"
|
||||
#include "bx/math.h"
|
||||
#include <cstdint>
|
||||
|
||||
inline int32_t SetFlags(int32_t in, int32_t flags)
|
||||
{
|
||||
@@ -24,33 +23,6 @@ inline bool GetFlag(int32_t in, int32_t flags)
|
||||
return (in & flags) > 0;
|
||||
}
|
||||
|
||||
struct Transform
|
||||
{
|
||||
Gen::Mat4 M;
|
||||
Gen::Mat4 MI;
|
||||
bx::Vec3 Position{0.0f, 0.0f, 0.0f};
|
||||
Gen::Mat4 Rotation;
|
||||
bx::Vec3 Scale{1.0f, 1.0f, 1.0f};
|
||||
|
||||
static void CreateTransform(float* out, bx::Vec3 pos, bx::Quaternion rot, bx::Vec3 scale);
|
||||
void Translate(Gen::Vec3 offset);
|
||||
void TranslateLocal(Gen::Vec3 offset);
|
||||
void Rotate(Gen::Vec3 rotation);
|
||||
void RotateLocal(Gen::Vec3 rotation);
|
||||
Gen::Vec3 LocalToGlobalPoint(Gen::Vec3 local);
|
||||
Gen::Vec3 LocalToGlobalDirection(Gen::Vec3 local);
|
||||
Gen::Vec3 GlobalToLocalPoint(Gen::Vec3 global);
|
||||
Gen::Vec3 GlobalToLocalDirection(Gen::Vec3 global);
|
||||
Gen::Vec3 Right() const;
|
||||
Gen::Vec3 Up() const;
|
||||
Gen::Vec3 Forward() const;
|
||||
void SetPosition(Gen::Vec3 pos);
|
||||
Gen::Vec3 GetPosition();
|
||||
const float* GetPtr();
|
||||
void UpdateMatrix();
|
||||
void UpdateMatrixForCam();
|
||||
};
|
||||
|
||||
struct SharedData;
|
||||
|
||||
namespace Game
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace Game
|
||||
|
||||
struct PlayerData
|
||||
{
|
||||
Transform PlayerCamTransform;
|
||||
Transform FreeflyCamTransform;
|
||||
Gen::Transform PlayerCamTransform;
|
||||
Gen::Transform FreeflyCamTransform;
|
||||
Gen::Mat4 Projection;
|
||||
Gen::Mat4 ProjectionInverse;
|
||||
float FreeflyXRot = 0.0f;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Game
|
||||
if (!Visible) return;
|
||||
auto& rendering = GameRendering::Get();
|
||||
|
||||
Transform.UpdateMatrix();
|
||||
UpdateMatrix(Transform);
|
||||
bgfx::setTransform(Transform.M.M);
|
||||
|
||||
const Model& currentModel = models[ModelH.ModelIdx];
|
||||
@@ -95,6 +95,7 @@ namespace Game
|
||||
needReset |= Tests.Setup(storagePtr, needReset);
|
||||
needReset |= PuzzleTiles.Setup(storagePtr, needReset);
|
||||
needReset |= UIQuads.Setup(storagePtr, needReset);
|
||||
needReset |= LevelEntities.Setup(storagePtr, needReset);
|
||||
|
||||
Puzzle::Setup();
|
||||
|
||||
@@ -214,13 +215,13 @@ namespace Game
|
||||
bx::mtxRotateXYZ(player.FreeflyCamTransform.Rotation.M, player.FreeflyXRot, player.FreeflyYRot, 0.0f);
|
||||
}
|
||||
|
||||
player.FreeflyCamTransform.TranslateLocal({0.0f, 0.0f, inputVec.z});
|
||||
player.FreeflyCamTransform.TranslateLocal({inputVec.x, 0.0f, 0.0f});
|
||||
TranslateLocal(player.FreeflyCamTransform, {0.0f, 0.0f, inputVec.z});
|
||||
TranslateLocal(player.FreeflyCamTransform, {inputVec.x, 0.0f, 0.0f});
|
||||
}
|
||||
else if (player.CameraM == CameraMode::Walk)
|
||||
{
|
||||
player.PlayerCamTransform.TranslateLocal({0.0f, 0.0f, inputVec.z});
|
||||
player.PlayerCamTransform.TranslateLocal({inputVec.x, 0.0f, 0.0f});
|
||||
TranslateLocal(player.PlayerCamTransform, {0.0f, 0.0f, inputVec.z});
|
||||
TranslateLocal(player.PlayerCamTransform, {inputVec.x, 0.0f, 0.0f});
|
||||
player.PlayerCamTransform.Position.y = 3.0f;
|
||||
|
||||
player.WalkXRot += rotInput.x;
|
||||
@@ -261,12 +262,12 @@ namespace Game
|
||||
Cubes.Get(PlayerOutsideViewCube).EData.Visible = isFreefly;
|
||||
if (isFreefly)
|
||||
{
|
||||
player.FreeflyCamTransform.UpdateMatrix();
|
||||
UpdateMatrix(player.FreeflyCamTransform);
|
||||
bgfx::setViewTransform(viewId, player.FreeflyCamTransform.MI.M, &player.Projection.M[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.PlayerCamTransform.UpdateMatrix();
|
||||
UpdateMatrix(player.PlayerCamTransform);
|
||||
bgfx::setViewTransform(viewId, player.PlayerCamTransform.MI.M, &player.Projection.M[0]);
|
||||
}
|
||||
|
||||
@@ -325,15 +326,15 @@ namespace Game
|
||||
auto& visuals = Puzzle::GetStaticPuzzleData().Visuals;
|
||||
|
||||
Transform& camTransform = GetInstance().Player.PlayerCamTransform;
|
||||
camTransform.UpdateMatrix();
|
||||
Vec3 cameraPos = camTransform.GetPosition();
|
||||
UpdateMatrix(camTransform);
|
||||
Vec3 cameraPos = camTransform.Position;
|
||||
|
||||
Transform boardTransform;
|
||||
boardTransform.Rotation = camTransform.Rotation;
|
||||
Vec3 fw = {camTransform.M.M[8], camTransform.M.M[9], camTransform.M.M[10]};
|
||||
Vec3 pos = cameraPos;
|
||||
pos += fw * 1.0f;
|
||||
boardTransform.SetPosition(pos);
|
||||
boardTransform.Position = pos;
|
||||
|
||||
Vec2 mousePos = GetMousePos();
|
||||
mousePos.x = mousePos.x / window.WindowWidth;
|
||||
@@ -348,7 +349,7 @@ namespace Game
|
||||
mousePosCam4.z /= mousePosCam4.w,
|
||||
};
|
||||
|
||||
Vec3 mousePosWorld = camTransform.LocalToGlobalPoint(mousePosCam);
|
||||
Vec3 mousePosWorld = LocalToGlobalPoint(camTransform, mousePosCam);
|
||||
|
||||
for (int8_t y = 0; y < Data.HeightTiles / Puzzle::Config::CardSize; ++y)
|
||||
{
|
||||
@@ -376,7 +377,7 @@ namespace Game
|
||||
{
|
||||
cardPos = {x * Puzzle::Config::CardScaleWorld, -5.0f, y * Puzzle::Config::CardScaleWorld};
|
||||
}
|
||||
tile.EData.Transform.SetPosition(cardPos);
|
||||
tile.EData.Transform.Position = cardPos;
|
||||
bx::mtxRotateY(tile.EData.Transform.Rotation.M, card.Rotation * bx::kPi * 0.5f);
|
||||
|
||||
// Quad
|
||||
@@ -387,19 +388,19 @@ namespace Game
|
||||
: Vec4{1.0f, 1.0f, 1.0f, 1.0f};
|
||||
|
||||
quad.EData.Transform = boardTransform;
|
||||
quad.EData.Transform.TranslateLocal(Vec3{(float)card.Position.X, (float)card.Position.Y, 0.0f} *
|
||||
UICardOffset);
|
||||
TranslateLocal(quad.EData.Transform,
|
||||
Vec3{(float)card.Position.X, (float)card.Position.Y, 0.0f} * UICardOffset);
|
||||
quad.EData.Transform.Scale = {0.1f, 0.1f, 0.1f};
|
||||
quad.EData.Transform.Rotate(Vec3{bx::kPi * 0.5f, 0.0f, (1.0f - card.Rotation * 0.5f) * bx::kPi});
|
||||
Rotate(quad.EData.Transform, Vec3{bx::kPi * 0.5f, 0.0f, (1.0f - card.Rotation * 0.5f) * bx::kPi});
|
||||
|
||||
Vec3 quadPosWorld = quad.EData.Transform.GetPosition();
|
||||
Vec3 quadXWorld = quad.EData.Transform.LocalToGlobalPoint({1, 0, 0});
|
||||
Vec3 quadZWorld = quad.EData.Transform.LocalToGlobalPoint({0, 0, 1});
|
||||
Vec3 quadPosWorld = quad.EData.Transform.Position;
|
||||
Vec3 quadXWorld = LocalToGlobalPoint(quad.EData.Transform, {1, 0, 0});
|
||||
Vec3 quadZWorld = LocalToGlobalPoint(quad.EData.Transform, {0, 0, 1});
|
||||
Vec3 intersectPos;
|
||||
if (RayPlaneIntersect(
|
||||
camTransform.GetPosition(), mousePosWorld, quadPosWorld, quadXWorld, quadZWorld, intersectPos))
|
||||
camTransform.Position, mousePosWorld, quadPosWorld, quadXWorld, quadZWorld, intersectPos))
|
||||
{
|
||||
Vec3 quadSpaceIntersect = quad.EData.Transform.GlobalToLocalPoint(intersectPos);
|
||||
Vec3 quadSpaceIntersect = GlobalToLocalPoint(quad.EData.Transform, intersectPos);
|
||||
if (isValid && quadSpaceIntersect.x >= -1.0f && quadSpaceIntersect.x <= 1.0f &&
|
||||
quadSpaceIntersect.z >= -1.0f && quadSpaceIntersect.z <= 1.0f)
|
||||
{
|
||||
@@ -421,9 +422,9 @@ namespace Game
|
||||
{
|
||||
Vec3 dragPos = intersectPos;
|
||||
dragPos -= fw * 0.01f;
|
||||
quad.EData.Transform.SetPosition(dragPos);
|
||||
quad.EData.Transform.Position = dragPos;
|
||||
|
||||
Vec3 boardPos = boardTransform.GlobalToLocalPoint(intersectPos);
|
||||
Vec3 boardPos = GlobalToLocalPoint(boardTransform, intersectPos);
|
||||
Vec3 boardTilePos = boardPos / UICardOffset;
|
||||
int32_t xPos = (int32_t)bx::round(boardTilePos.x);
|
||||
int32_t yPos = (int32_t)bx::round(boardTilePos.y);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "../engine/Shared.h"
|
||||
#include "Global.h"
|
||||
#include "Log.h"
|
||||
#include "Puzzle.h"
|
||||
#include "rendering/Rendering.h"
|
||||
@@ -23,7 +22,7 @@ namespace Game
|
||||
{
|
||||
Gen::Vec4 DotColor{1.0f, 1.0f, 1.0f, 1.0f};
|
||||
Gen::Vec4 BaseColor{0.0f, 0.0f, 0.0f, 1.0f};
|
||||
Transform Transform;
|
||||
Gen::Transform Transform;
|
||||
EMaterial MaterialHandle = EMaterial::UNDEFINED;
|
||||
Gen::TextureHandle TextureHandle;
|
||||
Gen::ModelHandle ModelH;
|
||||
@@ -63,6 +62,12 @@ namespace Game
|
||||
EntityRenderData EData;
|
||||
};
|
||||
|
||||
ENTITY_HANDLE(LevelEntityHandle);
|
||||
struct LevelEntity
|
||||
{
|
||||
EntityRenderData EData;
|
||||
};
|
||||
|
||||
class IEntityManager
|
||||
{
|
||||
public:
|
||||
@@ -115,7 +120,7 @@ namespace Game
|
||||
|
||||
T& Get(HandleT handle)
|
||||
{
|
||||
if (handle.Idx > Count)
|
||||
if (handle.Idx >= Count)
|
||||
{
|
||||
ERROR_ONCE("OOB Access!");
|
||||
return InvalidObject;
|
||||
@@ -155,6 +160,8 @@ namespace Game
|
||||
EntityManager<TestEntity, TestEntityHandle, 32> Tests;
|
||||
EntityManager<PuzzleTileEntity, PuzzleTileEntityHandle, 1024> PuzzleTiles;
|
||||
EntityManager<UIQuadEntity, UIQuadEntityHandle, 1024> UIQuads;
|
||||
EntityManager<LevelEntity, LevelEntityHandle, 64> LevelEntities;
|
||||
|
||||
CubeHandle PlayerOutsideViewCube;
|
||||
|
||||
public:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../gen/Def.h"
|
||||
#include "Gen.h"
|
||||
#include "Global.h"
|
||||
#include "Instance.h"
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
#include "Mesh.h"
|
||||
#include "Puzzle.h"
|
||||
#include "Tools.h"
|
||||
#include "bx/timer.h"
|
||||
|
||||
#include "bx/filepath.h"
|
||||
#include "bx/timer.h"
|
||||
#include <imgui.h>
|
||||
#include <tracy/Tracy.hpp>
|
||||
|
||||
@@ -194,7 +195,7 @@ namespace Tools
|
||||
ImGui::Image(rendering.DitherTextures.RampTex.idx,
|
||||
{BX_COUNTOF(rendering.DitherTextures.BrightnessRamp), 8});
|
||||
}
|
||||
Vec3 quadPos = level.UIQuads.Get({0}).EData.Transform.GetPosition();
|
||||
Vec3 quadPos = level.UIQuads.Get({0}).EData.Transform.Position;
|
||||
ImGui::Text("%f %f %f", quadPos.x, quadPos.y, quadPos.z);
|
||||
|
||||
ImGui::Text("Shader log:");
|
||||
|
||||
Binary file not shown.
@@ -38,6 +38,15 @@ type Mat4
|
||||
}")
|
||||
}
|
||||
|
||||
type Transform
|
||||
{
|
||||
Mat4 M
|
||||
Mat4 MI
|
||||
Vec3 Position
|
||||
Mat4 Rotation
|
||||
Vec3 Scale Default("{1.0f, 1.0f, 1.0f}")
|
||||
}
|
||||
|
||||
type AssetHandle
|
||||
{
|
||||
u32 Idx Default("UINT32_MAX")
|
||||
@@ -126,3 +135,20 @@ type PuzzleData
|
||||
u32 GoalPositionCount
|
||||
PuzPos GoalPositions Arr(16)
|
||||
}
|
||||
|
||||
enum EMaterial
|
||||
{
|
||||
Default
|
||||
UI
|
||||
}
|
||||
|
||||
type SavedEntityRenderData
|
||||
{
|
||||
Vec4 BaseColor
|
||||
Vec4 HighlightColor
|
||||
Transform TF
|
||||
EMaterial Material
|
||||
TextureHandle Texture
|
||||
ModelHandle Model
|
||||
b Visible
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "../Log.h"
|
||||
#include "Dither.h"
|
||||
|
||||
#include "bx/math.h"
|
||||
|
||||
using namespace Gen;
|
||||
|
||||
void DitherGen(DitherData& data, int32_t recursion)
|
||||
|
||||
Reference in New Issue
Block a user