Line.intersects()

<static> intersects(a, b, asSegment, result) → {Phaser.Point}

Checks for intersection between two lines.
If asSegment is true it will check for segment intersection.
If asSegment is false it will check for line intersection.
Returns the intersection segment of AB and EF as a Point, or null if there is no intersection.
Adapted from code by Keith Hair

Parameters
Name Type Argument Default Description
a Phaser.Line

The first Line to be checked.

b Phaser.Line

The second Line to be checked.

asSegment boolean <optional>
true

If true it will check for segment intersection, otherwise full line intersection.

result Phaser.Point <optional>

A Point object to store the result in, if not given a new one will be created.

Returns

The intersection segment of the two lines as a Point, or null if there is no intersection.

Source code: geom/Line.js (Line 610)
doc_phaser
2017-02-14 10:54:08
Comments
Leave a Comment

Please login to continue.