From a3c72dafe6459f20297a937bb4bca3dc00a24c9f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Nov 2013 01:40:55 +0000 Subject: Only translate linked prim specified offset pos by the link prim rotation, not any specified avatar rotation as well. Don't translate root prim position by avatar rotation. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 42a9b4d..a73d140 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2277,16 +2277,15 @@ namespace OpenSim.Region.Framework.Scenes offset = part.SitTargetPosition; sitOrientation = part.SitTargetOrientation; -// m_log.DebugFormat("Old sit orient {0}", sitOrientation); - if (part.IsRoot) - sitOrientation = sitOrientation; - else + if (!part.IsRoot) + { + // m_log.DebugFormat("Old sit orient {0}", sitOrientation); sitOrientation = part.RotationOffset * sitOrientation; -// m_log.DebugFormat("New sit orient {0}", sitOrientation); - + // m_log.DebugFormat("New sit orient {0}", sitOrientation); // m_log.DebugFormat("Old sit offset {0}", offset); - offset = offset * sitOrientation; + offset = offset * part.RotationOffset; // m_log.DebugFormat("New sit offset {0}", offset); + } canSit = true; } @@ -2604,19 +2603,22 @@ namespace OpenSim.Region.Framework.Scenes //Quaternion result = (sitTargetOrient * vq) * nq; Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT; + Quaternion newRot; if (part.IsRoot) - Rotation = sitTargetOrient; + { + newRot = sitTargetOrient; + } else - Rotation = part.RotationOffset * sitTargetOrient; - -// m_log.DebugFormat("Old offset2 {0}", newPos); - newPos = newPos * Rotation; -// m_log.DebugFormat("New offset2 {0}", newPos); + { + newPos = newPos * part.RotationOffset; + newRot = part.RotationOffset * sitTargetOrient; + } newPos += part.OffsetPosition; m_pos = newPos; + Rotation = newRot; ParentPosition = part.AbsolutePosition; } else -- cgit v1.1