Exemplo n.º 1
0
        /// <summary>
        /// Add element
        /// </summary>
        /// <param name="collisionObject">Collision object</param>
        public void AddElement(BaseCollisionObject collisionObject)
        {
            if (collisionObject.box.DoesBoxIntersect(box) == false)
                return;

            if (childs == null)
            {
                if (elems == null)
                    elems = new List<BaseCollisionObject>();
                elems.Add(collisionObject);
                collisionObject.AddToNode(this);
            } // if (childs)
            else
            {
                foreach (CollisionNode node in childs)
                    node.AddElement(collisionObject);
            } // else
        }
Exemplo n.º 2
0
 /// <summary>
 /// Remove element
 /// </summary>
 /// <param name="collisionObject">Collision object</param>
 public void RemoveElement(BaseCollisionObject collisionObject)
 {
     if (elems != null)
         elems.Remove(collisionObject);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Add element
 /// </summary>
 /// <param name="elem">Elem</param>
 public void AddElement(BaseCollisionObject elem)
 {
     root.AddElement(elem);
 }