An infinite plane. Internally it's represented in a parametric equation form: ax + by + cz + distance = 0.
new Plane(normal?: Vec3, distance?: number): Plane
Create a new Plane instance.
Vec3 = Vec3.UP
Normal of the plane. The constructor copies this parameter. Defaults to Vec3.UP.
number = 0
The distance from the plane to the origin, along its normal. Defaults to 0.
distance: number
The distance from the plane to the origin, along its normal.
normal: Vec3
The normal of the plane.
clone(): Plane
Returns a clone of the specified plane.
A duplicate plane.
copy(src: Plane): Plane
Copies the contents of a source plane to a destination plane.
A source plane to copy to the destination plane.
Self for chaining.
intersectsLine(
start: Vec3,
end: Vec3,
point?: Vec3): boolean
Test if the plane intersects between two points.
Start position of line.
End position of line.
If there is an intersection, the intersection point will be copied into here.
boolean
True if there is an intersection.
intersectsRay(ray: Ray, point?: Vec3): boolean
Test if a ray intersects with the infinite plane.
Ray to test against (direction must be normalized).
If there is an intersection, the intersection point will be copied into here.
boolean
True if there is an intersection.
normalize(): Plane
Normalize the plane.
Self for chaining.
set(
nx: number,
ny: number,
nz: number,
d: number): Plane
Sets the plane based on a normal and a distance from the origin.
number
The x-component of the normal.
number
The y-component of the normal.
number
The z-component of the normal.
number
The distance from the origin.
Self for chaining.
setFromPointNormal(point: Vec3, normal: Vec3): Plane
Sets the plane based on a specified normal and a point on the plane.
The point on the plane.
The normal of the plane.
Self for chaining.