diff options
author | Melanie | 2012-02-26 15:06:05 +0100 |
---|---|---|
committer | Melanie | 2012-02-26 15:06:05 +0100 |
commit | 416f39a561a08a92f0005495f0f804a07dc5b016 (patch) | |
tree | bfb566dc9dcb0fa56e7b2acf5b0475418960156c /OpenSim/Region/Framework/Scenes | |
parent | Fix deserialization of Buoyancy, Force and Torque. Remove debug from the new (diff) | |
download | opensim-SC_OLD-416f39a561a08a92f0005495f0f804a07dc5b016.zip opensim-SC_OLD-416f39a561a08a92f0005495f0f804a07dc5b016.tar.gz opensim-SC_OLD-416f39a561a08a92f0005495f0f804a07dc5b016.tar.bz2 opensim-SC_OLD-416f39a561a08a92f0005495f0f804a07dc5b016.tar.xz |
Implement KeyframedMotion selection behavior
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 |
3 files changed, 37 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 7f651aa..5f9c8e9 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 = tmp.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; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index bf2e775..b006045 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -138,12 +138,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
138 | { | 138 | { |
139 | SceneObjectGroup sog = part.ParentGroup; | 139 | SceneObjectGroup sog = part.ParentGroup; |
140 | sog.SendPropertiesToClient(remoteClient); | 140 | sog.SendPropertiesToClient(remoteClient); |
141 | sog.IsSelected = true; | ||
142 | 141 | ||
143 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | 142 | // A prim is only tainted if it's allowed to be edited by the person clicking it. |
144 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) | 143 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) |
145 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) | 144 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) |
146 | { | 145 | { |
146 | sog.IsSelected = true; | ||
147 | EventManager.TriggerParcelPrimCountTainted(); | 147 | EventManager.TriggerParcelPrimCountTainted(); |
148 | } | 148 | } |
149 | } | 149 | } |
@@ -215,7 +215,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
215 | // handled by group, but by prim. Legacy cruft. | 215 | // handled by group, but by prim. Legacy cruft. |
216 | // TODO: Make selection flagging per prim! | 216 | // TODO: Make selection flagging per prim! |
217 | // | 217 | // |
218 | part.ParentGroup.IsSelected = false; | 218 | if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) |
219 | || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) | ||
220 | part.ParentGroup.IsSelected = false; | ||
219 | 221 | ||
220 | if (part.ParentGroup.IsAttachment) | 222 | if (part.ParentGroup.IsAttachment) |
221 | isAttachment = true; | 223 | isAttachment = true; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ac2fe82..e509d4e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -726,6 +726,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
726 | child.PhysActor.Selected = value; | 726 | child.PhysActor.Selected = value; |
727 | } | 727 | } |
728 | } | 728 | } |
729 | if (KeyframeMotion != null) | ||
730 | KeyframeMotion.Selected = value; | ||
729 | } | 731 | } |
730 | } | 732 | } |
731 | 733 | ||