diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index ccaff5e..98f2eac 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |||
@@ -110,6 +110,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
110 | private bool m_alwaysRun = false; | 110 | private bool m_alwaysRun = false; |
111 | 111 | ||
112 | private bool _zeroFlag = false; | 112 | private bool _zeroFlag = false; |
113 | private bool m_haveLastFallVel = false; | ||
113 | 114 | ||
114 | 115 | ||
115 | private uint m_localID = 0; | 116 | private uint m_localID = 0; |
@@ -1087,6 +1088,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1087 | if (ctz.Z < 0) | 1088 | if (ctz.Z < 0) |
1088 | ctz.Z = 0; | 1089 | ctz.Z = 0; |
1089 | 1090 | ||
1091 | if(!m_haveLastFallVel) | ||
1092 | { | ||
1093 | m_lastFallVel = vel; | ||
1094 | m_haveLastFallVel = true; | ||
1095 | } | ||
1096 | |||
1090 | Vector3 n = _parent_scene.GetTerrainNormalAtXY(posch.X, posch.Y); | 1097 | Vector3 n = _parent_scene.GetTerrainNormalAtXY(posch.X, posch.Y); |
1091 | float depth = terrainheight - chrminZ; | 1098 | float depth = terrainheight - chrminZ; |
1092 | 1099 | ||
@@ -1123,7 +1130,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1123 | contact.SurfaceNormal.X = -n.X; | 1130 | contact.SurfaceNormal.X = -n.X; |
1124 | contact.SurfaceNormal.Y = -n.Y; | 1131 | contact.SurfaceNormal.Y = -n.Y; |
1125 | contact.SurfaceNormal.Z = -n.Z; | 1132 | contact.SurfaceNormal.Z = -n.Z; |
1126 | contact.RelativeSpeed = -Vector3.Dot(m_lastFallVel, contact.SurfaceNormal);; | 1133 | contact.RelativeSpeed = Vector3.Dot(m_lastFallVel, n); |
1127 | contact.CharacterFeet = true; | 1134 | contact.CharacterFeet = true; |
1128 | AddCollisionEvent(0, contact); | 1135 | AddCollisionEvent(0, contact); |
1129 | m_lastFallVel = vel; | 1136 | m_lastFallVel = vel; |
@@ -1134,7 +1141,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1134 | 1141 | ||
1135 | else | 1142 | else |
1136 | { | 1143 | { |
1137 | m_lastFallVel = vel; | ||
1138 | m_colliderGroundfilter -= 5; | 1144 | m_colliderGroundfilter -= 5; |
1139 | if (m_colliderGroundfilter <= 0) | 1145 | if (m_colliderGroundfilter <= 0) |
1140 | { | 1146 | { |
@@ -1145,7 +1151,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1145 | } | 1151 | } |
1146 | else | 1152 | else |
1147 | { | 1153 | { |
1148 | m_lastFallVel = vel; | 1154 | m_haveLastFallVel = false; |
1149 | m_colliderGroundfilter -= 5; | 1155 | m_colliderGroundfilter -= 5; |
1150 | if (m_colliderGroundfilter <= 0) | 1156 | if (m_colliderGroundfilter <= 0) |
1151 | { | 1157 | { |
@@ -1574,14 +1580,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1574 | 1580 | ||
1575 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; | 1581 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; |
1576 | 1582 | ||
1577 | if (!SentEmptyCollisionsEvent || ncolisions > 0) | 1583 | // if (!SentEmptyCollisionsEvent || ncolisions > 0) |
1578 | { | 1584 | { |
1579 | base.SendCollisionUpdate(CollisionEventsThisFrame); | 1585 | base.SendCollisionUpdate(CollisionEventsThisFrame); |
1580 | 1586 | ||
1581 | if (ncolisions == 0) | 1587 | if (ncolisions == 0) |
1582 | { | 1588 | { |
1583 | SentEmptyCollisionsEvent = true; | 1589 | SentEmptyCollisionsEvent = true; |
1584 | _parent_scene.RemoveCollisionEventReporting(this); | 1590 | // _parent_scene.RemoveCollisionEventReporting(this); |
1585 | } | 1591 | } |
1586 | else | 1592 | else |
1587 | { | 1593 | { |