• Fit the camera to the specified objects or the whole scene.
    Adjusts the camera position and optionally the FOV to ensure all objects are visible.

    Parameters

    Returns null | FitCameraReturnType

    import { fitCamera } from '@needle-tools/engine';

    // Fit the main camera to the entire scene
    fitCamera();
    import { fitCamera } from '@needle-tools/engine';

    // Fit a specific camera to specific objects with custom options
    const myCamera = ...; // your camera
    const objectsToFit = [...]; // array of objects to fit
    fitCamera({
    camera: myCamera,
    objects: objectsToFit,
    fitOffset: 1,
    fov: 20,
    });