Shaku

Shaku JS

Back To Table of Content

Plane

Plane

A plane in 3D space.

Kind: global class

new Plane(normal, constant)

Create the plane.

Param Type Default Description
normal Vector3   Plane normal vector.
constant Number 0 Plane constant.

plane.set(normal, constant) ⇒ Plane

Set the plane components.

Kind: instance method of Plane
Returns: Plane - Self.

Param Type Description
normal Vector3 Plane normal.
constant Number Plane constant.

plane.setComponents(x, y, z, w) ⇒ Plane

Set the plane components.

Kind: instance method of Plane
Returns: Plane - Self.

Param Type Description
x Number Plane normal X.
y Number Plane normal Y.
z Number Plane normal Z.
w Number Plane constant.

plane.setFromNormalAndCoplanarPoint(normal, point) ⇒ Plane

Set plane from normal and coplanar point vectors.

Kind: instance method of Plane
Returns: Plane - Self.

Param Type Description
normal Vector3 Plane normal.
point Vector3 Coplanar point.

plane.copy(plane) ⇒ Plane

Copy values from another plane.

Kind: instance method of Plane
Returns: Plane - Self.

Param Type Description
plane Plane Plane to copy.

plane.normalizeSelf() ⇒ Plane

Normalize the plane.

Kind: instance method of Plane
Returns: Plane - self.

plane.normalized() ⇒ Plane

Normalize a clone of this plane.

Kind: instance method of Plane
Returns: Plane - Normalized clone.

plane.negateSelf() ⇒ Plane

Negate this plane.

Kind: instance method of Plane
Returns: Plane - Self.

plane.distanceToPoint(point) ⇒ Number

Calculate distance to point.

Kind: instance method of Plane
Returns: Number - Distance to point.

Param Type Description
point Vector3 Point to calculate distance to.

plane.distanceToSphere(sphere) ⇒ Number

Calculate distance to sphere.

Kind: instance method of Plane
Returns: Number - Distance to sphere.

Param Type Description
sphere Sphere Sphere to calculate distance to.

plane.collideLine(line) ⇒ Boolean

Check if this plane collide with a line.

Kind: instance method of Plane
Returns: Boolean - True if collide, false otherwise.

Param Type Description
line Line Line to check.

plane.collideSphere(sphere) ⇒ Boolean

Check if this plane collide with a sphere.

Kind: instance method of Plane
Returns: Boolean - True if collide, false otherwise.

Param Type Description
sphere Sphere Sphere to check.

plane.coplanarPoint() ⇒ Vector3

Coplanar a point.

Kind: instance method of Plane
Returns: Vector3 - Coplanar point as a new vector.

plane.translateSelf(offset) ⇒ Plane

Translate this plane.

Kind: instance method of Plane
Returns: Plane - Self.

Param Type Description
offset Vector3 Offset to translate to.

plane.equals(plane) ⇒ Boolean

Check if this plane equals another plane.

Kind: instance method of Plane
Returns: Boolean - True if equal, false otherwise.

Param Type Description
plane Plane Other plane to compare to.

plane.clone() ⇒ Plane

Clone this plane.

Kind: instance method of Plane
Returns: Plane - Cloned plane.