ThreePipe
    Preparing search index...

    Interface ICamera<TE>

    interface ICamera<TE extends ICameraEventMap = ICameraEventMap> {
        __objExtUiConfigs?: Record<
            string,
            | undefined
            | (
                | UiObjectConfig<any, string, any>
                | Fof<ValOrArrOp<UiObjectConfig<any, string, any>>>
            )[],
        >;
        _canvas?: HTMLCanvasElement;
        _currentGeometry?:
            | null
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        _currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        _customDepthMaterial?: Material<MaterialEventMap>;
        _customGBufferMaterial?: Material<MaterialEventMap>;
        _customNormalMaterial?: Material<MaterialEventMap>;
        _loadingPromise?: Promise<void>;
        _onGeometryUpdate?: EventListener2<
            "geometryUpdate",
            BufferGeometryEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
        >;
        _positionWorld: Vector3;
        _rootPathRefreshed?: boolean;
        _rootPathRefreshing?: boolean;
        _sChildren?: Object3D<Object3DEventMap>[];
        acceptChildEvents?: boolean;
        aspect: number;
        assetType: "camera";
        autoAspect: boolean;
        autoNearFar: boolean;
        autoUpgradeChildren?: boolean;
        boundingBox?: null | Box3;
        boundingSphere?: null | Sphere;
        cameraObject: ICamera<TE>;
        canUserInteract: boolean;
        children: IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >[];
        controls: undefined | ICameraControls<ICameraControlsEventMap>;
        controlsMode?: string;
        currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        customGBufferMaterial?: Material<MaterialEventMap>;
        customNormalMaterial?: Material<MaterialEventMap>;
        far: number;
        forcedOverrideMaterial?: Material<MaterialEventMap>;
        fov?: number;
        geometry?: undefined;
        interactionsEnabled: boolean;
        isActiveCamera: boolean;
        isCamera: true;
        isLight?: boolean;
        isLine?: boolean;
        isLine2?: boolean;
        isLineSegments?: boolean;
        isLineSegments2?: boolean;
        isMainCamera: boolean;
        isMesh?: boolean;
        isMeshLine?: boolean;
        isOrthographicCamera?: boolean;
        isPerspectiveCamera?: boolean;
        isPoints?: boolean;
        isScene?: boolean;
        isWidget?: boolean;
        material?: undefined;
        materials?: IMaterial<IMaterialEventMap>[];
        maxFarPlane: number;
        minNearPlane: number;
        modelObject: ICamera<TE>;
        morphTargetDictionary?: Record<string, number>;
        morphTargetInfluences?: number[];
        near: number;
        objectExtensions?: IObjectExtension[];
        objectProcessor?: IObjectProcessor;
        parent:
            | null
            | IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >;
        parentRoot?:
            | null
            | IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >;
        position: Vector3;
        target: Vector3;
        uiConfig?: UiObjectConfig<any, string, any>;
        userData: ICameraUserData;
        zoom: number;
        activateMain(
            options?: Omit<
                {
                    bubbleToParent: boolean;
                    camera?: null
                    | ICamera<ICameraEventMap>;
                    ui?: boolean;
                },
                "bubbleToParent",
            >,
            _internal?: boolean,
            _refresh?: boolean,
        ): void;
        add(
            ...object: IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >[],
        ): this;
        autoCenter(setDirty?: boolean, undo?: boolean): this;
        autoScale(
            autoScaleRadius?: number,
            isCentered?: boolean,
            setDirty?: boolean,
            undo?: boolean,
        ): this;
        clone(recursive?: boolean): this;
        computeBoundingBox(): void;
        computeBoundingSphere(): void;
        computeLineDistances(): void;
        copy(
            source: ICamera<ICameraEventMap> | Camera<Object3DEventMap>,
            recursive?: boolean,
            distanceFromTarget?: number,
            worldSpace?: boolean,
            ...args: any[],
        ): this;
        deactivateMain(
            options?: Omit<
                {
                    bubbleToParent: boolean;
                    camera?: null
                    | ICamera<ICameraEventMap>;
                    ui?: boolean;
                },
                "bubbleToParent",
            >,
            _internal?: boolean,
            _refresh?: boolean,
        ): void;
        dispose(removeFromParent?: boolean): void;
        getObjectById<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            id: number,
        ): undefined | T;
        getObjectByName<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            name: string,
        ): undefined | T;
        getObjectByProperty<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            name: string,
            value: string,
        ): undefined | T;
        getView<T extends ICameraView = CameraView>(
            worldSpace?: boolean,
            cameraView?: T,
        ): T;
        pivotToBoundsCenter(setDirty?: boolean): () => void;
        pivotToPoint(point: Vector3, setDirty?: boolean): this;
        refreshAspect(setDirty?: boolean): void;
        refreshCameraControls(setDirty?: boolean): void;
        refreshFrustum(setDirty?: boolean): void;
        refreshTarget(): void;
        refreshUi(): void;
        remove(
            ...object: IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >[],
        ): this;
        removeControlsCtor(key: string): void;
        setCanvas(canvas: undefined | HTMLCanvasElement, refresh?: boolean): void;
        setControlsCtor(key: string, ctor: TControlsCtor, replace?: boolean): void;
        setDirty(options?: IObjectSetDirtyOptions): void;
        setInteractions(enabled: boolean, by: string, setDirty?: boolean): void;
        setView(view: ICameraView): void;
        setViewFromCamera(
            camera: ICamera<ICameraEventMap> | Camera<Object3DEventMap>,
            distanceFromTarget?: number,
            worldSpace?: boolean,
        ): void;
        setViewToMain(eventOptions: Pick<ICameraEventMap["setView"], "ui">): void;
        traverse(callback: (object: IObject3D) => void): void;
        traverseAncestors(callback: (object: IObject3D) => void): void;
        traverseModels(
            callback: (object: IObject3D) => boolean | void,
            options: { visible: boolean; widgets: boolean; [key: string]: any },
        ): void;
        traverseVisible(callback: (object: IObject3D) => void): void;
        updateMorphTargets(): void;
        updateProjectionMatrix(): void;
        updateShaderProperties(
            material: {
                defines: Record<string, string | number | undefined>;
                uniforms: { [name: string]: IUniform<any> };
            },
        ): this;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    __objExtUiConfigs?: Record<
        string,
        | undefined
        | (
            | UiObjectConfig<any, string, any>
            | Fof<ValOrArrOp<UiObjectConfig<any, string, any>>>
        )[],
    >
    _canvas?: HTMLCanvasElement

    reference to the canvas element used for rendering. (for aspect ratio, etc.)

    _currentGeometry?:
        | null
        | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
    _currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    _customDepthMaterial?: Material<MaterialEventMap>
    • store for the actual customDepthMaterial
    _customGBufferMaterial?: Material<MaterialEventMap>
    • store for the actual customGBufferMaterial
    _customNormalMaterial?: Material<MaterialEventMap>
    • store for the actual customNormalMaterial
    _loadingPromise?: Promise<void>

    A promise can be set by the object to indicate that the object is loading. This can be used by the scene, viewer, plugins to defer actions until the object is loaded.

    _onGeometryUpdate?: EventListener2<
        "geometryUpdate",
        BufferGeometryEventMap,
        IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
    >
    • for embedded objects
    _positionWorld: Vector3

    world position cache for shader updates and other purposes

    _rootPathRefreshed?: boolean
    • for embedded objects
    _rootPathRefreshing?: boolean
    • when embedded objects are loading
    _sChildren?: Object3D<Object3DEventMap>[]
    • for embedded objects
    acceptChildEvents?: boolean

    Set to false to disable propagation of any events from its children.

    aspect: number

    Camera frustum aspect ratio, window width divided by window height. It can be managed internally if autoAspect is true.

    1
    
    assetType: "camera"
    autoAspect: boolean

    Automatically manage aspect ratio based on window/canvas size.

    autoNearFar: boolean
    autoUpgradeChildren?: boolean

    Set to false to disable automatic call of upgradeObject3D when a child is added.

    boundingBox?: null | Box3

    For InstancedMesh, SkinnedMesh etc

    boundingSphere?: null | Sphere

    For InstancedMesh, SkinnedMesh etc

    cameraObject: ICamera<TE>

    use this instead

    canUserInteract: boolean

    Check whether user can interact with this camera. Interactions can be enabled/disabled in a variety of ways, like setInteractions, controlsMode, isMainCamera property

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    controlsMode?: string
    currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    customGBufferMaterial?: Material<MaterialEventMap>

    Required for plugins like GBufferPlugin

    customNormalMaterial?: Material<MaterialEventMap>

    Required for plugins like NormalBufferPlugin

    far: number

    Automatically managed when autoNearFar is true. See also maxFarPlane

    forcedOverrideMaterial?: Material<MaterialEventMap>

    If this is set, it will be returned when accessing material property. see GBufferRenderPass for sample usage

    fov?: number
    geometry?: undefined
    interactionsEnabled: boolean

    If interactions are enabled for this camera. It can be disabled by some code or plugin. see also setInteractions

    use canUserInteract to check if the user can interact with this camera

    isActiveCamera: boolean

    use isMainCamera instead

    isCamera: true

    Read-only flag to check if a given object is of type Camera.

    This is a constant value

    true

    isLight?: boolean
    isLine?: boolean
    isLine2?: boolean
    isLineSegments?: boolean
    isLineSegments2?: boolean
    isMainCamera: boolean
    isMesh?: boolean
    isMeshLine?: boolean
    isOrthographicCamera?: boolean
    isPerspectiveCamera?: boolean
    isPoints?: boolean
    isScene?: boolean
    isWidget?: boolean
    material?: undefined

    Same as material but always returns an array. To set, just set material property

    maxFarPlane: number
    minNearPlane: number
    modelObject: ICamera<TE>

    use object directly

    morphTargetDictionary?: Record<string, number>
    morphTargetInfluences?: number[]
    near: number

    Automatically managed when autoNearFar is true. See also minNearPlane

    objectExtensions?: IObjectExtension[]
    objectProcessor?: IObjectProcessor
    parent:
        | null
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Object's parent in the scene graph.

    An object can have at most one parent.

    null

    parentRoot?:
        | null
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Parent/Ancestor of this object to bubble events to. This is set internally by setupObject3D.

    position: Vector3

    Local position of camera.

    target: Vector3

    Target of camera, in world(global) coordinates.

    uiConfig?: UiObjectConfig<any, string, any>
    userData: ICameraUserData

    An object that can be used to store custom data about the Object3D.

    It should not hold references to functions as these will not be cloned.

    {}

    zoom: number

    Methods

    • Parameters

      • Optionaloptions: Omit<
            {
                bubbleToParent: boolean;
                camera?: null
                | ICamera<ICameraEventMap>;
                ui?: boolean;
            },
            "bubbleToParent",
        >
      • Optional_internal: boolean
      • Optional_refresh: boolean

      Returns void

    • Moves the bounding box center of the object to the center of the world

      Parameters

      • OptionalsetDirty: boolean

        calls setDirty

      • Optionalundo: boolean

        undo any previous autoCenter operation

      Returns this

      true
      
    • Scales the object to fit the given radius.

      Parameters

      • OptionalautoScaleRadius: number

        optional (taken from userData.autoScaleRadius by default)

      • OptionalisCentered: boolean

        optional (taken from userData.isCentered by default)

      • OptionalsetDirty: boolean

        true by default

      • Optionalundo: boolean

        undo any previous autoScale operation

      Returns this

    • Returns a clone of this object and optionally all descendants.

      Parameters

      • Optionalrecursive: boolean

        If true, descendants of the object are also cloned. Default true

      Returns this

    • For InstancedMesh, SkinnedMesh etc Computes bounding box, updating .boundingBox attribute.

      Returns void

      Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.

    • Parameters

      • Optionaloptions: Omit<
            {
                bubbleToParent: boolean;
                camera?: null
                | ICamera<ICameraEventMap>;
                ui?: boolean;
            },
            "bubbleToParent",
        >
      • Optional_internal: boolean
      • Optional_refresh: boolean

      Returns void

    • Parameters

      • OptionalremoveFromParent: boolean

        remove from parent. Default true

      Returns void

    • Moves the object pivot to the center of the bounding box.

      The object will rotate around the new pivot.

      Parameters

      • OptionalsetDirty: boolean

        calls setDirty

      Returns () => void

      undo function

      true
      
    • Moves the object pivot to the given point

      The object will rotate around the new pivot.

      Parameters

      • point: Vector3

        point to move the pivot to

      • OptionalsetDirty: boolean

        calls setDirty

      Returns this

      undo function

      true
      
    • Parameters

      • OptionalsetDirty: boolean

      Returns void

    • Parameters

      • OptionalsetDirty: boolean

      Returns void

    • Refresh the camera frustum planes from frustumSize. Only for orthographic cameras.

      Parameters

      • OptionalsetDirty: boolean

      Returns void

    • Set the canvas which is used as dom element in controls, etc. This is done by the viewer/scene when main camera is changed

      Parameters

      • canvas: undefined | HTMLCanvasElement
      • Optionalrefresh: boolean

      Returns void

    • Parameters

      • enabled: boolean
      • by: string
      • OptionalsetDirty: boolean

      Returns void

    • Executes the callback on this object and all descendants.

      Parameters

      • callback: (object: IObject3D) => void

        A function with as first argument an Object3D object.

      Returns void

      Note: Modifying the scene graph inside the callback is discouraged.

    • Traverse only upgraded objects with extra options

      Parameters

      • callback: (object: IObject3D) => boolean | void
      • options: { visible: boolean; widgets: boolean; [key: string]: any }

      Returns void

    • Like traverse, but the callback will only be executed for visible objects

      Parameters

      • callback: (object: IObject3D) => void

        A function with as first argument an Object3D object.

      Returns void

      Descendants of invisible objects are not traversed.