let hoverheight rest position be a falling state

avinationmerge
UbitUmarov 2015-09-30 20:37:14 +01:00
parent aa3303e3af
commit 6df75a927c
2 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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