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