clip

fun clip(pointA: Vec3, pointB: Vec3): Array<Vec3>?

Clips a line segment to this plane, returning an two-point array indicating the clipped segment. If the direction of the line formed by the two points is positive with respect to this plane's normal vector, the first point in the array will be the intersection point on the plane, and the second point will be the original segment end point. If the direction of the line is negative with respect to this plane's normal vector, the first point in the array will be the original segment's begin point, and the second point will be the intersection point on the plane. If the segment does not intersect the plane, null is returned. If the segment is coincident with the plane, the input points are returned, in their input order.

Return

an array of two points both on the positive side of the plane, or null if the segment does not intersect this plane

Parameters

pointA

the first line segment endpoint

pointB

the second line segment endpoint