bug fix: crash when too many collisions on a ode step

avinationmerge
UbitUmarov 2013-01-26 06:12:26 +00:00
parent c58ec342ff
commit bfac09849f
1 changed files with 43 additions and 39 deletions

View File

@ -1011,8 +1011,6 @@ 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))
{ {
@ -1032,9 +1030,15 @@ namespace OpenSim.Region.Physics.OdePlugin
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)