Attempt to fix incorrect animations when using ODE (bugs #1320 / #1321)

0.6.0-stable
Jeff Ames 2008-05-19 14:49:20 +00:00
parent a4d84a6aed
commit 7b0ca6ea30
1 changed files with 16 additions and 9 deletions

View File

@ -1177,14 +1177,22 @@ namespace OpenSim.Region.Environment.Scenes
} }
else if (PhysicsActor != null && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0 && else if (PhysicsActor != null && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0 &&
PhysicsActor.IsColliding) PhysicsActor.IsColliding)
{
if ((m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 ||
(m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) != 0)
{ {
return "CROUCHWALK"; return "CROUCHWALK";
} }
else
{
return "CROUCH";
}
}
else if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6) else if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6)
{ {
return "FALLDOWN"; return "FALLDOWN";
} }
else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 0 && else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 1e-6 &&
(m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0)
{ {
return "JUMP"; return "JUMP";
@ -1200,17 +1208,16 @@ namespace OpenSim.Region.Environment.Scenes
} }
else else
{ {
// Not moving // We are not moving
if (PhysicsActor != null && PhysicsActor.IsColliding) if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6 && !PhysicsActor.Flying)
{
return "CROUCH";
}
else if (PhysicsActor != null && !PhysicsActor.IsColliding && PhysicsActor.Velocity.Z < -6 && !PhysicsActor.Flying)
{ {
return "FALLDOWN"; return "FALLDOWN";
} }
else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 0 && !PhysicsActor.Flying) else if (PhysicsActor != null && !PhysicsActor.IsColliding && Velocity.Z > 6 && !PhysicsActor.Flying)
{ {
// HACK: We check if Velocity.Z > 6 for this animation in order to avoid false positives during normal movement.
// TODO: set this animation only when on the ground and UP_POS is received?
// This is the standing jump // This is the standing jump
return "JUMP"; return "JUMP";
} }