Skip to main content

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.

This class is mainly intended for use internally by a renderer for calculating a camera or shadowCamera's frustum.

Constructor

Frustum

function Frustum( p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5:
Plane ): void;

p0 - (optional) defaults to a new Plane.
p1 - (optional) defaults to a new Plane.
p2 - (optional) defaults to a new Plane.
p3 - (optional) defaults to a new Plane.
p4 - (optional) defaults to a new Plane.
p5 - (optional) defaults to a new Plane.

Creates a new Frustum.

Properties

planes

planes: Array;  

Array of 6 planes.

Methods

clone

function clone( ): Frustum;  

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

containsPoint

function containsPoint( point: Vector3 ): Boolean;  

point - Vector3 to test.

Checks to see if the frustum contains the point.

copy

function copy( frustum: Frustum ): this;  

frustum - The frustum to copy

Copies the properties of the passed frustum into this one.

intersectsBox

function intersectsBox( box: Box3 ): Boolean;  

box - Box3 to check for intersection.

Return true if box intersects with this frustum.

intersectsObject

function intersectsObject( object: Object3D ): Boolean;  

Checks whether the object's bounding sphere is intersecting the Frustum.

Note that the object must have a geometry so that the bounding sphere can be calculated.

intersectsSphere

function intersectsSphere( sphere: Sphere ): Boolean;  

sphere - Sphere to check for intersection.

Return true if sphere intersects with this frustum.

intersectsSprite

function intersectsSprite( sprite: Sprite ): Boolean;  

Checks whether the sprite is intersecting the Frustum.

set

function set( p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane
): this;

Sets the frustum from the passed planes. No plane order is implied.
Note that this method only copies the values from the given objects.

setFromProjectionMatrix

function setFromProjectionMatrix( matrix: Matrix4 ): this;  

.atrix4 - Projection Matrix4 used to set the .planes

Sets the frustum planes from the projection matrix.

Source

src/math/Frustum.js