aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs25
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index edb8ca8..0282ad0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2868,14 +2868,33 @@ namespace OpenSim.Region.Framework.Scenes
2868 2868
2869 m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT; 2869 m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
2870 2870
2871// m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; 2871 Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
2872 Rotation = sitTargetOrient; 2872 Quaternion newRot;
2873
2874 if (part.IsRoot)
2875 {
2876 newRot = sitTargetOrient;
2877 }
2878 else
2879 {
2880 newPos = newPos * part.RotationOffset;
2881 newRot = part.RotationOffset * sitTargetOrient;
2882 }
2883
2884 newPos += part.OffsetPosition;
2885
2886 m_pos = newPos;
2887 Rotation = newRot;
2888
2873// ParentPosition = part.AbsolutePosition; 2889// ParentPosition = part.AbsolutePosition;
2874 part.ParentGroup.AddAvatar(UUID); 2890 part.ParentGroup.AddAvatar(UUID);
2875 } 2891 }
2876 else 2892 else
2877 { 2893 {
2878 m_pos -= part.AbsolutePosition; 2894 // An viewer expects to specify sit positions as offsets to the root prim, even if a child prim is
2895 // being sat upon.
2896 m_pos -= part.GroupPosition;
2897
2879// ParentPosition = part.AbsolutePosition; 2898// ParentPosition = part.AbsolutePosition;
2880 part.ParentGroup.AddAvatar(UUID); 2899 part.ParentGroup.AddAvatar(UUID);
2881 2900