diff options
author | UbitUmarov | 2016-11-07 16:03:23 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-07 16:03:23 +0000 |
commit | 07893ec3e7e2bfe2066eb0477574543b4efa6930 (patch) | |
tree | 2aaa553c0a5945199795603a7dc8d1471348fbf0 | |
parent | start removing old hack of using SetMomentum to just set instant velocity, no... (diff) | |
download | opensim-SC_OLD-07893ec3e7e2bfe2066eb0477574543b4efa6930.zip opensim-SC_OLD-07893ec3e7e2bfe2066eb0477574543b4efa6930.tar.gz opensim-SC_OLD-07893ec3e7e2bfe2066eb0477574543b4efa6930.tar.bz2 opensim-SC_OLD-07893ec3e7e2bfe2066eb0477574543b4efa6930.tar.xz |
a few more changes on the avatars Velocity/TargetVelocity/SetMomentum. Need talk with Robert before last changes bc of bullet
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f4d6c3..f96fb85 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -781,6 +781,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
781 | } | 781 | } |
782 | } | 782 | } |
783 | 783 | ||
784 | // requested Velocity for physics engines avatar motors | ||
785 | // only makes sense if there is a physical rep | ||
786 | public Vector3 TargetVelocity | ||
787 | { | ||
788 | get | ||
789 | { | ||
790 | if (PhysicsActor != null) | ||
791 | return PhysicsActor.TargetVelocity; | ||
792 | else | ||
793 | return Vector3.Zero; | ||
794 | } | ||
795 | |||
796 | set | ||
797 | { | ||
798 | if (PhysicsActor != null) | ||
799 | { | ||
800 | try | ||
801 | { | ||
802 | PhysicsActor.TargetVelocity = value; | ||
803 | } | ||
804 | catch (Exception e) | ||
805 | { | ||
806 | m_log.Error("[SCENE PRESENCE]: TARGETVELOCITY " + e.Message); | ||
807 | } | ||
808 | } | ||
809 | } | ||
810 | } | ||
811 | |||
784 | private Quaternion m_bodyRot = Quaternion.Identity; | 812 | private Quaternion m_bodyRot = Quaternion.Identity; |
785 | 813 | ||
786 | /// <summary> | 814 | /// <summary> |
@@ -3649,7 +3677,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3649 | m_forceToApplyValid = true; | 3677 | m_forceToApplyValid = true; |
3650 | } | 3678 | } |
3651 | */ | 3679 | */ |
3652 | Velocity = direc; | 3680 | TargetVelocity = direc; |
3653 | Animator.UpdateMovementAnimations(); | 3681 | Animator.UpdateMovementAnimations(); |
3654 | } | 3682 | } |
3655 | 3683 | ||