The first thing I did was to expand the given sRigidBodyState class. I’ve changed all the data variables to be private and added two new variables for mass and force. I also added and implemented some public interfaces for modifying a rigid body’s property.
I added a sCollider struct to store data for colliders. The struct contains the information of a collider’s shape, geometry data and whether it’s static or not.
The struct itself does not contain methods for checking collision. All collision checking is handled by the physic engines functions, which are declared in Physics.h.
The human-readable format for rigid bodies looks like this:
The human-readable format for colliders looks like the following:
The next step, I will be creating builder projects for both rigid body and collider assets. And I will also implement the collision checking functions I defined in Physics.h.