Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...
    • Calculates camera clipping planes based on a bounding sphere.

      Uses a sphere instead of a bounding box to avoid discontinuities at box edges/corners. The sphere produces smooth near/far values as the camera moves, eliminating the need for exponential smoothing.

      near uses the nearest view-axis depth on the sphere, floored by nearPlaneFloor — which is what keeps the near/far ratio (and therefore depth-buffer precision) bounded whenever the sphere reaches the camera plane, including when the camera is inside it.

      Parameters

      • sphere: BoundingSphere

        Scene bounding sphere

      • cameraPosition: { x: number; y: number; z: number }

        Camera position in world coordinates

      • viewDirection: { x: number; y: number; z: number }

        Camera forward direction in world coordinates.

      • boundNearFarRatio: boolean = true

        Forwarded to nearPlaneFloor; pass false for an orthographic projection. Defaults to true (perspective).

      Returns { near: number; far: number }

      Near and far clipping plane distances