aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-19 14:49:20 +0000
committerJeff Ames2008-05-19 14:49:20 +0000
commit7b0ca6ea30871e879cd0dce1a8ea07dd47a1dc31 (patch)
treebbfefe9e7717609f39e8d125e1f6e209052050b8 /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parentUpdate ODE binary for OS X to opensim-libs r43 (diff)
downloadopensim-SC-7b0ca6ea30871e879cd0dce1a8ea07dd47a1dc31.zip
opensim-SC-7b0ca6ea30871e879cd0dce1a8ea07dd47a1dc31.tar.gz
opensim-SC-7b0ca6ea30871e879cd0dce1a8ea07dd47a1dc31.tar.bz2
opensim-SC-7b0ca6ea30871e879cd0dce1a8ea07dd47a1dc31.tar.xz
Attempt to fix incorrect animations when using ODE (bugs #1320 / #1321)
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 8ad3de6..f7c9b8d 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1178,13 +1178,21 @@ namespace OpenSim.Region.Environment.Scenes
1178 else if (PhysicsActor != null && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0 && 1178 else if (PhysicsActor != null && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0 &&
1179 PhysicsActor.IsColliding) 1179 PhysicsActor.IsColliding)
1180 { 1180 {
1181 return "CROUCHWALK"; 1181 if ((m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 ||
1182 (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) != 0)
1183 {
1184 return "CROUCHWALK";
1185 }
1186 else
1187 {
1188 return "CROUCH";
1189 }
1182 } 1190 }
1183 else if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6) 1191 else if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6)
1184 { 1192 {
1185 return "FALLDOWN"; 1193 return "FALLDOWN";
1186 } 1194 }
1187 else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 0 && 1195 else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 1e-6 &&
1188 (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) 1196 (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0)
1189 { 1197 {
1190 return "JUMP"; 1198 return "JUMP";
@@ -1200,17 +1208,16 @@ namespace OpenSim.Region.Environment.Scenes
1200 } 1208 }
1201 else 1209 else
1202 { 1210 {
1203 // Not moving 1211 // We are not moving
1204 if (PhysicsActor != null && PhysicsActor.IsColliding) 1212 if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6 && !PhysicsActor.Flying)
1205 {
1206 return "CROUCH";
1207 }
1208 else if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6 && !PhysicsActor.Flying)
1209 { 1213 {
1210 return "FALLDOWN"; 1214 return "FALLDOWN";
1211 } 1215 }
1212 else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 0 && !PhysicsActor.Flying) 1216 else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 6 && !PhysicsActor.Flying)
1213 { 1217 {
1218 // HACK: We check if Velocity.Z > 6 for this animation in order to avoid false positives during normal movement.
1219 // TODO: set this animation only when on the ground and UP_POS is received?
1220
1214 // This is the standing jump 1221 // This is the standing jump
1215 return "JUMP"; 1222 return "JUMP";
1216 } 1223 }