aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-19 05:05:50 +0100
committerJustin Clark-Casey (justincc)2011-07-19 05:05:50 +0100
commit1fdb16f1cdf6e2722a763cdc0e9b7af9fed27a29 (patch)
tree4bfe52463c4337bb2dca29a2b8611397793699f0
parentFix undo of rotation of single prims in a linkset (diff)
downloadopensim-SC_OLD-1fdb16f1cdf6e2722a763cdc0e9b7af9fed27a29.zip
opensim-SC_OLD-1fdb16f1cdf6e2722a763cdc0e9b7af9fed27a29.tar.gz
opensim-SC_OLD-1fdb16f1cdf6e2722a763cdc0e9b7af9fed27a29.tar.bz2
opensim-SC_OLD-1fdb16f1cdf6e2722a763cdc0e9b7af9fed27a29.tar.xz
Fix undo for rotation of the root prim in a linkset on its own.
The only obviously broken things right now are the undo of the position of just a root prim (stays in place) and the fact that resizes need two undoes.
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs6
2 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9076d73..d653e66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3013,11 +3013,11 @@ namespace OpenSim.Region.Framework.Scenes
3013 /// 3013 ///
3014 /// </summary> 3014 /// </summary>
3015 /// <param name="rot"></param> 3015 /// <param name="rot"></param>
3016 private void UpdateRootRotation(Quaternion rot) 3016 public void UpdateRootRotation(Quaternion rot)
3017 { 3017 {
3018// m_log.DebugFormat( 3018 m_log.DebugFormat(
3019// "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}", 3019 "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
3020// Name, LocalId, rot); 3020 Name, LocalId, rot);
3021 3021
3022 Quaternion axRot = rot; 3022 Quaternion axRot = rot;
3023 Quaternion oldParentRot = m_rootPart.RotationOffset; 3023 Quaternion oldParentRot = m_rootPart.RotationOffset;
@@ -3046,6 +3046,7 @@ namespace OpenSim.Region.Framework.Scenes
3046 newRot *= Quaternion.Inverse(axRot); 3046 newRot *= Quaternion.Inverse(axRot);
3047 prim.RotationOffset = newRot; 3047 prim.RotationOffset = newRot;
3048 prim.ScheduleTerseUpdate(); 3048 prim.ScheduleTerseUpdate();
3049 prim.IgnoreUndoUpdate = false;
3049 } 3050 }
3050 } 3051 }
3051 3052
@@ -3054,12 +3055,16 @@ namespace OpenSim.Region.Framework.Scenes
3054 SceneObjectPart childpart = parts[i]; 3055 SceneObjectPart childpart = parts[i];
3055 if (childpart != m_rootPart) 3056 if (childpart != m_rootPart)
3056 { 3057 {
3057 childpart.IgnoreUndoUpdate = false; 3058// childpart.IgnoreUndoUpdate = false;
3058 childpart.StoreUndoState(); 3059// childpart.StoreUndoState();
3059 } 3060 }
3060 } 3061 }
3061 3062
3062 m_rootPart.ScheduleTerseUpdate(); 3063 m_rootPart.ScheduleTerseUpdate();
3064
3065 m_log.DebugFormat(
3066 "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
3067 Name, LocalId, rot);
3063 } 3068 }
3064 3069
3065 #endregion 3070 #endregion
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index 68d4cb4..dc509d9 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -150,8 +150,10 @@ namespace OpenSim.Region.Framework.Scenes
150 "[UNDO STATE]: Undoing rotation {0} to {1} for root part {2} {3}", 150 "[UNDO STATE]: Undoing rotation {0} to {1} for root part {2} {3}",
151 part.RotationOffset, Rotation, part.Name, part.LocalId); 151 part.RotationOffset, Rotation, part.Name, part.LocalId);
152 152
153 part.UpdateRotation(Rotation); 153 if (ForGroup)
154 //part.RotationOffset = Rotation; 154 part.UpdateRotation(Rotation);
155 else
156 part.ParentGroup.UpdateRootRotation(Rotation);
155 157
156 if (Scale != Vector3.Zero) 158 if (Scale != Vector3.Zero)
157 { 159 {