Manifold for spheres
In order to resolve collisions between objects that have volume, we need to learn more about the nature of the mentioned collisions. This additional information is known as a Collision Manifold. A typical collision manifold usually contains the following things:
- The collision normal
- The penetration distance
- A set of contact points
Additionally, a manifold might also contain the following things:
- Pointers to the colliding objects
- The relative velocity of the collision
- Nature of the collision (no collision, colliding, penetrating)
Let's assume that we have two colliding objects, A and B. The collision normal of the manifold between the two, tells us what direction each object needs to move in to resolve the collision. If A moves in the negative direction of the normal and B moves in the positive direction, the objects will no longer intersect.
The penetration distance of the manifold is half of the total length of penetration. Each object needs to move by the penetration...