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, 21 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index edb8ca8..cf98ef2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2866,16 +2866,33 @@ namespace OpenSim.Region.Framework.Scenes
2866 Vector3 up = new Vector3((float)x, (float)y, (float)z); 2866 Vector3 up = new Vector3((float)x, (float)y, (float)z);
2867 Vector3 sitOffset = up * Appearance.AvatarHeight * 0.02638f; 2867 Vector3 sitOffset = up * Appearance.AvatarHeight * 0.02638f;
2868 2868
2869 m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT; 2869 Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
2870 Quaternion newRot;
2871
2872 if (part.IsRoot)
2873 {
2874 newRot = sitTargetOrient;
2875 }
2876 else
2877 {
2878 newPos = newPos * part.RotationOffset;
2879 newRot = part.RotationOffset * sitTargetOrient;
2880 }
2881
2882 newPos += part.OffsetPosition;
2883
2884 m_pos = newPos;
2885 Rotation = newRot;
2870 2886
2871// m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset;
2872 Rotation = sitTargetOrient;
2873// ParentPosition = part.AbsolutePosition; 2887// ParentPosition = part.AbsolutePosition;
2874 part.ParentGroup.AddAvatar(UUID); 2888 part.ParentGroup.AddAvatar(UUID);
2875 } 2889 }
2876 else 2890 else
2877 { 2891 {
2878 m_pos -= part.AbsolutePosition; 2892 // An viewer expects to specify sit positions as offsets to the root prim, even if a child prim is
2893 // being sat upon.
2894 m_pos -= part.GroupPosition;
2895
2879// ParentPosition = part.AbsolutePosition; 2896// ParentPosition = part.AbsolutePosition;
2880 part.ParentGroup.AddAvatar(UUID); 2897 part.ParentGroup.AddAvatar(UUID);
2881 2898