Plane

Plane

A representation of a mathematical plane using a normal vector and a plane constant (d) whose absolute value represents the distance
from the origin to the plane. It is generally calculated by taking a point (X) on the plane and finding its dot-product with the plane's
normal vector. In other words: d = N dot X

Constructor

new Plane(normalopt, constantopt)

Constructs a new plane

Parameters:
Name Type Attributes Default Description
normal Vector3 <optional>
Vector3.UNIT_Y

Normal of the plane.

constant number <optional>
0

The plane offset along the normal.

Methods

clone() → {Plane}

Returns a clone of this plane

copy(source) → {Plane}

Copies data from another plane

Parameters:
Name Type Description
source Plane

Source plane to copy from

pseudoDistance(point) → {number}

Parameters:
Name Type Description
point Vector3

Point to be used.

rayIntersect(ray, storeopt, suppressWarningsopt, precisionopt) → {Vector3}

Get the intersection of a ray with a plane.

Parameters:
Name Type Attributes Default Description
ray Ray

Ray to be used.

store Vector3 <optional>
suppressWarnings boolean <optional>
precision boolean <optional>
1e-7

reflectVector(unitVector, storeopt) → {Vector3}

Reflects an incoming vector across the normal of this Plane.

Parameters:
Name Type Attributes Description
unitVector Vector3

The incoming vector. Must be a unit vector.

store Vector3 <optional>

Vector to store the result in. May be the same as the unitVector.

setPlanePoints(pointA, pointB, pointC) → {Plane}

Sets this plane to the plane defined by the given three points.

Parameters:
Name Type Description
pointA Vector3
pointB Vector3
pointC Vector3