API Reference

Class List

Plane

An infinite plane. Internally it's represented in a parametric equation form: ax + by + cz + distance = 0.

Summary

Properties

distance

The distance from the plane to the origin, along its normal.[read only]

normal

The normal of the plane.[read only]

Methods

clone

Returns a clone of the Plane.

copy

Copies the contents of a source Plane.

intersectsLine

Test if the plane intersects between two points.

intersectsRay

Test if a ray intersects with the infinite plane.

setFromPointNormal

Sets the plane based on a specified normal and a point on the plane.

Details

Constructor

Plane([normal], [distance])

Create a new Plane instance.

Parameters

normalVec3

Normal of the plane. The constructor copies this parameter. Defaults to Vec3.UP.

distancenumber

The distance from the plane to the origin, along its normal. Defaults to 0.

Properties

numberdistance

The distance from the plane to the origin, along its normal.

[read only]

Vec3normal

The normal of the plane.

[read only]

Methods

clone()

Returns a clone of the Plane.

Returns

this

A duplicate Plane.

copy(src)

Copies the contents of a source Plane.

Parameters

srcPlane

The Plane to copy from.

Returns

Plane

Self for chaining.

intersectsLine(start, end, [point])

Test if the plane intersects between two points.

Parameters

startVec3

Start position of line.

endVec3

End position of line.

pointVec3

If there is an intersection, the intersection point will be copied into here.

Returns

boolean

True if there is an intersection.

intersectsRay(ray, [point])

Test if a ray intersects with the infinite plane.

Parameters

rayRay

Ray to test against (direction must be normalized).

pointVec3

If there is an intersection, the intersection point will be copied into here.

Returns

boolean

True if there is an intersection.

setFromPointNormal(point, normal)

Sets the plane based on a specified normal and a point on the plane.

Parameters

pointVec3

The point on the plane.

normalVec3

The normal of the plane.

Returns

Plane

Self for chaining.