From 300d357573a272ef0042ebbe0912ab88de958f65 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Oct 2011 17:55:20 +0200 Subject: Fix physics proxy position when linking and rotating the root prim only --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6c47645..58f2586 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2397,6 +2397,7 @@ namespace OpenSim.Region.Framework.Scenes Quaternion oldRootRotation = linkPart.RotationOffset; linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; + linkPart.ParentID = m_rootPart.LocalId; linkPart.GroupPosition = AbsolutePosition; Vector3 axPos = linkPart.OffsetPosition; @@ -3431,14 +3432,17 @@ namespace OpenSim.Region.Framework.Scenes if (prim.UUID != m_rootPart.UUID) { prim.IgnoreUndoUpdate = true; + + Quaternion NewRot = oldParentRot * prim.RotationOffset; + NewRot = Quaternion.Inverse(axRot) * NewRot; + prim.RotationOffset = NewRot; + Vector3 axPos = prim.OffsetPosition; axPos *= oldParentRot; axPos *= Quaternion.Inverse(axRot); prim.OffsetPosition = axPos; - prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset); - prim.IgnoreUndoUpdate = false; } } -- cgit v1.1