From 553a195493db93f9718c1e48b408c1e6839bfde0 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 27 Mar 2011 13:09:19 -0700 Subject: Fix issues with UpdateRootRotation and also increase efficiency --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 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 4cbf3e1..92a275e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3393,7 +3393,9 @@ namespace OpenSim.Region.Framework.Scenes m_rootPart.Undoing = true; cancelUndo = true; } - m_rootPart.UpdateRotation(rot); + + //Don't use UpdateRotation because it schedules an update prematurely + m_rootPart.RotationOffset = rot; if (m_rootPart.PhysActor != null) { m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; @@ -3408,14 +3410,13 @@ namespace OpenSim.Region.Framework.Scenes { prim.IgnoreUndoUpdate = true; Vector3 axPos = prim.OffsetPosition; + axPos *= oldParentRot; axPos *= Quaternion.Inverse(axRot); prim.OffsetPosition = axPos; - Quaternion primsRot = prim.RotationOffset; - Quaternion newRot = primsRot * oldParentRot; - newRot *= Quaternion.Inverse(axRot); - prim.RotationOffset = newRot; - prim.ScheduleTerseUpdate(); + + prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset); + prim.IgnoreUndoUpdate = false; } } @@ -3424,7 +3425,7 @@ namespace OpenSim.Region.Framework.Scenes m_rootPart.Undoing = false; } - m_rootPart.ScheduleTerseUpdate(); + ScheduleGroupForTerseUpdate(); } #endregion -- cgit v1.1