diff options
author | Tom | 2011-03-27 13:09:19 -0700 |
---|---|---|
committer | Tom | 2011-03-27 13:09:19 -0700 |
commit | 553a195493db93f9718c1e48b408c1e6839bfde0 (patch) | |
tree | f5f73069bfc5f40debe296045ea77562201a7509 /OpenSim/Region/Framework/Scenes | |
parent | Add giving lists of items to another prim (diff) | |
download | opensim-SC_OLD-553a195493db93f9718c1e48b408c1e6839bfde0.zip opensim-SC_OLD-553a195493db93f9718c1e48b408c1e6839bfde0.tar.gz opensim-SC_OLD-553a195493db93f9718c1e48b408c1e6839bfde0.tar.bz2 opensim-SC_OLD-553a195493db93f9718c1e48b408c1e6839bfde0.tar.xz |
Fix issues with UpdateRootRotation and also increase efficiency
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 |
1 files changed, 8 insertions, 7 deletions
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 | |||
3393 | m_rootPart.Undoing = true; | 3393 | m_rootPart.Undoing = true; |
3394 | cancelUndo = true; | 3394 | cancelUndo = true; |
3395 | } | 3395 | } |
3396 | m_rootPart.UpdateRotation(rot); | 3396 | |
3397 | //Don't use UpdateRotation because it schedules an update prematurely | ||
3398 | m_rootPart.RotationOffset = rot; | ||
3397 | if (m_rootPart.PhysActor != null) | 3399 | if (m_rootPart.PhysActor != null) |
3398 | { | 3400 | { |
3399 | m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; | 3401 | m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; |
@@ -3408,14 +3410,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3408 | { | 3410 | { |
3409 | prim.IgnoreUndoUpdate = true; | 3411 | prim.IgnoreUndoUpdate = true; |
3410 | Vector3 axPos = prim.OffsetPosition; | 3412 | Vector3 axPos = prim.OffsetPosition; |
3413 | |||
3411 | axPos *= oldParentRot; | 3414 | axPos *= oldParentRot; |
3412 | axPos *= Quaternion.Inverse(axRot); | 3415 | axPos *= Quaternion.Inverse(axRot); |
3413 | prim.OffsetPosition = axPos; | 3416 | prim.OffsetPosition = axPos; |
3414 | Quaternion primsRot = prim.RotationOffset; | 3417 | |
3415 | Quaternion newRot = primsRot * oldParentRot; | 3418 | prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset); |
3416 | newRot *= Quaternion.Inverse(axRot); | 3419 | |
3417 | prim.RotationOffset = newRot; | ||
3418 | prim.ScheduleTerseUpdate(); | ||
3419 | prim.IgnoreUndoUpdate = false; | 3420 | prim.IgnoreUndoUpdate = false; |
3420 | } | 3421 | } |
3421 | } | 3422 | } |
@@ -3424,7 +3425,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3424 | m_rootPart.Undoing = false; | 3425 | m_rootPart.Undoing = false; |
3425 | } | 3426 | } |
3426 | 3427 | ||
3427 | m_rootPart.ScheduleTerseUpdate(); | 3428 | ScheduleGroupForTerseUpdate(); |
3428 | } | 3429 | } |
3429 | 3430 | ||
3430 | #endregion | 3431 | #endregion |