diff options
author | Justin Clark-Casey (justincc) | 2011-07-19 04:15:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-19 04:15:27 +0100 |
commit | 97f1edfd95176415d0e0b3169467655522334804 (patch) | |
tree | c4551d9d2ef141b12d61d038a4c88cda5610c6e1 /OpenSim | |
parent | Rename UpdatePrimRotation() to UpdatePrimGroupRotation() since this is what i... (diff) | |
download | opensim-SC-97f1edfd95176415d0e0b3169467655522334804.zip opensim-SC-97f1edfd95176415d0e0b3169467655522334804.tar.gz opensim-SC-97f1edfd95176415d0e0b3169467655522334804.tar.bz2 opensim-SC-97f1edfd95176415d0e0b3169467655522334804.tar.xz |
Fix undo of prim group rotation.
This isn't that great since I think I broke it a few commits earlier.
Undo of rotation of individual prims in a linkset is still broken
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UndoState.cs | 35 |
3 files changed, 34 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3adeef1..aa1f7bc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2895,9 +2895,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2895 | // m_log.DebugFormat( | 2895 | // m_log.DebugFormat( |
2896 | // "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot); | 2896 | // "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot); |
2897 | 2897 | ||
2898 | SceneObjectPart[] parts = m_parts.GetArray(); | 2898 | // SceneObjectPart[] parts = m_parts.GetArray(); |
2899 | for (int i = 0; i < parts.Length; i++) | 2899 | // for (int i = 0; i < parts.Length; i++) |
2900 | parts[i].StoreUndoState(); | 2900 | // parts[i].StoreUndoState(); |
2901 | |||
2902 | m_rootPart.StoreUndoState(true); | ||
2901 | 2903 | ||
2902 | m_rootPart.UpdateRotation(rot); | 2904 | m_rootPart.UpdateRotation(rot); |
2903 | 2905 | ||
@@ -2922,9 +2924,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2922 | // m_log.DebugFormat( | 2924 | // m_log.DebugFormat( |
2923 | // "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot); | 2925 | // "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot); |
2924 | 2926 | ||
2925 | SceneObjectPart[] parts = m_parts.GetArray(); | 2927 | // SceneObjectPart[] parts = m_parts.GetArray(); |
2926 | for (int i = 0; i < parts.Length; i++) | 2928 | // for (int i = 0; i < parts.Length; i++) |
2927 | parts[i].StoreUndoState(); | 2929 | // parts[i].StoreUndoState(); |
2930 | |||
2931 | RootPart.StoreUndoState(true); | ||
2932 | RootPart.IgnoreUndoUpdate = true; | ||
2928 | 2933 | ||
2929 | m_rootPart.UpdateRotation(rot); | 2934 | m_rootPart.UpdateRotation(rot); |
2930 | 2935 | ||
@@ -2939,6 +2944,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2939 | 2944 | ||
2940 | HasGroupChanged = true; | 2945 | HasGroupChanged = true; |
2941 | ScheduleGroupForTerseUpdate(); | 2946 | ScheduleGroupForTerseUpdate(); |
2947 | |||
2948 | RootPart.IgnoreUndoUpdate = false; | ||
2942 | } | 2949 | } |
2943 | 2950 | ||
2944 | /// <summary> | 2951 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index af836f6..c3aca15 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3706,8 +3706,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3706 | m_undo.Push(nUndo); | 3706 | m_undo.Push(nUndo); |
3707 | 3707 | ||
3708 | m_log.DebugFormat( | 3708 | m_log.DebugFormat( |
3709 | "[SCENE OBJECT PART]: Stored undo state for {0} {1}, stack size now {2}", | 3709 | "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", |
3710 | Name, LocalId, m_undo.Count); | 3710 | Name, LocalId, forGroup, m_undo.Count); |
3711 | } | 3711 | } |
3712 | } | 3712 | } |
3713 | } | 3713 | } |
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs index faa1f9e..6f6504c 100644 --- a/OpenSim/Region/Framework/Scenes/UndoState.cs +++ b/OpenSim/Region/Framework/Scenes/UndoState.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
35 | { | 35 | { |
36 | public class UndoState | 36 | public class UndoState |
37 | { | 37 | { |
38 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
39 | 39 | ||
40 | public Vector3 Position = Vector3.Zero; | 40 | public Vector3 Position = Vector3.Zero; |
41 | public Vector3 Scale = Vector3.Zero; | 41 | public Vector3 Scale = Vector3.Zero; |
@@ -57,23 +57,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
57 | { | 57 | { |
58 | if (part.ParentID == 0) | 58 | if (part.ParentID == 0) |
59 | { | 59 | { |
60 | // m_log.DebugFormat( | 60 | ForGroup = forGroup; |
61 | // "[UNDO STATE]: Storing undo position {0} for root part", part.ParentGroup.AbsolutePosition); | ||
62 | 61 | ||
63 | if (ForGroup) | 62 | if (ForGroup) |
64 | Position = part.ParentGroup.AbsolutePosition; | 63 | Position = part.ParentGroup.AbsolutePosition; |
65 | else | 64 | else |
66 | Position = part.OffsetPosition; | 65 | Position = part.OffsetPosition; |
67 | 66 | ||
68 | // m_log.DebugFormat( | 67 | m_log.DebugFormat( |
69 | // "[UNDO STATE]: Storing undo rotation {0} for root part", part.RotationOffset); | 68 | "[UNDO STATE]: Storing undo position {0} for root part", Position); |
69 | |||
70 | Rotation = part.RotationOffset; | 70 | Rotation = part.RotationOffset; |
71 | 71 | ||
72 | // m_log.DebugFormat( | 72 | m_log.DebugFormat( |
73 | // "[UNDO STATE]: Storing undo scale {0} for root part", part.Shape.Scale); | 73 | "[UNDO STATE]: Storing undo rotation {0} for root part", Rotation); |
74 | |||
74 | Scale = part.Shape.Scale; | 75 | Scale = part.Shape.Scale; |
75 | 76 | ||
76 | ForGroup = forGroup; | 77 | m_log.DebugFormat( |
78 | "[UNDO STATE]: Storing undo scale {0} for root part", Scale); | ||
77 | } | 79 | } |
78 | else | 80 | else |
79 | { | 81 | { |
@@ -132,23 +134,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
132 | 134 | ||
133 | if (part.ParentID == 0) | 135 | if (part.ParentID == 0) |
134 | { | 136 | { |
137 | m_log.DebugFormat( | ||
138 | "[UNDO STATE]: Undoing position to {0} for root part {1} {2}", | ||
139 | Position, part.Name, part.LocalId); | ||
140 | |||
135 | if (Position != Vector3.Zero) | 141 | if (Position != Vector3.Zero) |
136 | { | 142 | { |
137 | // m_log.DebugFormat( | ||
138 | // "[UNDO STATE]: Undoing position {0} to {1} for root part {2} {3}", | ||
139 | // part.ParentGroup.AbsolutePosition, Position, part.Name, part.LocalId); | ||
140 | |||
141 | if (ForGroup) | 143 | if (ForGroup) |
142 | part.ParentGroup.AbsolutePosition = Position; | 144 | part.ParentGroup.AbsolutePosition = Position; |
143 | else | 145 | else |
144 | part.OffsetPosition = Position; | 146 | part.OffsetPosition = Position; |
145 | } | 147 | } |
146 | 148 | ||
147 | // m_log.DebugFormat( | 149 | m_log.DebugFormat( |
148 | // "[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}", |
149 | // part.RotationOffset, Rotation, part.Name, part.LocalId); | 151 | part.RotationOffset, Rotation, part.Name, part.LocalId); |
150 | 152 | ||
151 | part.RotationOffset = Rotation; | 153 | part.UpdateRotation(Rotation); |
154 | //part.RotationOffset = Rotation; | ||
152 | 155 | ||
153 | if (Scale != Vector3.Zero) | 156 | if (Scale != Vector3.Zero) |
154 | { | 157 | { |