a few more changes on the avatars Velocity/TargetVelocity/SetMomentum. Need talk with Robert before last changes bc of bullet

melanie
UbitUmarov 2016-11-07 16:03:23 +00:00
parent d0ae8bb86a
commit 07893ec3e7
1 changed files with 29 additions and 1 deletions

View File

@ -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; private Quaternion m_bodyRot = Quaternion.Identity;
/// <summary> /// <summary>
@ -3649,7 +3677,7 @@ namespace OpenSim.Region.Framework.Scenes
m_forceToApplyValid = true; m_forceToApplyValid = true;
} }
*/ */
Velocity = direc; TargetVelocity = direc;
Animator.UpdateMovementAnimations(); Animator.UpdateMovementAnimations();
} }