Phaser API Documentation

  Version: 
<static> GetTriangleToTriangle(triangleA, triangleB, [out])

Description:

Checks if two Triangles intersect, and returns the intersection points as a Point object array.

A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid".

Parameters:

name type arguments description
triangleA Phaser.Geom.Triangle

The first Triangle to check for intersection.

triangleB Phaser.Geom.Triangle

The second Triangle to check for intersection.

out array <optional>

An optional array in which to store the points of intersection.

Returns:
Description:

An array with the points of intersection if objects intersect, otherwise an empty array.

Type:
  • array
Examples:
Since: 3.0.0