Implement KeyframedMotion selection behavior

avinationmerge
Melanie 2012-02-26 15:06:05 +01:00
parent 8cdc115c91
commit 416f39a561
3 changed files with 37 additions and 2 deletions

View File

@ -72,6 +72,8 @@ namespace OpenSim.Region.Framework.Scenes
private DataFormat m_data = DataFormat.Translation | DataFormat.Rotation; private DataFormat m_data = DataFormat.Translation | DataFormat.Rotation;
private bool m_running = false; private bool m_running = false;
[NonSerialized()]
private bool m_selected = false;
private int m_iterations = 0; private int m_iterations = 0;
@ -82,6 +84,25 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_data; } get { return m_data; }
} }
public bool Selected
{
set
{
if (value)
{
// Once we're let go, recompute positions
if (m_selected)
UpdateSceneObject(m_group);
}
else
{
// Save selection position in case we get moved
if (!m_selected)
m_serializedPosition = tmp.AbsolutePosition;
}
m_selected = value; }
}
public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data) public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data)
{ {
MemoryStream ms = new MemoryStream(data); MemoryStream ms = new MemoryStream(data);
@ -276,6 +297,16 @@ namespace OpenSim.Region.Framework.Scenes
m_currentFrame = m_frames[0]; m_currentFrame = m_frames[0];
} }
if (m_selected)
{
if (m_group.RootPart.Velocity != Vector3.Zero)
{
m_group.RootPart.Velocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate();
}
return;
}
// Do the frame processing // Do the frame processing
double steps = (double)m_currentFrame.TimeMS / timerInterval; double steps = (double)m_currentFrame.TimeMS / timerInterval;
float complete = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal; float complete = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal;

View File

@ -138,12 +138,12 @@ namespace OpenSim.Region.Framework.Scenes
{ {
SceneObjectGroup sog = part.ParentGroup; SceneObjectGroup sog = part.ParentGroup;
sog.SendPropertiesToClient(remoteClient); sog.SendPropertiesToClient(remoteClient);
sog.IsSelected = true;
// A prim is only tainted if it's allowed to be edited by the person clicking it. // A prim is only tainted if it's allowed to be edited by the person clicking it.
if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
|| Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
{ {
sog.IsSelected = true;
EventManager.TriggerParcelPrimCountTainted(); EventManager.TriggerParcelPrimCountTainted();
} }
} }
@ -215,7 +215,9 @@ namespace OpenSim.Region.Framework.Scenes
// handled by group, but by prim. Legacy cruft. // handled by group, but by prim. Legacy cruft.
// TODO: Make selection flagging per prim! // TODO: Make selection flagging per prim!
// //
part.ParentGroup.IsSelected = false; if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId)
|| Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
part.ParentGroup.IsSelected = false;
if (part.ParentGroup.IsAttachment) if (part.ParentGroup.IsAttachment)
isAttachment = true; isAttachment = true;

View File

@ -726,6 +726,8 @@ namespace OpenSim.Region.Framework.Scenes
child.PhysActor.Selected = value; child.PhysActor.Selected = value;
} }
} }
if (KeyframeMotion != null)
KeyframeMotion.Selected = value;
} }
} }