bug fix: crash when too many collisions on a ode step
parent
c58ec342ff
commit
bfac09849f
|
@ -995,12 +995,12 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
|
|
||||||
d.ContactGeom maxContact = curContact;
|
d.ContactGeom maxContact = curContact;
|
||||||
// if (IgnoreNegSides && curContact.side1 < 0)
|
// if (IgnoreNegSides && curContact.side1 < 0)
|
||||||
// maxContact.depth = float.MinValue;
|
// maxContact.depth = float.MinValue;
|
||||||
|
|
||||||
d.ContactGeom minContact = curContact;
|
d.ContactGeom minContact = curContact;
|
||||||
// if (IgnoreNegSides && curContact.side1 < 0)
|
// if (IgnoreNegSides && curContact.side1 < 0)
|
||||||
// minContact.depth = float.MaxValue;
|
// minContact.depth = float.MaxValue;
|
||||||
|
|
||||||
IntPtr Joint;
|
IntPtr Joint;
|
||||||
bool FeetCollision = false;
|
bool FeetCollision = false;
|
||||||
|
@ -1011,30 +1011,34 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (m_global_contactcount >= maxContactsbeforedeath)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// if (!(IgnoreNegSides && curContact.side1 < 0))
|
// if (!(IgnoreNegSides && curContact.side1 < 0))
|
||||||
{
|
{
|
||||||
bool noskip = true;
|
bool noskip = true;
|
||||||
if (dop1ava)
|
if (dop1ava)
|
||||||
{
|
{
|
||||||
if (!(((OdeCharacter)p1).Collide(g1,false, ref curContact, ref FeetCollision)))
|
if (!(((OdeCharacter)p1).Collide(g1, false, ref curContact, ref FeetCollision)))
|
||||||
|
|
||||||
noskip = false;
|
noskip = false;
|
||||||
}
|
}
|
||||||
else if (dop2ava)
|
else if (dop2ava)
|
||||||
{
|
{
|
||||||
if (!(((OdeCharacter)p2).Collide(g2,true, ref curContact, ref FeetCollision)))
|
if (!(((OdeCharacter)p2).Collide(g2, true, ref curContact, ref FeetCollision)))
|
||||||
noskip = false;
|
noskip = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noskip)
|
if (noskip)
|
||||||
{
|
{
|
||||||
m_global_contactcount++;
|
m_global_contactcount++;
|
||||||
|
if (m_global_contactcount >= maxContactsbeforedeath)
|
||||||
|
break;
|
||||||
|
|
||||||
ncontacts++;
|
ncontacts++;
|
||||||
|
|
||||||
Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
|
Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
|
||||||
|
if (Joint == IntPtr.Zero)
|
||||||
|
break;
|
||||||
|
|
||||||
d.JointAttach(Joint, b1, b2);
|
d.JointAttach(Joint, b1, b2);
|
||||||
|
|
||||||
if (curContact.depth > maxContact.depth)
|
if (curContact.depth > maxContact.depth)
|
||||||
|
|
Loading…
Reference in New Issue