예제 #1
0
        /// <summary>
        /// Adds a collidable to the manager.
        /// </summary>
        /// <param name="collidable"></param>
        public void AddCollidable(ICollidable collidable)
        {
            var c = new CollidableAABB(collidable);

            foreach (CollidablePoint p in c.Points)
            {
                AddPoint(p);
            }
            if (collidable is IComponent)
            {
                var baseComp = collidable as Component;
                _aabbs.Add(c, baseComp.Owner);
            }
            else
            {
                _aabbs.Add(c, null);
            }
        }
예제 #2
0
 public CollidablePoint(CollidablePointIndex index, PointF coordinates, CollidableAABB parentAABB)
 {
     Index       = index;
     Coordinates = coordinates;
     ParentAABB  = parentAABB;
 }
예제 #3
0
 public CollidablePoint(CollidablePointIndex index, PointF coordinates, CollidableAABB parentAABB)
 {
     Index = index;
     Coordinates = coordinates;
     ParentAABB = parentAABB;
 }
예제 #4
0
 /// <summary>
 /// Adds a collidable to the manager.
 /// </summary>
 /// <param name="collidable"></param>
 public void AddCollidable(ICollidable collidable)
 {
     var c = new CollidableAABB(collidable);
     foreach (CollidablePoint p in c.Points)
     {
         AddPoint(p);
     }
     if (collidable is IComponent)
     {
         var baseComp = collidable as Component;
         _aabbs.Add(c, baseComp.Owner);
     }
     else
         _aabbs.Add(c, null);
 }