Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline void ReplaceAdd(const CM_MANIFOLD_CONTACT& _cNewContact) {
- float fMinDist = CONTACT_POINT_BREAKING_LENGTH_SQ;
- int iReplaceIndex = -1;
- for (unsigned int I = 0U; I < m_ui32TotalContacts; ++I) {
- const CM_MANIFOLD_CONTACT& cContact = m_cContacts[I];
- CVector3 vDiff = cContact.vLocalPointOnA - _cNewContact.vLocalPointOnA;
- float fDist = vDiff.LenSq();
- if ( fDist < fMinDist ) {
- fMinDist = fDist;
- iReplaceIndex = I;
- }
- }
- if (iReplaceIndex > -1) {
- ReplaceContact(_cNewContact, iReplaceIndex);
- return;
- }
- AddContact(_cNewContact);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement