Exemple #1
0
        public static bool TriangleRectangleCollision(Triangle triangle, PhysicalRectangle rectangle)
        {
            Vector2 s1 = triangle.Sommet1;
            Vector2 s2 = triangle.Sommet2;
            Vector2 s3 = triangle.Sommet3;

            if (LineRectangleCollision(ref s1, ref s2, rectangle) ||
                LineRectangleCollision(ref s2, ref s3, rectangle) ||
                LineRectangleCollision(ref s3, ref s1, rectangle))
                return true;

            return false;
        }
Exemple #2
0
 public static void DrawTriangle(SpriteBatch spriteBatch, Triangle triangle, Color color)
 {
     DrawLine(spriteBatch, triangle.Sommet1, triangle.Sommet2, color);
     DrawLine(spriteBatch, triangle.Sommet2, triangle.Sommet3, color);
     DrawLine(spriteBatch, triangle.Sommet3, triangle.Sommet1, color);
 }
Exemple #3
0
 public static bool TriangleRectangleCollision(Triangle triangle, PhysicalRectangle rectangle)
 {
     return Collisions.TriangleRectangleCollision(triangle, rectangle);
 }