Type Alias FitCameraOptions

FitCameraOptions: {
    autoApply?: boolean;
    camera?: Camera;
    cameraNearFar?: "keep" | "auto";
    cameraOffset?: Partial<Vector3Like>;
    centerCamera?: "none" | "y";
    context?: Context;
    currentZoom?: number;
    debug?: boolean;
    fitDirection?: Vector3Like;
    fitOffset?: number;
    fov?: number;
    maxZoom?: number;
    minZoom?: number;
    objects?: Object3D[] | Object3D;
    relativeCameraOffset?: Partial<Vector3Like>;
    relativeTargetOffset?: Partial<Vector3Like>;
    targetOffset?: Partial<Vector3Like>;
}

Options for fitting the camera to the scene. Used in OrbitControls.fitCamera

Type declaration

  • OptionalautoApply?: boolean

    If true the camera position and target will be applied immediately

    true
    
  • Optionalcamera?: Camera

    The camera to fit. If not provided the current camera will be used

  • OptionalcameraNearFar?: "keep" | "auto"

    Set to 'auto' to update the camera near or far plane based on the fitted-objects bounds

  • OptionalcameraOffset?: Partial<Vector3Like>

    Offset the camera position in world space

  • OptionalcenterCamera?: "none" | "y"

    If set to "y" the camera will be centered in the y axis

  • Optionalcontext?: Context

    The context to use. If not provided the current context will be used

  • OptionalcurrentZoom?: number
  • Optionaldebug?: boolean

    When enabled debug rendering will be shown

  • OptionalfitDirection?: Vector3Like

    The direction from which the camera should be fitted in worldspace. If not defined the current camera's position will be used

  • OptionalfitOffset?: number

    Fit offset: A factor to multiply the distance to the objects by

    1.1
    
  • Optionalfov?: number

    Field of view (FOV) for the camera

  • OptionalmaxZoom?: number
  • OptionalminZoom?: number
  • Optionalobjects?: Object3D[] | Object3D

    The objects to fit the camera to. If not provided the scene children will be used

  • OptionalrelativeCameraOffset?: Partial<Vector3Like>

    Offset the camera position relative to the size of the objects being focused on (e.g. x: 0.5).
    Value range: -1 to 1

  • OptionalrelativeTargetOffset?: Partial<Vector3Like>

    Offset the camera target position relative to the size of the objects being focused on.
    Value range: -1 to 1

  • OptionaltargetOffset?: Partial<Vector3Like>

    Offset the camera target position in world space