Phaser API Documentation

<static> GetLineToLine(line1, line2, [out])


Checks for intersection between the two line segments 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 description
line1 Phaser.Geom.Line

The first line segment to check.

line2 Phaser.Geom.Line

The second line segment to check.

out Phaser.Math.Vector3 <optional>

A Vector3 to store the intersection results in.


A Vector3 containing the intersection results, or null.

Since: 3.50.0