This should be a funny and easy first task. In the constructor of C_StaticMeshResource should be also constructed S_AABB box defining its boundary. S_AABB lies in Physics module and has easy (yet years old API). The implementer should create it during the construction of C_StaticMeshResource as you have here all the vertices. Then create a setter for it.
Hints
You can validate its correctness by using the debug tool C_DebugDraw::Instance().DrawAABB() in void C_StaticMesh::PerformDraw() const. This way you will see the AABB box.
To load model, you should put .obj file into /data/models/ and than add it to the /data/levels/main.xml as new component e.g. <staticMesh filePath="model.obj" />.
You can easily obtain such file by exporting blender. Just check the option to export the mesh as triangles during export.
Motivation
This engine has no frustum culling so far, this should be the first step toward implementing it. Having correct AABB will allow us to implement frustum and scene intersection.
This should be a funny and easy first task. In the constructor of
C_StaticMeshResource
should be also constructedS_AABB
box defining its boundary.S_AABB
lies in Physics module and has easy (yet years old API). The implementer should create it during the construction ofC_StaticMeshResource
as you have here all the vertices. Then create a setter for it.Hints
You can validate its correctness by using the debug tool
C_DebugDraw::Instance().DrawAABB()
invoid C_StaticMesh::PerformDraw() const
. This way you will see the AABB box.To load model, you should put .obj file into
/data/models/
and than add it to the/data/levels/main.xml
as new component e.g.<staticMesh filePath="model.obj" />
.You can easily obtain such file by exporting blender. Just check the option to export the mesh as triangles during export.
Motivation
This engine has no frustum culling so far, this should be the first step toward implementing it. Having correct AABB will allow us to implement frustum and scene intersection.