Phaser API Documentation

  Version: 
<static> GetTriangleToLine(triangle, line, [out])

Description:

Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array.

The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid".

Parameters:

name type arguments description
triangle Phaser.Geom.Triangle

The Triangle to check with.

line Phaser.Geom.Line

The Line to check with.

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