Esempio n. 1
0
 public override bool Collide(RectCollider rect)
 {
     foreach (var c in colliders)
     {
         if (c.Collide(rect))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 2
0
 //Rectangle
 public static bool LineToRectangle(float lineStartX, float lineStartY, float lineEndX, float lineEndY, RectCollider rect)
 {
     return(RectToLine(rect, lineStartX, lineStartY, lineEndX, lineEndY));
 }
Esempio n. 3
0
 public static bool RectToRect(RectCollider rect1, RectCollider rect2)
 {
     return(RectToRect(rect1.AbsolutePosition.X, rect1.AbsolutePosition.Y, rect1.Width, rect1.Height, rect2.AbsolutePosition.X, rect2.AbsolutePosition.Y, rect2.Width, rect2.Height));
 }
Esempio n. 4
0
 public static bool RectToCircle(RectCollider rect, CircleCollider circle)
 {
     return(RectToCircle(rect.AbsolutePosition.X, rect.AbsolutePosition.Y, rect.Width, rect.Height, circle.AbsolutePosition.X, circle.AbsolutePosition.Y, circle.Radius));
 }
Esempio n. 5
0
 public static bool RectToCircle(RectCollider rect, float circleX, float circleY, float circleRadius)
 {
     return(RectToCircle(rect.Position.X, rect.Position.Y, rect.Width, rect.Height, circleX, circleY, circleRadius));
 }
Esempio n. 6
0
 public static bool RectToLine(RectCollider rect, Vector2 lineStart, Vector2 lineEnd)
 {
     return(CohenSutherland.Intersects(rect, lineStart, lineEnd));
 }
Esempio n. 7
0
 public static bool RectToLine(RectCollider rect, float lineStartX, float lineStartY, float lineEndX, float lineEndY)
 {
     return(RectToLine(rect.Position.X, rect.Position.Y, rect.Width, rect.Height, lineStartX, lineStartY, lineEndX, lineEndY));
 }
Esempio n. 8
0
 public static bool RectToPoint(RectCollider rect, Point point)
 {
     return(RectToPoint(rect.Position.X, rect.Position.Y, rect.Width, rect.Height, point));
 }
Esempio n. 9
0
 //Rectangle
 public static bool CircleToRectangle(CircleCollider circle, RectCollider rect)
 {
     return(RectToCircle(rect, circle));
 }
Esempio n. 10
0
 public override bool Collide(RectCollider rect)
 {
     return(Collide(rect.AbsolutePosition.X, rect.AbsolutePosition.Y, rect.AbsolutePosition.X + rect.Width, rect.AbsolutePosition.Y + rect.Height));
 }
Esempio n. 11
0
 public static bool Intersects(RectCollider rect, Vector2 lineStart, Vector2 lineEnd)
 {
     return(Intersects(rect.Position.X, rect.Position.Y, rect.Width, rect.Height, lineStart.X, lineStart.Y, lineEnd.X, lineEnd.Y));
 }