Used to check if a ProjectedObject3D is currently contained inside a DOM bounding rectangle.

Uses a model view projection matrix that contains both useful Object3D transforms and Camera projection information. The DOM bounding rectangle to check against usually is the renderer's DOMElement bounding rectangle, unless frustum margins are specified.

Constructors

Properties

boundingBox: Box3

Our 3D Object bounding box, i.e. size in world space before any transform. Usually defined by a Geometry

clipSpaceOBB: Box3

Oriented bounding Box3 in clip space.

modelViewProjectionMatrix: Mat4

A model view projection matrix defining transformations, usually from a ProjectedObject3D, to use for frustum calculations

containerBoundingRect: DOMElementBoundingRect

The DOM bounding rectangle to check against, usually the renderer DOM Element bounding rectangle

DOMFrustumMargins: RectCoords

Additional margins to add to containerBoundingRect

clipSpaceBoundingRect: RectBBox

Computed rectangle in clip space/normalized device coordinates.

projectedBoundingRect: DOMElementBoundingRect

A DOM Element bounding rectangle representing the result of our boundingBox with the modelViewProjectionMatrix applied

onReEnterView: (() => void)

Callback to run when the projectedBoundingRect reenters the view frustum

Type declaration

onLeaveView: (() => void)

Callback to run when the projectedBoundingRect leaves the view frustum

Type declaration

isIntersecting: boolean

Flag to indicate whether the given projectedBoundingRect is intersecting our view frustum

Accessors

Methods

  • Apply the bounding sphere in clip space to document coordinates and set projectedBoundingRect.

    Parameters

    • boundingSphere: {
          center: Vec3;
          radius: number;
      } = ...

      bounding sphere in clip space.

      • center: Vec3
      • radius: number

    Returns void