From 6df75a927cfa36d0f3876653033a9d12e3e78dfd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 30 Sep 2015 20:37:14 +0100 Subject: [PATCH] let hoverheight rest position be a falling state --- .../Scenes/Animation/ScenePresenceAnimator.cs | 11 ++++++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index e80a33bcbf..13d45620b8 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -399,6 +399,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation { float fallVelocity = actor.Velocity.Z; + // if stable on Hover assume falling + if(actor.PIDHoverActive && fallVelocity < 0.05f) + { + Falling = true; + currentControlState = motionControlStates.falling; + m_lastFallVelocity = fallVelocity; + return "FALLDOWN"; + } + if (fallVelocity < -2.5f) Falling = true; @@ -431,7 +440,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation #region Jumping // section added for jumping... - if (isColliding && heldUp && currentControlState != motionControlStates.jumping) + if (isColliding && heldUp && currentControlState != motionControlStates.jumping && !actor.PIDHoverActive) { // Start jumping, prejump currentControlState = motionControlStates.jumping; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4252bd6798..9996f6e54c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3363,7 +3363,8 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE PRESENCE]: Force to apply before modification was {0} for {1}", direc, Name); - if (Animator.currentControlState == ScenePresenceAnimator.motionControlStates.falling) + if (Animator.currentControlState == ScenePresenceAnimator.motionControlStates.falling + && (PhysicsActor == null || !PhysicsActor.PIDHoverActive)) { if (breaking) direc.Z = -9999f; //hack to tell physics to stop on Z