예제 #1
0
        public void expandToInclude(ref Vector2 pt)
        {
            if (Validity == PointValidity.Valid)
            {
                if (pt.x < Min.x)
                {
                    Min.x = pt.x;
                }
                else if (pt.x > Max.x)
                {
                    Max.x = pt.x;
                }

                if (pt.y < Min.y)
                {
                    Min.y = pt.y;
                }
                else if (pt.y > Max.y)
                {
                    Max.y = pt.y;
                }
            }
            else
            {
                Min      = Max = pt;
                Validity = PointValidity.Valid;
            }
        }
 public bool CanJumpToPoint(MazePoint p)
 {
     return(PointValidity.ValidPoint(p, Size));
 }
예제 #3
0
 /// <summary>
 /// Resets a bounding box to invalid.
 /// </summary>
 public void clear()
 {
     Min.x = Max.x = Min.y = Max.y = 0;
     Validity = PointValidity.Invalid;
 }
예제 #4
0
 /// <summary>
 /// create a boundingbox with the given min and max points.
 /// </summary>
 /// <param name="minPt">min point</param>
 /// <param name="maxPt">max point</param>
 public AABB(ref Vector2 minPt, ref Vector2 maxPt)
 {
     Min = minPt;
     Max = maxPt;
     Validity = PointValidity.Valid;
 }
예제 #5
0
 /// <summary>
 /// Basic constructor.  creates a bounding box that is invalid (describes no space)
 /// </summary>
 public AABB()
 {
     Min = Max = Vector2.zero;
     Validity = PointValidity.Invalid;
 }
예제 #6
0
        public void expandToInclude(ref Vector2 pt)
        {
            if (Validity == PointValidity.Valid)
            {
                if (pt.x < Min.x) { Min.x = pt.x; }
                else if (pt.x > Max.x) { Max.x = pt.x; }

                if (pt.y < Min.y) { Min.y = pt.y; }
                else if (pt.y > Max.y) { Max.y = pt.y; }
            }
            else
            {
                Min = Max = pt;
                Validity = PointValidity.Valid;
            }
        }
예제 #7
0
 /// <summary>
 /// create a boundingbox with the given min and max points.
 /// </summary>
 /// <param name="minPt">min point</param>
 /// <param name="maxPt">max point</param>
 public AABB(ref Vector2 minPt, ref Vector2 maxPt)
 {
     Min      = minPt;
     Max      = maxPt;
     Validity = PointValidity.Valid;
 }
예제 #8
0
 /// <summary>
 /// Resets a bounding box to invalid.
 /// </summary>
 public void clear()
 {
     Min.x    = Max.x = Min.y = Max.y = 0;
     Validity = PointValidity.Invalid;
 }
예제 #9
0
 /// <summary>
 /// Basic constructor.  creates a bounding box that is invalid (describes no space)
 /// </summary>
 public AABB()
 {
     Min      = Max = Vector2.zero;
     Validity = PointValidity.Invalid;
 }
예제 #10
0
        public void expandToInclude(ref Vector2 pt)
        {
            if (Validity == PointValidity.Valid)
            {
                if (pt.X < Min.X) { Min.X = pt.X; }
                else if (pt.X > Max.X) { Max.X = pt.X; }

                if (pt.Y < Min.Y) { Min.Y = pt.Y; }
                else if (pt.Y > Max.Y) { Max.Y = pt.Y; }
            }
            else
            {
                Min = Max = pt;
                Validity = PointValidity.Valid;
            }
        }
예제 #11
0
 /// <summary>
 /// Resets a bounding box to invalid.
 /// </summary>
 public void clear()
 {
     Min.X = Max.X = Min.Y = Max.Y = 0;
     Validity = PointValidity.Invalid;
 }
예제 #12
0
 /// <summary>
 /// create a JelloAABB with the given min and max points.
 /// </summary>
 /// <param name="min">The JelloAABB.Min point (lower left).</param>
 /// <param name="max">The JelloAABB.max point(upper right).</param>
 public JelloAABB(ref Vector2 min, ref Vector2 max)
 {
     Min      = min;
     Max      = max;
     Validity = PointValidity.Valid;
 }
예제 #13
0
 /// <summary>
 /// create a JelloAABB with the given min and max points.
 /// </summary>
 /// <param name="min">The JelloAABB.Min point (lower left).</param>
 /// <param name="max">The JelloAABB.max point(upper right).</param>
 public JelloAABB(ref Vector2 min, ref Vector2 max)
 {
     Min = min;
     Max = max;
     Validity = PointValidity.Valid;
 }