Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (unsigned i = 0; i < numContacts; i++)
- {
- // Check each body in the contact
- for (unsigned b = 0; b < 2; b++) if (c[i].body[b])
- {
- // Check for a match with each body in the newly
- // resolved contact
- for (unsigned d = 0; d < 2; d++)
- {
- if (c[i].body[b] == c[index].body[d])
- {
- deltaVel = velocityChange[d] +
- rotationChange[d].vectorProduct(
- c[i].relativeContactPosition[b]);
- // The sign of the change is negative if we're dealing
- // with the second body in a contact.
- c[i].contactVelocity +=
- c[i].contactToWorld.transformTranspose(deltaVel)
- * (b?-1:1);
- c[i].calculateDesiredDeltaVelocity(duration);
- }
- }
- }
- }
- velocityIterationsUsed++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement