Filters an array of point-like objects to only those contained within a triangle.
If returnFirst
is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points).
name | type | arguments | Default | description |
---|---|---|---|---|
triangle | Phaser.Geom.Triangle |
The triangle that the points are being checked in. |
||
points | Array.<Phaser.Geom.Point> |
An array of point-like objects (objects that have an |
||
returnFirst | boolean | <optional> | false |
If |
out | array | <optional> |
If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If |
An array containing all the points from points
that are within the triangle, if an array was provided as out
, points will be appended to that array and it will also be returned here.