The origin's signed distance from the plane, negative when the origin is behind it
ReadonlynormalThe unit-length direction the plane faces; its positive side
ReadonlytypeNames the shape without an instanceof check, like the type on pixi's 2D shapes
Transforms this plane by an affine matrix, so points on it stay on it
Non-uniform scale is fine, and the normal comes out unit length. A mirroring matrix swaps
which side of the plane is positive. Needs a unit-length normal, and matrix must be affine
(bottom row [0, 0, 0, 1]), as a Container3D#worldTransform always is.
The result plane for chaining
Copies plane into this plane
The plane to copy from
This plane for chaining
Returns the signed distance from point to this plane (positive on the side of normal)
The point to measure from
The signed distance to the plane
Returns true when normal and constant match plane exactly (no epsilon tolerance)
The plane to compare with
Whether the normal and constant match
Returns true when this plane passes through box or touches it; same as Box#intersectsPlane
The box to test
Whether the plane passes through or touches the box
Returns true when ray hits this plane; same as Ray#intersectsPlane
The ray to test
Whether the ray intersects this plane
Returns true when this plane passes through sphere or touches it; never for an empty sphere
The sphere to test
Whether the plane passes through or touches the sphere
Scales the plane so normal has unit length
The constant scales with it, so the plane stays in place. A zero-length normal gives NaN.
Target to write the result into instead of mutating this plane
The result plane for chaining
Writes the closest point on this plane to point into out (or a new Vector3)
The point to project
Optionalout: Vector3
Optional vector to write into; a new Vector3 when omitted
The projected point
Sets the normal and constant of this plane, copying the normal
The unit-length normal
The origin's signed distance from the plane
This plane for chaining
Sets the normal to (x, y, z) and the constant to w, the four numbers of a plane equation
Equations from elsewhere, such as rows of a projection matrix, rarely have a unit-length normal, so call Plane#normalize after.
The x component of the normal
The y component of the normal
The z component of the normal
The plane constant
This plane for chaining
Sets this plane from a unit-length normal and a coplanar point
The unit-length normal
A point on the plane
This plane for chaining
Advanced
Returns a string representation of this plane
A string in the form [@pixi/3d/math:Plane normal=(1, 0, 0) constant=0]
An infinite flat plane: the points
pwherenormal ยท p + constant = 0The ground
y = 0isnew Plane(new Vector3(0, 1, 0), 0), and the upward-facing planey = 2has a constant of-2. Keepnormalunit length, or distances come out scaled; Plane#normalize fixes one that isn't.Example
See
Ray#intersectPlane For the point where a ray hits the plane