From 527315e97600fbae005af27e5e786b325483042d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D1=8C=D0=B1=D0=B5=D1=80=D1=82=20=D0=93=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=B5=D0=B2?= Date: Sun, 2 Mar 2025 16:21:42 +0600 Subject: [PATCH] now she stays on the ground i think --- GameObjectManager.cpp | 6 +++--- Renderer.cpp | 7 +++++++ Renderer.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/GameObjectManager.cpp b/GameObjectManager.cpp index 82f10c7..5077933 100644 --- a/GameObjectManager.cpp +++ b/GameObjectManager.cpp @@ -27,11 +27,11 @@ void GameObjectManager::initialize() { testObjMeshMutable.data = testObjMesh; testObjMeshMutable.RefreshVBO(); - textMesh = ZL::LoadFromTextFile("./mesh_first_room.txt"); // Add ZL:: namespace - textMesh.Scale(17); + textMesh = ZL::LoadFromTextFile("./textures/mesh_first_room.txt"); // Add ZL:: namespace + textMesh.Scale(10); textMesh.SwapZandY(); textMesh.RotateByMatrix(QuatToMatrix(QuatFromRotateAroundX(M_PI * 0.5))); - + textMesh.Move(Vector3f{0, 70, 0}); coneMesh = ZL::LoadFromTextFile("./cone001.txt"); // Add ZL:: namespace coneMesh.Scale(200); diff --git a/Renderer.cpp b/Renderer.cpp index 3c81717..6f67ea6 100755 --- a/Renderer.cpp +++ b/Renderer.cpp @@ -286,6 +286,13 @@ namespace ZL { PositionData[i] = PositionData[i] * scale; } } + void VertexDataStruct::Move(Vector3f diff) + { + for (int i = 0; i < PositionData.size(); i++) + { + PositionData[i] = PositionData[i] + diff; + } + } void VertexDataStruct::SwapZandY() { diff --git a/Renderer.h b/Renderer.h index 405b2aa..95a6296 100755 --- a/Renderer.h +++ b/Renderer.h @@ -52,6 +52,7 @@ namespace ZL { void RotateByMatrix(Matrix3f m); void Scale(float scale); + void Move(Vector3f diff); void SwapZandY(); };