Game Development Reference
In-Depth Information
index=i;
}
}
if (index == numContacts) break;
// Match the awake state at the contact.
//c[index].matchAwakeState();
// Resolve the penetration.
c[index].applyPositionChange(velocityChange,
rotationChange,
rotationAmount,
max);//-positionEpsilon);
// Again this action may have changed the penetration of other
// bodies, so we update contacts.
for(i=0; i<numContacts; i++)
{
if(c[i].body[0])
{
if(c[i].body[0]==c[index].body[0])
{
cp = rotationChange[0].vectorProduct(c[i].
relativeContactPosition[0]);
cp += velocityChange[0];
c[i].penetration -=
rotationAmount[0]*cp.scalarProduct(c[i].
contactNormal);
}
else if(c[i].body[0]==c[index].body[1])
{
cp = rotationChange[1].vectorProduct(c[i].
relativeContactPosition[0]);
cp += velocityChange[1];
c[i].penetration -=
rotationAmount[1]*cp.scalarProduct(c[i].
contactNormal);
}
}
if(c[i].body[1])
Search Nedrilad ::




Custom Search