aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-11-26 01:40:55 +0000
committerJustin Clark-Casey (justincc)2013-11-26 01:40:55 +0000
commita3c72dafe6459f20297a937bb4bca3dc00a24c9f (patch)
treeb922884a8cf1e236c6418ca84e16f2a60f21c5ba /OpenSim/Region
parentfix position changes when sitting on a prim with position and/or orientation ... (diff)
downloadopensim-SC_OLD-a3c72dafe6459f20297a937bb4bca3dc00a24c9f.zip
opensim-SC_OLD-a3c72dafe6459f20297a937bb4bca3dc00a24c9f.tar.gz
opensim-SC_OLD-a3c72dafe6459f20297a937bb4bca3dc00a24c9f.tar.bz2
opensim-SC_OLD-a3c72dafe6459f20297a937bb4bca3dc00a24c9f.tar.xz
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.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs28
1 files changed, 15 insertions, 13 deletions
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
2277 offset = part.SitTargetPosition; 2277 offset = part.SitTargetPosition;
2278 sitOrientation = part.SitTargetOrientation; 2278 sitOrientation = part.SitTargetOrientation;
2279 2279
2280// m_log.DebugFormat("Old sit orient {0}", sitOrientation); 2280 if (!part.IsRoot)
2281 if (part.IsRoot) 2281 {
2282 sitOrientation = sitOrientation; 2282 // m_log.DebugFormat("Old sit orient {0}", sitOrientation);
2283 else
2284 sitOrientation = part.RotationOffset * sitOrientation; 2283 sitOrientation = part.RotationOffset * sitOrientation;
2285// m_log.DebugFormat("New sit orient {0}", sitOrientation); 2284 // m_log.DebugFormat("New sit orient {0}", sitOrientation);
2286
2287// m_log.DebugFormat("Old sit offset {0}", offset); 2285// m_log.DebugFormat("Old sit offset {0}", offset);
2288 offset = offset * sitOrientation; 2286 offset = offset * part.RotationOffset;
2289// m_log.DebugFormat("New sit offset {0}", offset); 2287// m_log.DebugFormat("New sit offset {0}", offset);
2288 }
2290 2289
2291 canSit = true; 2290 canSit = true;
2292 } 2291 }
@@ -2604,19 +2603,22 @@ namespace OpenSim.Region.Framework.Scenes
2604 //Quaternion result = (sitTargetOrient * vq) * nq; 2603 //Quaternion result = (sitTargetOrient * vq) * nq;
2605 2604
2606 Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT; 2605 Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT;
2606 Quaternion newRot;
2607 2607
2608 if (part.IsRoot) 2608 if (part.IsRoot)
2609 Rotation = sitTargetOrient; 2609 {
2610 newRot = sitTargetOrient;
2611 }
2610 else 2612 else
2611 Rotation = part.RotationOffset * sitTargetOrient; 2613 {
2612 2614 newPos = newPos * part.RotationOffset;
2613// m_log.DebugFormat("Old offset2 {0}", newPos); 2615 newRot = part.RotationOffset * sitTargetOrient;
2614 newPos = newPos * Rotation; 2616 }
2615// m_log.DebugFormat("New offset2 {0}", newPos);
2616 2617
2617 newPos += part.OffsetPosition; 2618 newPos += part.OffsetPosition;
2618 2619
2619 m_pos = newPos; 2620 m_pos = newPos;
2621 Rotation = newRot;
2620 ParentPosition = part.AbsolutePosition; 2622 ParentPosition = part.AbsolutePosition;
2621 } 2623 }
2622 else 2624 else