a guest May 22nd, 2019 47 Never
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] +
- // The sign of the change is negative if we're dealing
- // with the second body in a contact.
- c[i].contactVelocity +=
- * (b?-1:1);
RAW Paste Data