mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
Implement proper selection behavior
This commit is contained in:
@@ -72,6 +72,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private DataFormat m_data = DataFormat.Translation | DataFormat.Rotation;
|
||||
|
||||
private bool m_running = false;
|
||||
[NonSerialized()]
|
||||
private bool m_selected = false;
|
||||
|
||||
private int m_iterations = 0;
|
||||
|
||||
@@ -82,6 +84,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
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 = m_group.AbsolutePosition;
|
||||
}
|
||||
m_selected = value; }
|
||||
}
|
||||
|
||||
public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(data);
|
||||
@@ -276,6 +297,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
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
|
||||
double steps = (double)m_currentFrame.TimeMS / timerInterval;
|
||||
float complete = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal;
|
||||
|
||||
Reference in New Issue
Block a user