A 3D physics simulation built to simulate tens of thousands of spheres. Utilises threading, parallelisable code, and spatial partitioning to achieve this.
2 months
Through the use of a thread pool, many parts of the physics calculations are done on separate threads.
I found for this project that the best option was a uniform grid, which splits the world into equal sized cells on all axes. However a more data oriented approach is taken to allow parallelising.
Similar to my previous physics project, this one uses an iterative collision resolution process that decreases inter-penetration.
There are many windows that allow modification of settings and viewing debug information.
For this project, I built a custom profiler that uses start and end macros to create new timing nodes in a tree. This data can then be exported from the program as a .csv file.
Only when it is compiled in, allocations will be tracked and a linked list of all of them will be made. This allows walking the heap to check for corrupted data. I also have a custom new macro that lets me take in extra data of where the allocation was called from.