preserve max relative velocity on a colision report time slice
parent
0a9f06fda7
commit
42a072d181
|
@ -127,8 +127,19 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
float lastVel = m_objCollisionList[localID].RelativeSpeed;
|
||||||
if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth)
|
if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth)
|
||||||
|
{
|
||||||
|
if(Math.Abs(lastVel) > Math.Abs(contact.RelativeSpeed))
|
||||||
|
contact.RelativeSpeed = lastVel;
|
||||||
m_objCollisionList[localID] = contact;
|
m_objCollisionList[localID] = contact;
|
||||||
|
}
|
||||||
|
else if(Math.Abs(lastVel) < Math.Abs(contact.RelativeSpeed))
|
||||||
|
{
|
||||||
|
ContactPoint tmp = m_objCollisionList[localID];
|
||||||
|
tmp.RelativeSpeed = contact.RelativeSpeed;
|
||||||
|
m_objCollisionList[localID] = tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue