Skip to main content

CullingVolume

From v3.0

A culling volume defined by planes.

Static Membersโ€‹

CullingVolume.MASK_OUTSIDEโ€‹

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.

CullingVolume.MASK_INSIDEโ€‹

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

CullingVolume.MASK_INDETERMINATEโ€‹

For plane masks (as used inCullingVolume.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 entry is a Plane with a normalized inward-facing normal and signed distance. The plane equation is dot(normal, position) + distance = 0; the nonnegative side is inside.

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) : CullingResultโ€‹

Determines whether a bounding volume intersects the culling volume.

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

Returns

  • 'outside', 'intersecting', or 'inside'.

computeVisibilityWithPlaneMask(boundingVolume : Object, parentPlaneMask : Number) : Numberโ€‹

Determines whether a bounding volume intersects the culling volume.

  • 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.

Returns

  • A plane mask as described above (which can be applied to this boundingVolume's children).

Attributionโ€‹

This class was ported from Cesium under the Apache 2 License.

See Attributions for the project-wide source inventory and acknowledgments.