Overview
Developer Guide
Basics
3D Math
Geospatial Math
API Reference
@math.gl/culling
@math.gl/geoid
@math.gl/geospatial
@math.gl/proj4
@math.gl/sun
@math.gl/web-mercator
Concepts

# CullingVolume

A culling volume defined by planes.

## Static Members

For plane masks (as used in `CullingVolume#computeVisibilityWithPlaneMask`), this special value represents the case where the object bounding volume is entirely outside the culling volume.

For plane masks (as used in `CullingVolume.computeVisibilityWithPlaneMask`), this value represents the case where the object bounding volume is entirely inside the culling volume.

For plane masks (as used in`CullingVolume.computeVisibilityWithPlaneMask`), this value represents the case where the object bounding volume (may) intersect all planes of the culling volume.

## Methods

### constructor([planes : Plane[]])

• `planes`=`[]` An array of clipping planes.

Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin.

### fromBoundingSphere(boundingSphere : BoundingSphere)

Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere. The planes are aligned to the x, y, and z axes in world coordinates.

• `boundingSphere` The bounding sphere used to create the culling volume.

### computeVisibility(boundingVolume : Object) : Interset

Determines whether a bounding volume intersects the culling volume.

• `boundingVolume` The bounding volume whose intersection with the culling volume is to be tested.

Returns

• `INTERSECTION.OUTSIDE`, `INTERSECTION.INTERSECTING`, or `INTERSECTION.INSIDE`.

• `boundingVolume` The bounding volume whose intersection with the culling volume is to be tested.
• `parentPlaneMask` A bit mask from the boundingVolume's parent's check against the same culling volume, such that if `planeMask & (1 << planeIndex) === 0`, for `k < 31`, then the parent (and therefore this) volume is completely inside `plane[planeIndex]` and that plane check can be skipped.