Skip to content

Class: FrustumCuller

FrustumCuller is used to cull shapes that are outside of another shape (not colliding) - used in rendering to avoid unneccesary rendering.

Implements

Table of contents

Constructors

Methods

Constructors

constructor

+ new FrustumCuller(collisionAlgorithm?: ICollisionAlgorithm): FrustumCuller

Parameters:

Name Type
collisionAlgorithm ICollisionAlgorithm

Returns: FrustumCuller

Methods

Cull

Cull(frustumPlaneShape: IShape, shape: IShape): boolean

Cull determines if a shape is within a frustum (defined by another shape). Returns false if the shape is within the frustum and it should not be culled, returns true if the shape is outside of the frustum and should be culled.

Parameters:

Name Type Description
frustumPlaneShape IShape Shape of the frustum (view/camera)
shape IShape Shape to check if it is within the frustum

Returns: boolean

Implementation of: IFrustumCuller