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.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index 7f651aa..bf18f4d 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -72,6 +72,8 @@ namespace OpenSim.Region.Framework.Scenes
72 private DataFormat m_data = DataFormat.Translation | DataFormat.Rotation; 72 private DataFormat m_data = DataFormat.Translation | DataFormat.Rotation;
73 73
74 private bool m_running = false; 74 private bool m_running = false;
75 [NonSerialized()]
76 private bool m_selected = false;
75 77
76 private int m_iterations = 0; 78 private int m_iterations = 0;
77 79
@@ -82,6 +84,25 @@ namespace OpenSim.Region.Framework.Scenes
82 get { return m_data; } 84 get { return m_data; }
83 } 85 }
84 86
87 public bool Selected
88 {
89 set
90 {
91 if (value)
92 {
93 // Once we're let go, recompute positions
94 if (m_selected)
95 UpdateSceneObject(m_group);
96 }
97 else
98 {
99 // Save selection position in case we get moved
100 if (!m_selected)
101 m_serializedPosition = m_group.AbsolutePosition;
102 }
103 m_selected = value; }
104 }
105
85 public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data) 106 public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data)
86 { 107 {
87 MemoryStream ms = new MemoryStream(data); 108 MemoryStream ms = new MemoryStream(data);
@@ -276,6 +297,16 @@ namespace OpenSim.Region.Framework.Scenes
276 m_currentFrame = m_frames[0]; 297 m_currentFrame = m_frames[0];
277 } 298 }
278 299
300 if (m_selected)
301 {
302 if (m_group.RootPart.Velocity != Vector3.Zero)
303 {
304 m_group.RootPart.Velocity = Vector3.Zero;
305 m_group.SendGroupRootTerseUpdate();
306 }
307 return;
308 }
309
279 // Do the frame processing 310 // Do the frame processing
280 double steps = (double)m_currentFrame.TimeMS / timerInterval; 311 double steps = (double)m_currentFrame.TimeMS / timerInterval;
281 float complete = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal; 312 float complete = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal;