aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-06-25 00:41:46 +0100
committerJustin Clark-Casey (justincc)2013-06-25 00:41:46 +0100
commitce9b1320d273890610a2ccd4f1ada39498135049 (patch)
treeca809c8026d931ce92fb0d50774353e93d1a859b /OpenSim/Region/Framework/Scenes
parentTidy up SOG.UpdateRootPosition() to eliminate unnecessary copying of Vector3 ... (diff)
downloadopensim-SC-ce9b1320d273890610a2ccd4f1ada39498135049.zip
opensim-SC-ce9b1320d273890610a2ccd4f1ada39498135049.tar.gz
opensim-SC-ce9b1320d273890610a2ccd4f1ada39498135049.tar.bz2
opensim-SC-ce9b1320d273890610a2ccd4f1ada39498135049.tar.xz
Improve situation where editing just the root prim of an attachment causes other prims to be set to very far off positions on reattach.
Functionally the same as the patch by tglion in http://opensimulator.org/mantis/view.php?id=5334 However, not yet perfect - after editing just root prim on reattach the position is still wrong, though other prims are not set to far off positions.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 75d0667..4b4e4ba 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3038,7 +3038,16 @@ namespace OpenSim.Region.Framework.Scenes
3038// for (int i = 0; i < parts.Length; i++) 3038// for (int i = 0; i < parts.Length; i++)
3039// parts[i].StoreUndoState(); 3039// parts[i].StoreUndoState();
3040 3040
3041 Vector3 oldPos = AbsolutePosition + RootPart.OffsetPosition; 3041 Vector3 oldPos;
3042
3043 // FIXME: This improves the situation where editing just the root prim of an attached object would send
3044 // all the other parts to oblivion after detach/reattach. However, a problem remains since the root prim
3045 // still ends up in the wrong position on reattach.
3046 if (IsAttachment)
3047 oldPos = RootPart.OffsetPosition;
3048 else
3049 oldPos = AbsolutePosition + RootPart.OffsetPosition;
3050
3042 Vector3 diff = oldPos - newPos; 3051 Vector3 diff = oldPos - newPos;
3043 Quaternion partRotation = m_rootPart.RotationOffset; 3052 Quaternion partRotation = m_rootPart.RotationOffset;
3044 diff *= Quaternion.Inverse(partRotation); 3053 diff *= Quaternion.Inverse(partRotation);