Other Code Projects
Octree Spatial Optimization
This code demonstrate how Spatial Optimization is achieved through the use of octree. About 3000 objects are generated and each object checks for collision against each other objects. When the octree is applied, the objects only check for collisions with other objects within their area. The frame rate will go up when the octree is used, it is noticeable when the bounding boxes are not drawn. It uses Alberto Bobadila's ReEngine.
Click here to download a Visual Studio 2013 project and code files. The code for the octree is in the MyOctant.h and MyOctant.cpp. Controls are in AppClassControls.cpp.
Separation Axis Test
This demonstrates how the SAT is used to check collisions for objects with a rotated bounding box. We take three axis from each object and projects the vertices from each object's bounding box. If the projected objects do not overlap at one axis, this means they do not touch. The SAT code is in the collision check method. This is created using Alberto Bobadila's ReEngine.
Click here to download a Visual Studio 2013 project and code files. The code for the SAT is in the IsColliding method in MyBOClass.cpp. Controls are in AppClassControls.cpp.