Shaku

Shaku JS

Back To Table of Content

Frustum

Frustum

Implement a 3D Frustum shape.

Kind: global class

new Frustum(p0, p1, p2, p3, p4, p5)

Create the frustum.

Param Type Description
p0 Plane Frustum plane.
p1 Plane Frustum plane.
p2 Plane Frustum plane.
p3 Plane Frustum plane.
p4 Plane Frustum plane.
p5 Plane Frustum plane.

frustum.set(p0, p1, p2, p3, p4, p5) ⇒ Frustum

Set the Frustum values.

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

Param Type Description
p0 Plane Frustum plane.
p1 Plane Frustum plane.
p2 Plane Frustum plane.
p3 Plane Frustum plane.
p4 Plane Frustum plane.
p5 Plane Frustum plane.

frustum.copy(frustum) ⇒ Frustum

Copy values from another frustum.

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

Param Type Description
frustum Frustum Frustum to copy.

frustum.setFromProjectionMatrix(m) ⇒ Frustum

Set frustum from projection matrix.

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

Param Type Description
m Matrix Matrix to build frustum from.

frustum.collideSphere(sphere) ⇒ Boolean

Check if the frustum collides with a sphere.

Kind: instance method of Frustum
Returns: Boolean - True if point is in frustum, false otherwise.

Param Type Description
sphere Sphere Sphere to check.

frustum.collideBox(box) ⇒ Boolean

Check if collide with a box.

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

Param Type Description
box Box Box to check.

frustum.containsPoint(point) ⇒ Boolean

Check if the frustum contains a point.

Kind: instance method of Frustum
Returns: Boolean - True if point is in frustum, false otherwise.

Param Type Description
point Vector3 Vector to check.

frustum.clone() ⇒ Frustum

Clone this frustum.

Kind: instance method of Frustum
Returns: Frustum - Cloned frustum.