Description

This project was completed for a university assignment which required us to create a physics engine from scratch in C++. The project took around 3 months to complete and in that time I produced a prototype which had:

  • Full Particle physics simulation
  • Particle Physics Joints and Force Generators including Rods, Elastics, Springs and Gravity Generators.
  • Full Rigidbody physics simulation.
  • Rigidbody physics joints and force generators.
  • Broad and Narrow phase collision detection using Spacial Partioning.

What I learnt.

This project was built upon my graphics engine (which can also be seen on my portfolio here) and as a result of that the codebase for the engine grew substantially. One of the major learning experiences was dealing with a growing codebase that started to have hundreds of classes, it's easy to code yourself into corners and I had to be very careful to avoid that

I also naturally learnt about how to go about programming particle and rigidbody physics, and how to implement the necessary maths behind them. While I had some familiarity with coding accurate velocity I was had never tried to implement 3D Rigidbody collision and it was the hardest part of the project to get right.

If I was to do this project again I would focus sooner on refactoring the base engine to work with the physics maths libraries, I built my own maths libraries on top of existing ones in the engine and they weren't full compatible. I made conversion functions but in the long run they just because unweildy and long winded to use. As the physics system is fairly related to the renderer (sharing linear algebra constructs) having completely seperate data types was a mistake I wouldn't make again.

Media