Checks for intersection between the two line segments, or a ray and a line segment,
and returns the intersection point as a Vector3, or null
if the lines are parallel, or do not intersect.
The z
property of the Vector3 contains the intersection distance, which can be used to find
the closest intersecting point from a group of line segments.
name | type | arguments | Default | description |
---|---|---|---|---|
line1 | Phaser.Geom.Line |
The first line segment, or a ray, to check. |
||
line2 | Phaser.Geom.Line |
The second line segment to check. |
||
isRay | boolean | <optional> | false |
Is |
out | Phaser.Math.Vector3 | <optional> |
A Vector3 to store the intersection results in. |
A Vector3 containing the intersection results, or null
.