diff options
author | Justin Clark-Casey (justincc) | 2011-07-19 03:01:54 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-19 03:01:54 +0100 |
commit | 430a4aeba8e98b8285ea3ebdf264baf429a55e22 (patch) | |
tree | 68ca3695b7422f0d73aaa45555a77f2babae51d7 /OpenSim/Region/Framework/Scenes/UndoState.cs | |
parent | remove undo state storage in a few places where it's pointless (diff) | |
download | opensim-SC_OLD-430a4aeba8e98b8285ea3ebdf264baf429a55e22.zip opensim-SC_OLD-430a4aeba8e98b8285ea3ebdf264baf429a55e22.tar.gz opensim-SC_OLD-430a4aeba8e98b8285ea3ebdf264baf429a55e22.tar.bz2 opensim-SC_OLD-430a4aeba8e98b8285ea3ebdf264baf429a55e22.tar.xz |
Fix undo for resizing linksets
This involves implementing a boolean in UndoState to signal whether the undo needs to be done for an entire group/linkset or just a single prim
Resizing individual components of linksets is still dodgy.
Resizing still has to be down twice, since for some reason the client is sending two multiobjectupdate packets on every resize except the very first. This applies to single prims and linksets. Need to look into this.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UndoState.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs index 38bbeb0..1fa8ee2 100644 --- a/OpenSim/Region/Framework/Scenes/UndoState.cs +++ b/OpenSim/Region/Framework/Scenes/UndoState.cs | |||
@@ -42,10 +42,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
42 | public Quaternion Rotation = Quaternion.Identity; | 42 | public Quaternion Rotation = Quaternion.Identity; |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Is this undo state for an entire group? | ||
46 | /// </summary> | ||
47 | public bool ForGroup; | ||
48 | |||
49 | /// <summary> | ||
45 | /// Constructor. | 50 | /// Constructor. |
46 | /// </summary> | 51 | /// </summary> |
47 | /// <param name="part"></param> | 52 | /// <param name="part"></param> |
48 | public UndoState(SceneObjectPart part) | 53 | /// <param name="forGroup">True if the undo is for an entire group</param> |
54 | public UndoState(SceneObjectPart part, bool forGroup) | ||
49 | { | 55 | { |
50 | if (part != null) | 56 | if (part != null) |
51 | { | 57 | { |
@@ -62,6 +68,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
62 | // m_log.DebugFormat( | 68 | // m_log.DebugFormat( |
63 | // "[UNDO STATE]: Storing undo scale {0} for root part", part.Shape.Scale); | 69 | // "[UNDO STATE]: Storing undo scale {0} for root part", part.Shape.Scale); |
64 | Scale = part.Shape.Scale; | 70 | Scale = part.Shape.Scale; |
71 | |||
72 | ForGroup = forGroup; | ||
65 | } | 73 | } |
66 | else | 74 | else |
67 | { | 75 | { |
@@ -141,7 +149,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
141 | // "[UNDO STATE]: Undoing scale {0} to {1} for root part {2} {3}", | 149 | // "[UNDO STATE]: Undoing scale {0} to {1} for root part {2} {3}", |
142 | // part.Shape.Scale, Scale, part.Name, part.LocalId); | 150 | // part.Shape.Scale, Scale, part.Name, part.LocalId); |
143 | 151 | ||
144 | part.Resize(Scale); | 152 | if (ForGroup) |
153 | part.ParentGroup.GroupResize(Scale); | ||
154 | else | ||
155 | part.Resize(Scale); | ||
145 | } | 156 | } |
146 | 157 | ||
147 | part.ParentGroup.ScheduleGroupForTerseUpdate(); | 158 | part.ParentGroup.ScheduleGroupForTerseUpdate(); |
@@ -194,7 +205,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
194 | part.UpdateRotation(Rotation); | 205 | part.UpdateRotation(Rotation); |
195 | 206 | ||
196 | if (Scale != Vector3.Zero) | 207 | if (Scale != Vector3.Zero) |
197 | part.Resize(Scale); | 208 | { |
209 | if (ForGroup) | ||
210 | part.ParentGroup.GroupResize(Scale); | ||
211 | else | ||
212 | part.Resize(Scale); | ||
213 | } | ||
198 | 214 | ||
199 | part.ParentGroup.ScheduleGroupForTerseUpdate(); | 215 | part.ParentGroup.ScheduleGroupForTerseUpdate(); |
200 | } | 216 | } |
@@ -241,4 +257,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
241 | m_terrainModule.UndoTerrain(m_terrainChannel); | 257 | m_terrainModule.UndoTerrain(m_terrainChannel); |
242 | } | 258 | } |
243 | } | 259 | } |
244 | } | 260 | } \ No newline at end of file |