diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cda438f..3e3b3af 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -590,12 +590,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
590 | */ | 590 | */ |
591 | private Quaternion m_bodyRot = Quaternion.Identity; | 591 | private Quaternion m_bodyRot = Quaternion.Identity; |
592 | 592 | ||
593 | /// <summary> | ||
594 | /// The rotation of the avatar. | ||
595 | /// </summary> | ||
596 | /// <remarks> | ||
597 | /// If the avatar is not sitting, this is with respect to the world | ||
598 | /// If the avatar is sitting, this is a with respect to the part that it's sitting upon (a local rotation). | ||
599 | /// If you always want the world rotation, use GetWorldRotation() | ||
600 | /// </remarks> | ||
593 | public Quaternion Rotation | 601 | public Quaternion Rotation |
594 | { | 602 | { |
595 | get { return m_bodyRot; } | 603 | get |
604 | { | ||
605 | return m_bodyRot; | ||
606 | } | ||
607 | |||
596 | set | 608 | set |
597 | { | 609 | { |
598 | m_bodyRot = value; | 610 | m_bodyRot = value; |
611 | |||
599 | if (PhysicsActor != null) | 612 | if (PhysicsActor != null) |
600 | { | 613 | { |
601 | try | 614 | try |
@@ -654,6 +667,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
654 | set { m_health = value; } | 667 | set { m_health = value; } |
655 | } | 668 | } |
656 | 669 | ||
670 | /// <summary> | ||
671 | /// Gets the world rotation of this presence. | ||
672 | /// </summary> | ||
673 | /// <remarks> | ||
674 | /// Unlike Rotation, this returns the world rotation no matter whether the avatar is sitting on a prim or not. | ||
675 | /// </remarks> | ||
676 | /// <returns></returns> | ||
677 | public Quaternion GetWorldRotation() | ||
678 | { | ||
679 | if (IsSatOnObject) | ||
680 | { | ||
681 | SceneObjectPart sitPart = ParentPart; | ||
682 | |||
683 | if (sitPart != null) | ||
684 | return sitPart.GetWorldRotation() * Rotation; | ||
685 | } | ||
686 | |||
687 | return Rotation; | ||
688 | } | ||
689 | |||
657 | public void AdjustKnownSeeds() | 690 | public void AdjustKnownSeeds() |
658 | { | 691 | { |
659 | Dictionary<ulong, string> seeds; | 692 | Dictionary<ulong, string> seeds; |
@@ -755,8 +788,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
755 | 788 | ||
756 | #endregion | 789 | #endregion |
757 | 790 | ||
758 | |||
759 | |||
760 | #region Constructor(s) | 791 | #region Constructor(s) |
761 | 792 | ||
762 | public ScenePresence( | 793 | public ScenePresence( |