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