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(); };