From 33d6222e8dc40331e98c3549a040d3d206eed338 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 31 Oct 2007 04:18:34 +0000 Subject: Thank you Teravus, very much, for a 'jump', 'crouch' and 'inertia' patch for all three physics plugins. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 39 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 3b73893..b9c723b 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -613,12 +613,27 @@ namespace OpenSim.Region.Environment.Scenes } else { - SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); + if (((m_movementflag & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && PhysicsActor.IsColliding) + { + SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1); + } + else + { + SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); + } + } } else { - SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); + if (((m_movementflag & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && PhysicsActor.IsColliding) + { + SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1); + } + else + { + SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); + } } } } @@ -638,7 +653,21 @@ namespace OpenSim.Region.Environment.Scenes direc = direc*((0.03f)*128f); if (m_physicsActor.Flying) - direc *= 4; + { direc *= 4; } + else + { + if (!m_physicsActor.Flying && m_physicsActor.IsColliding) + { + //direc.z *= 40; + if (direc.z > 2.0f) + { + direc.z *= 3; + //System.Console.WriteLine("Jump"); + SendAnimPack(Animations.AnimsLLUUID["PRE_JUMP"], 1); + } + + } + } newVelocity.X = direc.x; newVelocity.Y = direc.y; @@ -867,7 +896,7 @@ namespace OpenSim.Region.Environment.Scenes protected void CheckForSignificantMovement() { - if (AbsolutePosition.GetDistanceTo(posLastSignificantMove) > 2.0) + if (AbsolutePosition.GetDistanceTo(posLastSignificantMove) > 0.02) { posLastSignificantMove = AbsolutePosition; if (OnSignificantClientMovement != null) @@ -982,6 +1011,8 @@ namespace OpenSim.Region.Environment.Scenes NewForce force = m_forcesList[i]; m_updateflag = true; + + Velocity = new LLVector3(force.X, force.Y, force.Z); m_newForce = true; } -- cgit v1.1