Practical sessions
Here are some additions you could make to the code:
- Add UI controls for the quadtree configuration.
Currently, the quadtree is statically initialized during the renderer init()
call. Add UI controls and a setter callback function to adjust the maximum number of instances before splitting up the box and the maximum depth of the tree.
- Add UI controls to configure the world borders.
The instances are running around in the virtual world, and if one instance reaches the virtual border set in mWorldBoundaries
, it will be rotated to stay inside the boundaries. Add some sliders and callbacks to control the origin and size of the virtual world, and make sure the Instance Positions window will be updated, too.
- Implement an octree plus three-dimensional AABB checks.
Right now, we are using only two-dimensional bounding boxes for the instances, just as if the instances were seen top-down. Extend the quadtree to become...