diff options
author | Justin Clark-Casey (justincc) | 2013-11-26 00:43:35 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-11-26 00:43:35 +0000 |
commit | 36d146bf272f33eb54de80579b163f27f2703fd4 (patch) | |
tree | 85fde9deaf5f8f2a742a759d3f470e1a4d5863e9 | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-36d146bf272f33eb54de80579b163f27f2703fd4.zip opensim-SC_OLD-36d146bf272f33eb54de80579b163f27f2703fd4.tar.gz opensim-SC_OLD-36d146bf272f33eb54de80579b163f27f2703fd4.tar.bz2 opensim-SC_OLD-36d146bf272f33eb54de80579b163f27f2703fd4.tar.xz |
fix position changes when sitting on a prim with position and/or orientation explicitly specified
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7a1017f..42a9b4d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2267,7 +2267,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2267 | m_sitAvatarHeight = PhysicsActor.Size.Z; | 2267 | m_sitAvatarHeight = PhysicsActor.Size.Z; |
2268 | 2268 | ||
2269 | bool canSit = false; | 2269 | bool canSit = false; |
2270 | Vector3 pos = part.AbsolutePosition + offset; | ||
2271 | 2270 | ||
2272 | if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero) | 2271 | if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero) |
2273 | { | 2272 | { |
@@ -2277,10 +2276,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2277 | 2276 | ||
2278 | offset = part.SitTargetPosition; | 2277 | offset = part.SitTargetPosition; |
2279 | sitOrientation = part.SitTargetOrientation; | 2278 | sitOrientation = part.SitTargetOrientation; |
2279 | |||
2280 | // m_log.DebugFormat("Old sit orient {0}", sitOrientation); | ||
2281 | if (part.IsRoot) | ||
2282 | sitOrientation = sitOrientation; | ||
2283 | else | ||
2284 | sitOrientation = part.RotationOffset * sitOrientation; | ||
2285 | // m_log.DebugFormat("New sit orient {0}", sitOrientation); | ||
2286 | |||
2287 | // m_log.DebugFormat("Old sit offset {0}", offset); | ||
2288 | offset = offset * sitOrientation; | ||
2289 | // m_log.DebugFormat("New sit offset {0}", offset); | ||
2290 | |||
2280 | canSit = true; | 2291 | canSit = true; |
2281 | } | 2292 | } |
2282 | else | 2293 | else |
2283 | { | 2294 | { |
2295 | Vector3 pos = part.AbsolutePosition + offset; | ||
2296 | |||
2284 | if (Util.GetDistanceTo(AbsolutePosition, pos) <= 10) | 2297 | if (Util.GetDistanceTo(AbsolutePosition, pos) <= 10) |
2285 | { | 2298 | { |
2286 | // m_log.DebugFormat( | 2299 | // m_log.DebugFormat( |
@@ -2590,8 +2603,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
2590 | 2603 | ||
2591 | //Quaternion result = (sitTargetOrient * vq) * nq; | 2604 | //Quaternion result = (sitTargetOrient * vq) * nq; |
2592 | 2605 | ||
2593 | m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT + part.OffsetPosition; | 2606 | Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT; |
2594 | Rotation = part.RotationOffset * sitTargetOrient; | 2607 | |
2608 | if (part.IsRoot) | ||
2609 | Rotation = sitTargetOrient; | ||
2610 | else | ||
2611 | Rotation = part.RotationOffset * sitTargetOrient; | ||
2612 | |||
2613 | // m_log.DebugFormat("Old offset2 {0}", newPos); | ||
2614 | newPos = newPos * Rotation; | ||
2615 | // m_log.DebugFormat("New offset2 {0}", newPos); | ||
2616 | |||
2617 | newPos += part.OffsetPosition; | ||
2618 | |||
2619 | m_pos = newPos; | ||
2595 | ParentPosition = part.AbsolutePosition; | 2620 | ParentPosition = part.AbsolutePosition; |
2596 | } | 2621 | } |
2597 | else | 2622 | else |