diff options
author | UbitUmarov | 2016-07-24 21:29:34 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-24 21:29:34 +0100 |
commit | a572a22dd9fa6ae1b7fe8b3237decccc97af45fd (patch) | |
tree | 69eb02367f8165beac82e89cd8bbe3713373991f /OpenSim/Region/PhysicsModules/ubOde | |
parent | ubOde fix contact relative velocity sign (diff) | |
download | opensim-SC_OLD-a572a22dd9fa6ae1b7fe8b3237decccc97af45fd.zip opensim-SC_OLD-a572a22dd9fa6ae1b7fe8b3237decccc97af45fd.tar.gz opensim-SC_OLD-a572a22dd9fa6ae1b7fe8b3237decccc97af45fd.tar.bz2 opensim-SC_OLD-a572a22dd9fa6ae1b7fe8b3237decccc97af45fd.tar.xz |
ubOde try to improve contact velocity on first avatar collision with terrain
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index 55619c0..ccaff5e 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |||
@@ -80,6 +80,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
80 | private Vector3 m_rotationalVelocity; | 80 | private Vector3 m_rotationalVelocity; |
81 | private Vector3 m_size; | 81 | private Vector3 m_size; |
82 | private Vector3 m_collideNormal; | 82 | private Vector3 m_collideNormal; |
83 | private Vector3 m_lastFallVel; | ||
83 | private Quaternion m_orientation; | 84 | private Quaternion m_orientation; |
84 | private Quaternion m_orientation2D; | 85 | private Quaternion m_orientation2D; |
85 | private float m_mass = 80f; | 86 | private float m_mass = 80f; |
@@ -1114,7 +1115,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1114 | 1115 | ||
1115 | m_iscollidingGround = true; | 1116 | m_iscollidingGround = true; |
1116 | 1117 | ||
1117 | |||
1118 | ContactPoint contact = new ContactPoint(); | 1118 | ContactPoint contact = new ContactPoint(); |
1119 | contact.PenetrationDepth = depth; | 1119 | contact.PenetrationDepth = depth; |
1120 | contact.Position.X = localpos.X; | 1120 | contact.Position.X = localpos.X; |
@@ -1123,9 +1123,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1123 | contact.SurfaceNormal.X = -n.X; | 1123 | contact.SurfaceNormal.X = -n.X; |
1124 | contact.SurfaceNormal.Y = -n.Y; | 1124 | contact.SurfaceNormal.Y = -n.Y; |
1125 | contact.SurfaceNormal.Z = -n.Z; | 1125 | contact.SurfaceNormal.Z = -n.Z; |
1126 | contact.RelativeSpeed = -vel.Z; | 1126 | contact.RelativeSpeed = -Vector3.Dot(m_lastFallVel, contact.SurfaceNormal);; |
1127 | contact.CharacterFeet = true; | 1127 | contact.CharacterFeet = true; |
1128 | AddCollisionEvent(0, contact); | 1128 | AddCollisionEvent(0, contact); |
1129 | m_lastFallVel = vel; | ||
1129 | 1130 | ||
1130 | // vec.Z *= 0.5f; | 1131 | // vec.Z *= 0.5f; |
1131 | } | 1132 | } |
@@ -1133,6 +1134,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1133 | 1134 | ||
1134 | else | 1135 | else |
1135 | { | 1136 | { |
1137 | m_lastFallVel = vel; | ||
1136 | m_colliderGroundfilter -= 5; | 1138 | m_colliderGroundfilter -= 5; |
1137 | if (m_colliderGroundfilter <= 0) | 1139 | if (m_colliderGroundfilter <= 0) |
1138 | { | 1140 | { |
@@ -1143,6 +1145,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1143 | } | 1145 | } |
1144 | else | 1146 | else |
1145 | { | 1147 | { |
1148 | m_lastFallVel = vel; | ||
1146 | m_colliderGroundfilter -= 5; | 1149 | m_colliderGroundfilter -= 5; |
1147 | if (m_colliderGroundfilter <= 0) | 1150 | if (m_colliderGroundfilter <= 0) |
1148 | { | 1151 | { |