aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/KeyframeMotion.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/KeyframeMotion.cs58
1 files changed, 33 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index 42e3860..e4e6f2c 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -112,20 +112,23 @@ namespace OpenSim.Region.Framework.Scenes
112 public bool Selected 112 public bool Selected
113 { 113 {
114 set 114 set
115 { 115 {
116 if (!value) 116 if (m_group != null)
117 {
118 // Once we're let go, recompute positions
119 if (m_selected)
120 UpdateSceneObject(m_group);
121 }
122 else
123 { 117 {
124 // Save selection position in case we get moved 118 if (!value)
125 if (!m_selected)
126 { 119 {
127 StopTimer(); 120 // Once we're let go, recompute positions
128 m_serializedPosition = m_group.AbsolutePosition; 121 if (m_selected)
122 UpdateSceneObject(m_group);
123 }
124 else
125 {
126 // Save selection position in case we get moved
127 if (!m_selected)
128 {
129 StopTimer();
130 m_serializedPosition = m_group.AbsolutePosition;
131 }
129 } 132 }
130 } 133 }
131 m_isCrossing = false; 134 m_isCrossing = false;
@@ -199,6 +202,9 @@ namespace OpenSim.Region.Framework.Scenes
199 m_waitingCrossing = false; 202 m_waitingCrossing = false;
200 StopTimer(); 203 StopTimer();
201 204
205 if (grp == null)
206 return;
207
202 m_group = grp; 208 m_group = grp;
203 Vector3 grppos = grp.AbsolutePosition; 209 Vector3 grppos = grp.AbsolutePosition;
204 Vector3 offset = grppos - m_serializedPosition; 210 Vector3 offset = grppos - m_serializedPosition;
@@ -228,14 +234,16 @@ namespace OpenSim.Region.Framework.Scenes
228 m_mode = mode; 234 m_mode = mode;
229 m_data = data; 235 m_data = data;
230 236
231 m_onTimerLock = new object();
232
233 m_group = grp; 237 m_group = grp;
234 if (grp != null) 238 if (grp != null)
235 { 239 {
236 m_basePosition = grp.AbsolutePosition; 240 m_basePosition = grp.AbsolutePosition;
237 m_baseRotation = grp.GroupRotation; 241 m_baseRotation = grp.GroupRotation;
238 } 242 }
243
244 m_onTimerLock = new object();
245 m_timerStopped = true;
246 m_inOnTimer = false;
239 m_isCrossing = false; 247 m_isCrossing = false;
240 m_waitingCrossing = false; 248 m_waitingCrossing = false;
241 } 249 }
@@ -249,18 +257,23 @@ namespace OpenSim.Region.Framework.Scenes
249 { 257 {
250 StopTimer(); 258 StopTimer();
251 259
252 KeyframeMotion newmotion = new KeyframeMotion(newgrp, m_mode, m_data); 260 KeyframeMotion newmotion = new KeyframeMotion(null, m_mode, m_data);
253 261
254 if (newgrp != null && newgrp.IsSelected) 262 newmotion.m_group = newgrp;
255 newmotion.m_selected = true;
256 263
257 if (m_keyframes != null) 264 if (m_keyframes != null)
265 {
266 newmotion.m_keyframes = new Keyframe[m_keyframes.Length];
258 m_keyframes.CopyTo(newmotion.m_keyframes, 0); 267 m_keyframes.CopyTo(newmotion.m_keyframes, 0);
268 }
259 269
260 newmotion.m_frames = new List<Keyframe>(m_frames); 270 newmotion.m_frames = new List<Keyframe>(m_frames);
271
272 newmotion.m_basePosition = m_basePosition;
273 newmotion.m_baseRotation = m_baseRotation;
274
261 newmotion.m_currentFrame = m_currentFrame; 275 newmotion.m_currentFrame = m_currentFrame;
262 276
263 newmotion.m_nextPosition = m_nextPosition;
264 if (m_selected) 277 if (m_selected)
265 newmotion.m_serializedPosition = m_serializedPosition; 278 newmotion.m_serializedPosition = m_serializedPosition;
266 else 279 else
@@ -272,12 +285,7 @@ namespace OpenSim.Region.Framework.Scenes
272 } 285 }
273 286
274 newmotion.m_iterations = m_iterations; 287 newmotion.m_iterations = m_iterations;
275 288 newmotion.m_running = m_running;
276 newmotion.m_onTimerLock = new object();
277 newmotion.m_timerStopped = false;
278 newmotion.m_inOnTimer = false;
279 newmotion.m_isCrossing = false;
280 newmotion.m_waitingCrossing = false;
281 289
282 if (m_running && !m_waitingCrossing) 290 if (m_running && !m_waitingCrossing)
283 StartTimer(); 291 StartTimer();
@@ -299,7 +307,7 @@ namespace OpenSim.Region.Framework.Scenes
299 { 307 {
300 m_isCrossing = false; 308 m_isCrossing = false;
301 m_waitingCrossing = false; 309 m_waitingCrossing = false;
302 if (m_keyframes.Length > 0) 310 if (m_keyframes != null && m_group != null && m_keyframes.Length > 0)
303 { 311 {
304 if (m_timer == null) 312 if (m_timer == null)
305 { 313 {