diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0a18d8a..9e3d875 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3810,20 +3810,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
3810 | /// <summary> | 3810 | /// <summary> |
3811 | /// Update just the root prim position in a linkset | 3811 | /// Update just the root prim position in a linkset |
3812 | /// </summary> | 3812 | /// </summary> |
3813 | /// <param name="pos"></param> | 3813 | /// <param name="newPos"></param> |
3814 | public void UpdateRootPosition(Vector3 pos) | 3814 | public void UpdateRootPosition(Vector3 newPos) |
3815 | { | 3815 | { |
3816 | // needs to be called with phys building true | 3816 | // needs to be called with phys building true |
3817 | Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); | 3817 | Vector3 oldPos; |
3818 | Vector3 oldPos = | 3818 | |
3819 | new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, | 3819 | // FIXME: This improves the situation where editing just the root prim of an attached object would send |
3820 | AbsolutePosition.Y + m_rootPart.OffsetPosition.Y, | 3820 | // all the other parts to oblivion after detach/reattach. However, a problem remains since the root prim |
3821 | AbsolutePosition.Z + m_rootPart.OffsetPosition.Z); | 3821 | // still ends up in the wrong position on reattach. |
3822 | if (IsAttachment) | ||
3823 | oldPos = RootPart.OffsetPosition; | ||
3824 | else | ||
3825 | oldPos = AbsolutePosition + RootPart.OffsetPosition; | ||
3826 | |||
3822 | Vector3 diff = oldPos - newPos; | 3827 | Vector3 diff = oldPos - newPos; |
3823 | Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); | ||
3824 | Quaternion partRotation = m_rootPart.RotationOffset; | 3828 | Quaternion partRotation = m_rootPart.RotationOffset; |
3825 | axDiff *= Quaternion.Inverse(partRotation); | 3829 | diff *= Quaternion.Inverse(partRotation); |
3826 | diff = axDiff; | ||
3827 | 3830 | ||
3828 | SceneObjectPart[] parts = m_parts.GetArray(); | 3831 | SceneObjectPart[] parts = m_parts.GetArray(); |
3829 | for (int i = 0; i < parts.Length; i++) | 3832 | for (int i = 0; i < parts.Length; i++) |