Beispiel #1
0
        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();
        }
Beispiel #2
0
 public void DefocusObject(DeckObject deckObject)
 {
     if (m_focus != null)
     {
         m_focus = null;
         ObjectDefocused(deckObject);
     }
 }
Beispiel #3
0
 public void FocusObject(DeckObject deckObject)
 {
     if (!m_selection.Contains(deckObject))
     {
         SelectObject(deckObject);
     }
     if (m_focus != deckObject)
     {
         m_focus = deckObject;
         ObjectFocused(deckObject);
     }
 }
Beispiel #4
0
 public void SelectObject(DeckObject deckObject)
 {
     if (!m_selection.Contains(deckObject))
     {
         m_selection.Add(deckObject);
         ObjectSelected(deckObject);
     }
     if (m_focus == null)
     {
         FocusObject(deckObject);
     }
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
 public void AddObject(DeckObject deckObject)
 {
     m_objects.Add(deckObject.ObjectId, deckObject);
     ObjectAdd(deckObject);
 }
Beispiel #7
0
 public void UpdateObject(DeckObject deckObject)
 {
     ObjectUpdate(deckObject);
 }