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/Region/Framework/Scenes/UndoState.cs | |
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/Region/Framework/Scenes/UndoState.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UndoState.cs | 35 |
1 files changed, 19 insertions, 16 deletions
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 | { |