Frustum

Frustums are used to determine what is inside the camera's field of view. They help speed up the rendering process - objects which lie outside a camera's frustum can safely be excluded from rendering.

Constructor

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

Parameters:
NameTypeDescription
p0Plane

(optional) defaults to a new Plane.

p1Plane

(optional) defaults to a new Plane.

p2Plane

(optional) defaults to a new Plane.

p3Plane

(optional) defaults to a new Plane.

p4Plane

(optional) defaults to a new Plane.

p5Plane

(optional) defaults to a new Plane.

Methods

applyMatrix4(matrix) → {Frustum}

Apply a matrix4x4 to the frustum.

Parameters:
NameTypeDescription
matrixMatrix4

Matrix4 to apply to the frustum.

Returns:
Type: 
Frustum

clone() → {Frustum}

Return a new Frustum with the same parameters as this one.

Returns:
Type: 
Frustum

copy(frustum) → {Frustum}

Copies the properties of the passed frustum into this one.

Parameters:
NameTypeDescription
frustumFrustum

The frustum to copy

Returns:
Type: 
Frustum

intersectsBox(box) → {boolean}

Return true if box intersects with this frustum.

Parameters:
NameTypeDescription
boxBox3

Box3 to check for intersection.

Returns:
Type: 
boolean

intersectsSphere(sphere) → {boolean}

Return true if sphere intersects with this frustum.

Parameters:
NameTypeDescription
sphereSphere

Sphere to check for intersection.

Returns:
Type: 
boolean

set(p0, p1, p2, p3, p4, p5) → {Frustum}

Sets the frustum from the passed planes. No plane order is implied.

Parameters:
NameTypeDescription
p0Plane

(optional) defaults to a new Plane.

p1Plane

(optional) defaults to a new Plane.

p2Plane

(optional) defaults to a new Plane.

p3Plane

(optional) defaults to a new Plane.

p4Plane

(optional) defaults to a new Plane.

p5Plane

(optional) defaults to a new Plane.

Returns:
Type: 
Frustum

setFromMatrix(m) → {Frustum}

Sets the frustum planes from the matrix.

Parameters:
NameTypeDescription
mMatrix4

a Matrix4 used to set the planes

Returns:
Type: 
Frustum