diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f4d6c3f97..f96fb858ec 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -781,6 +781,34 @@ namespace OpenSim.Region.Framework.Scenes } } + // requested Velocity for physics engines avatar motors + // only makes sense if there is a physical rep + public Vector3 TargetVelocity + { + get + { + if (PhysicsActor != null) + return PhysicsActor.TargetVelocity; + else + return Vector3.Zero; + } + + set + { + if (PhysicsActor != null) + { + try + { + PhysicsActor.TargetVelocity = value; + } + catch (Exception e) + { + m_log.Error("[SCENE PRESENCE]: TARGETVELOCITY " + e.Message); + } + } + } + } + private Quaternion m_bodyRot = Quaternion.Identity; /// @@ -3649,7 +3677,7 @@ namespace OpenSim.Region.Framework.Scenes m_forceToApplyValid = true; } */ - Velocity = direc; + TargetVelocity = direc; Animator.UpdateMovementAnimations(); }