IFClite TypeScript API
    Preparing search index...
    Index
    • Animate camera to position and target

      Parameters

      • endPos: Vec3
      • endTarget: Vec3
      • Optionalduration: number

      Returns Promise<void>

    • Animate camera to position, target, and up vector (for orthogonal preset views)

      Parameters

      • endPos: Vec3
      • endTarget: Vec3
      • endUp: Vec3
      • Optionalduration: number

      Returns Promise<void>

    • Animate the camera to a FitPolicy pose. Used by the Home button so the transition matches the rest of the navigation tweens.

      Parameters

      Returns Promise<void>

    • Set first-person mode

      Parameters

      • enabled: boolean

      Returns void

    • Convenience: pick + apply the adaptive fit policy for the given bounds in one call. The default behaviour delegates to pickFitPolicy() so callers don't have to thread the FOV through themselves.

      Parameters

      • bounds: Bounds3
      • Optionaloptions: { animate?: boolean; duration?: number; viewportShortPx?: number }

      Returns FitPolicy

    • Fit view to bounding box. Sets camera to southeast isometric view (typical BIM starting view). Y-up coordinate system: Y is vertical

      Parameters

      • min: Vec3
      • max: Vec3

      Returns void

    • Frame selection - zoom to fit bounds while keeping current view direction This is what "Frame Selection" should do - zoom to fill screen

      padding (>= 1) states the margin: the box's projected corners reach 1 / padding of the half-frame on the limiting axis, exactly, in either projection (#7617). Omitted, the fixed default multiple of the fit distance applies.

      Parameters

      • min: Vec3
      • max: Vec3
      • Optionalduration: number
      • Optionalpadding: number

      Returns Promise<void>

    • Frame/center view on a point (keeps current distance and direction) Standard CAD "Frame Selection" behavior

      Parameters

      • point: Vec3
      • Optionalduration: number

      Returns Promise<void>

    • The lens shift the current projection applies: getLensShift in perspective, zero in orthographic.

      Returns { x: number; y: number }

    • The aspect ratio (width / height) the projection is currently built from.

      This is the DRAWING BUFFER's ratio. Since #5383 the buffer is the CSS box scaled by one pixel ratio on both axes, so the two agree up to integer rounding of the buffer (the width used to be floored to a multiple of 64, which made them differ by up to 63 pixels).

      The buffer ratio is the right one for BCF (#3612). A viewpoint's snapshot PNG comes from canvas.toDataURL(), which encodes that same drawing buffer, so the <AspectRatio> written beside it describes the image actually in the archive. It is also the ratio the projection matrix used, so a viewer restoring the camera reproduces the framing.

      Always finite and positive -- setAspect rejects anything else -- which is what BCF 3.0's PositiveDouble schema type requires.

      Returns number

    • Raw pose distance; non-finite source poses remain observable.

      Returns number

    • Get camera FOV in radians

      Returns number

    • The stored lens shift in NDC, as set; a copy.

      Returns { x: number; y: number }

    • The robust orbit-pivot anchor bounds last set via setOrbitAnchorBounds (null if never set / cleared). O(1); safe on the orbit hot path. Returns the live reference; callers must not mutate.

      Returns
          | {
              max: { x: number; y: number; z: number };
              min: { x: number; y: number; z: number };
          }
          | null

    • Get orthographic view half-height

      Returns number

    • Returns Vec3

    • The reverse-Z projection matrix (perspective or orthographic); a copy.

      Returns Mat4

    • Return the shared RTE frame for the current camera state. GPU consumers must use this instead of deriving a second camera rebase.

      Returns RelativeToEyeFrame

    • Returns { azimuth: number; elevation: number }

    • The cached scene bounds last set via setSceneBounds (null if never set). O(1) — does not recompute from geometry, so it is cheap enough to read on the orbit hot path (e.g. anchoring the orbit pivot to the scene centre on large models). Returns the live reference; callers must not mutate.

      Returns
          | {
              max: { x: number; y: number; z: number };
              min: { x: number; y: number; z: number };
          }
          | null

    • Returns Vec3

    • Get camera up vector

      Returns Vec3

    • Whether a timed pose tween (preset view, frame, home) has started and its final pose has not yet been applied by update(). Independent of whether any frame has run since, so it is safe for a host to wait on.

      Returns boolean

    • Move in first-person mode (Y-up coordinate system)

      Parameters

      • forward: number
      • right: number
      • up: number

      Returns void

    • Orbit camera around the current pivot (Y-up coordinate system). If orbitCenter is set, both position and target rotate around it. Otherwise, position rotates around target (standard orbit).

      Parameters

      • deltaX: number
      • deltaY: number
      • OptionaladdVelocity: boolean

      Returns void

    • Pan camera (Y-up coordinate system)

      Parameters

      • deltaX: number
      • deltaY: number
      • OptionaladdVelocity: boolean

      Returns void

    • Project a world position to screen coordinates

      Parameters

      • worldPos: Vec3

        Position in world space

      • canvasWidth: number

        Canvas width in pixels

      • canvasHeight: number

        Canvas height in pixels

      Returns { x: number; y: number } | null

      Screen coordinates { x, y } or null if behind camera

    • Reset camera state (clear orbit center, stop inertia, cancel animations) Called when loading a new model to ensure clean state

      Returns void

    • Set camera aspect ratio

      Parameters

      • aspect: number

      Returns void

    • Widen only the orthographic depth range by this extent (never fitting or pivots); null clears it.

      Parameters

      • bounds:
            | {
                max: { x: number; y: number; z: number };
                min: { x: number; y: number; z: number };
            }
            | null

      Returns void

    • Set camera field of view in radians

      Parameters

      • fov: number

      Returns void

    • Restrict interactive orbit/pan/zoom (embed controls param, #2934).

      Parameters

      Returns void

    • Shift the perspective image by (x, y) in normalised device coordinates without turning the camera, the "shift lens" of architectural photography (issue #8688). A point that would project to NDC p projects to p + (x, y). Keep the camera level and shift vertically for two-point perspective, so world-vertical edges stay vertical on screen: to frame what a camera pitched up by pitch would centre, use y = -tan(pitch) / tan(fov / 2). (0, 0), the default, is the ordinary centred frustum. Orthographic projection ignores the shift (see getActiveLensShift).

      Picking, sections, overlays, AO/edges, the sky and shadows follow the shift. Fit-to-view, BCF viewpoints and the shift itself are independent: a fit still centres the target in the unshifted frustum, and restoring a viewpoint keeps the current shift. Non-finite values and components beyond MAX_LENS_SHIFT are rejected and the previous shift is kept.

      Parameters

      • x: number
      • y: number

      Returns void

    • Set the outlier-robust orbit-pivot anchor bounds (issue #1394), or null to clear it (the pivot then falls back to getSceneBounds). The renderer never touches this, so it survives the per-upload setSceneBounds syncs that keep sceneBounds pinned to the full model AABB.

      Parameters

      • bounds:
            | {
                max: { x: number; y: number; z: number };
                min: { x: number; y: number; z: number };
            }
            | null

      Returns void

    • Set the orbit center without moving the camera. Future orbit() calls will rotate around this point. Pass null to revert to orbiting around camera.target.

      Parameters

      • center: Vec3 | null

      Returns void

    • Set orthographic view half-height

      Parameters

      • size: number

      Returns void

    • Set camera position

      Parameters

      • x: number
      • y: number
      • z: number

      Returns void

    • Diagonal preset for a ViewCube edge or corner. direction is the camera's offset from the model in the named presets' face frame (+X right, +Y top, +Z front), e.g. {x:1,y:1,z:0} is the top-right edge.

      Parameters

      • direction: Vec3
      • Optionalbounds: { max: Vec3; min: Vec3 }
      • OptionalbuildingRotation: number

      Returns void

    • Set preset view with explicit bounds (Y-up coordinate system) Clicking the same view again rotates 90 degrees around the view axis

      Parameters

      • view: "top" | "bottom" | "front" | "back" | "left" | "right"
      • Optionalbounds: { max: Vec3; min: Vec3 }
      • OptionalbuildingRotation: number

        Optional building rotation in radians (from IfcSite placement)

      Returns void

    • Set projection mode (perspective or orthographic) When switching to orthographic, calculates initial orthoSize from current view.

      Parameters

      Returns void

    • Parameters

      • azimuth: number
      • elevation: number

      Returns void

    • Set scene bounds for tight orthographic near/far plane computation. Call this when geometry is loaded or changed.

      Parameters

      • bounds:
            | {
                max: { x: number; y: number; z: number };
                min: { x: number; y: number; z: number };
            }
            | null

      Returns void

    • Set camera target

      Parameters

      • x: number
      • y: number
      • z: number

      Returns void

    • Set camera up vector

      Parameters

      • x: number
      • y: number
      • z: number

      Returns void

    • Apply a FitPolicy snapshot to the camera without animation. Used by the post-load auto-fit where any in-flight tween would compete with the streaming-complete frame and produce a visible camera jump.

      Parameters

      Returns void

    • Reset velocity (stop inertia)

      Returns void

    • Toggle between perspective and orthographic projection

      Returns void

    • Unproject screen coordinates to a ray in world space

      Parameters

      • screenX: number

        X position in screen coordinates

      • screenY: number

        Y position in screen coordinates

      • canvasWidth: number

        Canvas width in pixels

      • canvasHeight: number

        Canvas height in pixels

      Returns { direction: Vec3; origin: Vec3 }

      Ray origin and direction in world space

    • Update camera animation and inertia Returns true if camera is still animating

      Parameters

      • deltaTime: number

      Returns boolean

    • Zoom camera towards mouse position

      Parameters

      • delta: number

        Zoom delta (positive = zoom out, negative = zoom in)

      • OptionaladdVelocity: boolean

        Whether to add velocity for inertia

      • OptionalmouseX: number

        Mouse X position in canvas coordinates

      • OptionalmouseY: number

        Mouse Y position in canvas coordinates

      • OptionalcanvasWidth: number

        Canvas width

      • OptionalcanvasHeight: number

        Canvas height

      • OptionalfastZoom: boolean

        Pure dolly (Shift / Cesium): the full step translates the rig

      • OptionalsurfacePoint: Vec3

        World point on the visible surface under the cursor (#5393). Zooming IN approaches it and stops short of it; it is ignored for zoom-out, fast zoom and orthographic. The surface step applies no inertia, so addVelocity has no effect on it.

      Returns void

    • Parameters

      • min: Vec3
      • max: Vec3
      • Optionalduration: number

      Returns Promise<void>