A two dimensional surface that extends infinitely in 3D space, represented in Hessian normal form by a unit length normal vector and a constant.
normal — (optional) a unit length Vector3 defining the normal of the plane. Default is (1, 0, 0)
.
constant — (optional) the signed distance from the origin to the plane. Default is 0
.
Read-only flag to check if a given object is of type Plane.
matrix — the Matrix4 to apply.
optionalNormalMatrix — (optional) pre-computed normal Matrix3 of the Matrix4 being applied.
Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.
If supplying an optionalNormalMatrix, it can be created like so:
const optionalNormalMatrix = new v3d.Matrix3().getNormalMatrix(matrix);
Returns a new plane with the same normal and constant as this one.
target — the result will be copied into this Vector3.
Returns a Vector3 coplanar to the plane, by calculating the projection of the normal vector at the origin onto the plane.
Copies the values of the passed plane's normal and constant properties to this plane.
Returns the signed distance from the point to the plane.
Returns the signed distance from the sphere to the plane.
Checks to see if two planes are equal (their normal and constant properties match).
line — the Line3 to check for intersection.
target — the result will be copied into this Vector3.
Returns the intersection point of the passed line and the plane. Returns null if the line does not intersect. Returns the line's starting point if the line is coplanar with the plane.
box — the Box3 to check for intersection.
Determines whether or not this plane intersects box.
line — the Line3 to check for intersection.
Tests whether a line segment intersects with (passes through) the plane.
sphere — the Sphere to check for intersection.
Determines whether or not this plane intersects sphere.
Negates both the normal vector and the constant.
Normalizes the normal vector, and adjusts the constant value accordingly.
point — the Vector3 to project onto the plane.
target — the result will be copied into this Vector3.
Projects a point onto the plane.
normal — a unit length Vector3 defining the normal of the plane.
constant — the signed distance from the origin to the plane. Default is 0
.
Sets this plane's normal and constant properties by copying the values from the given normal.
x — x value of the unit length normal vector.
y — y value of the unit length normal vector.
z — z value of the unit length normal vector.
w — the value of the plane's constant property.
Set the individual components that define the plane.
a — first point on the plane.
b — second point on the plane.
c — third point on the plane.
Defines the plane based on the 3 provided points. The winding order is assumed to be counter-clockwise, and determines the direction of the normal.
normal — a unit length Vector3 defining the normal of the plane.
point — Vector3.
Sets the plane's properties as defined by a normal and an arbitrary coplanar point.
offset — the amount to move the plane by.
Translates the plane by the distance defined by the offset vector. Note that this only affects the plane constant and will not affect the normal vector.
For more info on how to obtain the source code of this module see this page.