diff options
author | UbitUmarov | 2016-07-25 00:47:43 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-25 00:47:43 +0100 |
commit | 42a072d1814f68238cdbb4c977222bb5d620c827 (patch) | |
tree | fcb3ebd08ba447ad4ba0c12d0bf09838d96eb091 /OpenSim/Region | |
parent | ubOde actually revert last change don't send unnecessary empty collisions, wi... (diff) | |
download | opensim-SC_OLD-42a072d1814f68238cdbb4c977222bb5d620c827.zip opensim-SC_OLD-42a072d1814f68238cdbb4c977222bb5d620c827.tar.gz opensim-SC_OLD-42a072d1814f68238cdbb4c977222bb5d620c827.tar.bz2 opensim-SC_OLD-42a072d1814f68238cdbb4c977222bb5d620c827.tar.xz |
preserve max relative velocity on a colision report time slice
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs index 393afae..f82e289 100644 --- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs | |||
@@ -126,9 +126,20 @@ namespace OpenSim.Region.PhysicsModules.SharedBase | |||
126 | m_objCollisionList.Add(localID, contact); | 126 | m_objCollisionList.Add(localID, contact); |
127 | } | 127 | } |
128 | else | 128 | else |
129 | { | 129 | { |
130 | float lastVel = m_objCollisionList[localID].RelativeSpeed; | ||
130 | if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth) | 131 | if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth) |
132 | { | ||
133 | if(Math.Abs(lastVel) > Math.Abs(contact.RelativeSpeed)) | ||
134 | contact.RelativeSpeed = lastVel; | ||
131 | m_objCollisionList[localID] = contact; | 135 | m_objCollisionList[localID] = contact; |
136 | } | ||
137 | else if(Math.Abs(lastVel) < Math.Abs(contact.RelativeSpeed)) | ||
138 | { | ||
139 | ContactPoint tmp = m_objCollisionList[localID]; | ||
140 | tmp.RelativeSpeed = contact.RelativeSpeed; | ||
141 | m_objCollisionList[localID] = tmp; | ||
142 | } | ||
132 | } | 143 | } |
133 | } | 144 | } |
134 | 145 | ||