diff --git a/GameObjectManager.cpp b/GameObjectManager.cpp index f66de4c..8980807 100644 --- a/GameObjectManager.cpp +++ b/GameObjectManager.cpp @@ -89,6 +89,26 @@ void GameObjectManager::initialize() { ao1.activeObjectScreenMeshMutable.AssignFrom(ao1.activeObjectScreenMesh); ao1.activeObjectScreenMeshMutable.RefreshVBO(); + + + + ActiveObject cubeForFirstRoom; + cubeForFirstRoom.name = "cube"; + cubeForFirstRoom.activeObjectMesh = ZL::LoadFromTextFile("./cube001.txt"); + cubeForFirstRoom.activeObjectMesh.RotateByMatrix(QuatToMatrix(QuatFromRotateAroundX(M_PI * 0.5))); + cubeForFirstRoom.activeObjectMesh.Scale(30); + cubeForFirstRoom.activeObjectMeshMutable.AssignFrom(cubeForFirstRoom.activeObjectMesh); + cubeForFirstRoom.activeObjectMeshMutable.RefreshVBO(); + cubeForFirstRoom.objectPos = Vector3f{ 0,50 , 0 }; + cubeForFirstRoom.activeObjectTexturePtr = std::make_shared(CreateTextureDataFromBmp24("./Material_Base_color_1001-_2_.bmp")); + cubeForFirstRoom.activeObjectScreenTexturePtr = std::make_shared(CreateTextureDataFromBmp24("./aoscreen01.bmp")); + cubeForFirstRoom.activeObjectScreenMesh = CreateRect2D({ 0.f, 0.f }, { 64.f, 64.f }, 0.5); + cubeForFirstRoom.activeObjectScreenMeshMutable.AssignFrom(cubeForFirstRoom.activeObjectScreenMesh); + cubeForFirstRoom.activeObjectScreenMeshMutable.RefreshVBO(); + + + + /* ActiveObject ao2; ao2.name = "superchair001"; @@ -111,6 +131,7 @@ void GameObjectManager::initialize() { Room room_1; room_1.roomTexture = std::make_shared(CreateTextureDataFromBmp24("./Material_Base_color_1001.bmp")); room_1.objects.push_back(ao1); + room_1.objects.push_back(cubeForFirstRoom); room_1.sound_name = "Symphony No.6 (1st movement).ogg"; room_1.roomLogic = createRoom1Logic(); room_1.textMesh = preloadedRoomMeshArr[0]; diff --git a/Material_Base_color_1001-_2_.bmp b/Material_Base_color_1001-_2_.bmp new file mode 100644 index 0000000..56e8843 Binary files /dev/null and b/Material_Base_color_1001-_2_.bmp differ diff --git a/cube001.txt b/cube001.txt new file mode 100644 index 0000000..9261703 --- /dev/null +++ b/cube001.txt @@ -0,0 +1,93 @@ +===Vertices: 8 +Vertex 0: +Vertex 1: +Vertex 2: +Vertex 3: +Vertex 4: +Vertex 5: +Vertex 6: +Vertex 7: +===UV Coordinates: +Face count: 12 +Face 0 +UV Count: 3 + UV + UV + UV +Face 1 +UV Count: 3 + UV + UV + UV +Face 2 +UV Count: 3 + UV + UV + UV +Face 3 +UV Count: 3 + UV + UV + UV +Face 4 +UV Count: 3 + UV + UV + UV +Face 5 +UV Count: 3 + UV + UV + UV +Face 6 +UV Count: 3 + UV + UV + UV +Face 7 +UV Count: 3 + UV + UV + UV +Face 8 +UV Count: 3 + UV + UV + UV +Face 9 +UV Count: 3 + UV + UV + UV +Face 10 +UV Count: 3 + UV + UV + UV +Face 11 +UV Count: 3 + UV + UV + UV +===Normals: +Vertex 0: Normal +Vertex 1: Normal +Vertex 2: Normal +Vertex 3: Normal +Vertex 4: Normal +Vertex 5: Normal +Vertex 6: Normal +Vertex 7: Normal +===Triangles: 12 +Triangle: [4, 2, 0] +Triangle: [2, 7, 3] +Triangle: [6, 5, 7] +Triangle: [1, 7, 5] +Triangle: [0, 3, 1] +Triangle: [4, 1, 5] +Triangle: [4, 6, 2] +Triangle: [2, 6, 7] +Triangle: [6, 4, 5] +Triangle: [1, 3, 7] +Triangle: [0, 2, 3] +Triangle: [4, 0, 1] diff --git a/cubic_icon2.bmp32 b/cubic_icon2.bmp32 new file mode 100644 index 0000000..afb2723 Binary files /dev/null and b/cubic_icon2.bmp32 differ