I am currently making a physics engine in Rust.
The 2 main data structures concerning collision detection are:
RigidBody: Physics-related aspects of the body. Contains a reference to a Collider structure.
Collider: Shape and structural-related aspects
However, I am unsure as to which data structure should store the instance fields:
- mass (or inverse mass)
- inertia (or inverse inertia)
- angle of orientation
The reason for this absolute segregation is that during collision detection, only references to the concerning Colliders will be passed.
Could someone please advise me on the matter?