Beispiel #1
0
 public SceneElement insertElement(BoundingBox bb, GameObject gameObject)
 {
     ContainmentType t = m_root.BoundingBox.Contains(bb);
     if (t == ContainmentType.Contains) {
         SceneElement se;
         if (!m_sceneElements.TryGetValue(gameObject, out se))
         {
             se = new SceneElement(bb, gameObject);
             m_root.insertElement(se);
         }
         return se;
     }
     return null;
 }
Beispiel #2
0
        /// <summary>
        /// Creates and inserts an element.
        /// </summary>
        /// <param name="bb">BoundingBox of the element.</param>
        /// <returns>The newly created SceneElement</returns>
        public SceneElement insertElementVisual(BoundingBox bb, GameObject gameObject)
        {
            if(m_insertTimer!= null)
                m_insertTimer.Watch.Start();

            SceneElement ele = m_octreeVisual.insertElement(bb, gameObject);
            ele.m_updateTimer = m_updateTimer;

            if (m_insertTimer != null)
                m_insertTimer.Watch.Stop();

            return ele;
        }
Beispiel #3
0
 /// <summary>
 /// Creates and inserts an element.
 /// </summary>
 /// <param name="bb">BoundingBox of the element.</param>
 /// <returns>The newly created SceneElement</returns>
 public SceneElement insertElementCollision(BoundingBox bb, GameObject gameObject)
 {
     return m_octreeCollision.insertElement(bb, gameObject);
 }
Beispiel #4
0
 public SceneElement(BoundingBox bb, GameObject gameObject)
 {
     m_bb = bb;
     m_gameObject = gameObject;
 }
Beispiel #5
0
        private void addGameObject(XmlDocument doc, XmlElement gameobjectsList, GameObject gameObject)
        {
            XmlElement gameObjectEl = doc.CreateElement("GameObject");
            gameObjectEl.SetAttribute("Name", gameObject.Id.ToString());

            XmlElement elements = doc.CreateElement("Elements");
            foreach (AbstractElement element in gameObject.getAll())
            {
                addComponents(doc, elements, element);
            }
            gameObjectEl.AppendChild(elements);
            gameobjectsList.AppendChild(gameObjectEl);
        }
Beispiel #6
0
 public void setOwner(GameObject owner)
 {
     m_owner = owner;
 }