Hi there,
What i'm after is an method to move two rigid bodies together in one step so that two arbitrarily chosen points (one on each body) are just touching. So it would be like a position correction impulse but with a massive time-step (the traditional method stops working very well for big angles)...
Its simple for a linear only motion:
correct = pointOnB - pointOnA;
denom = 1 / (invMassA + invMassB);
movementImpulse = -correct * denom;
bodyA.pos -= movementImpulse * invMassA;
bodyB.pos += movementImpulse * invMassB;
This biases the masses so the lighter object moves more, it would be nice the candidate linear+rotational method also did this but with inertia tensors 🙂 I'm stumped though...
Cheers, Paul.
What i'm after is an method to move two rigid bodies together in one step so that two arbitrarily chosen points (one on each body) are just touching. So it would be like a position correction impulse but with a massive time-step (the traditional method stops working very well for big angles)...
Its simple for a linear only motion:
correct = pointOnB - pointOnA;
denom = 1 / (invMassA + invMassB);
movementImpulse = -correct * denom;
bodyA.pos -= movementImpulse * invMassA;
bodyB.pos += movementImpulse * invMassB;
This biases the masses so the lighter object moves more, it would be nice the candidate linear+rotational method also did this but with inertia tensors 🙂 I'm stumped though...
Cheers, Paul.