In my amateur 2D rigid body physics engine for a game I react on collisions between two bodies with an impulse j (formula 11) as explained here.
To calculate this impulse I need one contact point P between the two colliding bodies and the perpendicular normal n of the edge the contact point of A is colliding with.
That works wonderful. At least as far as I don't have multiple contact points. But what to do if this is not the case?
Should I calculate an impulse for each of the contact points or is there a way to reduce multiple contact points to a single one if this is a correct solution?
As an example I have following two situations, where two bodies collide. The x denotes the center of mass and the tips of each triangle pointing down an vertice of A that is colliding with the edge underneath:
_____________________ _____________________ | | | | A | x | A | | | _____________ | | x ______ | \ / \ / | / \ / \/ \/ | __ / \/ _____________________ \ / \ / ___________ | | \/ \/ / | B | x | B _________/ x | |_____________________| |______________________|
In the left situation its intuitively pretty clear that I can reduce the two collision points to one exactly in the middle between both since the this would be collinear to both centers of mass. Also as normal n the perpendicular vector of the edge both vertices are colliding with can be chosen.
But what to do in the right situation?