Luxar Viewer API Documentation - v2026.9.22
    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 is the nearest point on the sphere surface, floored by nearPlaneFloor — which is what keeps the near/far ratio (and therefore depth-buffer precision) bounded once the camera moves INSIDE the sphere, the regime where the bare surface distance goes to zero.

      Parameters

      • sphere: BoundingSphere

        Scene bounding sphere

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

        Camera position 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