public void Process() { List <Guid> objectIdsToDeactivate = new List <Guid>(); foreach (Guid objectId in m_activeObjects) { DeckObject deckObject = m_objects[objectId]; deckObject.Process(); ObjectUpdate(deckObject); Quaternion networkOrientation = deckObject.NetworkOrientation; Quaternion renderOrientation = deckObject.RenderOrientation; if ((deckObject.NetworkLocation - deckObject.RenderLocation).Length < 0.01 && (deckObject.NetworkScale - deckObject.RenderScale).Length < 0.01 && Common.FastDistance(ref networkOrientation, ref renderOrientation) < 0.01) { objectIdsToDeactivate.Add(objectId); } } foreach (Guid objectId in objectIdsToDeactivate) { DeactivateObject(objectId); } DeckProgram.DeckRudder.UpdateCameraTransformation(); }
public void DefocusObject(DeckObject deckObject) { if (m_focus != null) { m_focus = null; ObjectDefocused(deckObject); } }
public void FocusObject(DeckObject deckObject) { if (!m_selection.Contains(deckObject)) { SelectObject(deckObject); } if (m_focus != deckObject) { m_focus = deckObject; ObjectFocused(deckObject); } }
public void SelectObject(DeckObject deckObject) { if (!m_selection.Contains(deckObject)) { m_selection.Add(deckObject); ObjectSelected(deckObject); } if (m_focus == null) { FocusObject(deckObject); } }
public void DeselectObject(DeckObject deckObject) { if (m_focus == deckObject) { DefocusObject(deckObject); if (m_selection.Count > 0 && m_selection[0] != deckObject) { FocusObject(m_selection[0]); } else { if (m_selection.Count > 1) { FocusObject(m_selection[1]); } } } if (m_selection.Contains(deckObject)) { m_selection.Remove(deckObject); ObjectDeselected(deckObject); } }
public void AddObject(DeckObject deckObject) { m_objects.Add(deckObject.ObjectId, deckObject); ObjectAdd(deckObject); }
public void UpdateObject(DeckObject deckObject) { ObjectUpdate(deckObject); }