Interface ICamera<E, ET>

interface ICamera<E, ET> {
    _currentGeometry?: null | IGeometry<NormalBufferAttributes>;
    _currentMaterial?: null | IMaterial<IMaterialEvent<IMaterialEventTypes>, IMaterialEventTypes> | IMaterial<IMaterialEvent<IMaterialEventTypes>, IMaterialEventTypes>[];
    _onGeometryUpdate?: ((e) => void);
    aspect: number;
    assetType: "camera";
    autoAspect: boolean;
    autoNearFar: boolean;
    cameraObject: ICamera<E, ET>;
    canUserInteract: boolean;
    children: IObject3D<IObject3DEvent<IObject3DEventTypes>, IObject3DEventTypes>[];
    controls: undefined | ICameraControls<string>;
    controlsMode?: string;
    far: number;
    fov?: number;
    geometry?: IGeometry<NormalBufferAttributes>;
    interactionsEnabled: boolean;
    isActiveCamera: boolean;
    isCamera: true;
    isLight?: boolean;
    isLine?: boolean;
    isLineSegments?: boolean;
    isMainCamera: boolean;
    isMesh?: boolean;
    isOrthographicCamera?: boolean;
    isPerspectiveCamera?: boolean;
    isScene?: boolean;
    isWidget?: boolean;
    material?: IMaterial<IMaterialEvent<IMaterialEventTypes>, IMaterialEventTypes> | IMaterial<IMaterialEvent<IMaterialEventTypes>, IMaterialEventTypes>[];
    materials?: IMaterial<IMaterialEvent<IMaterialEventTypes>, IMaterialEventTypes>[];
    maxFarPlane: number;
    minNearPlane: number;
    modelObject: ICamera<E, ET>;
    morphTargetDictionary?: Record<string, number>;
    morphTargetInfluences?: number[];
    near: number;
    objectProcessor?: IObjectProcessor;
    parent: null | IObject3D<IObject3DEvent<IObject3DEventTypes>, IObject3DEventTypes>;
    parentRoot?: null | IObject3D<IObject3DEvent<IObject3DEventTypes>, IObject3DEventTypes>;
    position: Vector3;
    target: Vector3;
    uiConfig?: UiObjectConfig<any, string, any>;
    userData: ICameraUserData;
    zoom: number;
    activateMain(options?, _internal?, _refresh?): void;
    add(...object): this;
    autoCenter?(setDirty?): this;
    autoScale?(autoScaleRadius?, isCentered?, setDirty?): this;
    clone(recursive?): this;
    copy(source, recursive?, distanceFromTarget?, worldSpace?, ...args): this;
    deactivateMain(options?, _internal?, _refresh?): void;
    dispose(removeFromParent?): void;
    getObjectById<T>(id): undefined | T;
    getObjectByName<T>(name): undefined | T;
    getObjectByProperty<T>(name, value): undefined | T;
    getView<T>(worldSpace?, cameraView?): T;
    refreshAspect(setDirty?): void;
    refreshCameraControls(setDirty?): void;
    refreshTarget(): void;
    refreshUi(): void;
    remove(...object): this;
    removeControlsCtor(key): void;
    setControlsCtor(key, ctor, replace?): void;
    setDirty(options?): void;
    setInteractions(enabled, by): void;
    setView(view): void;
    setViewFromCamera(camera, distanceFromTarget?, worldSpace?): void;
    setViewToMain(eventOptions): void;
    traverse(callback): void;
    traverseAncestors(callback): void;
    traverseVisible(callback): void;
    updateMorphTargets?(): void;
    updateProjectionMatrix(): void;
    updateShaderProperties(material): this;
}

Type Parameters

Hierarchy (view full)

Implemented by

Properties

_currentGeometry?: null | IGeometry<NormalBufferAttributes>
_onGeometryUpdate?: ((e) => void)

Type declaration

aspect: number

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

Default

1
assetType: "camera"
autoAspect: boolean

Automatically manage aspect ratio based on window/canvas size.

autoNearFar: boolean
cameraObject: ICamera<E, ET>

Deprecated

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

controls: undefined | ICameraControls<string>
controlsMode?: string
far: number

Automatically managed when autoNearFar is true. See also maxFarPlane

fov?: number
interactionsEnabled: boolean
isActiveCamera: boolean

Deprecated

use isMainCamera instead

isCamera: true
isLight?: boolean
isLine?: boolean
isLineSegments?: boolean
isMainCamera: boolean
isMesh?: boolean
isOrthographicCamera?: boolean
isPerspectiveCamera?: boolean
isScene?: boolean
isWidget?: boolean

Same as material but always returns an array.

maxFarPlane: number
minNearPlane: number
modelObject: ICamera<E, ET>

Deprecated

use object directly

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

Automatically managed when autoNearFar is true. See also minNearPlane

objectProcessor?: IObjectProcessor

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
zoom: number

Methods

  • Parameters

    • Optional options: Partial<ICameraEvent>
    • Optional _internal: boolean
    • Optional _refresh: boolean

    Returns void

  • Parameters

    • Optional autoScaleRadius: number

      optional (taken from userData.autoScaleRadius by default)

    • Optional isCentered: boolean

      optional (taken from userData.isCentered by default)

    • Optional setDirty: boolean

      true by default

    Returns this

  • Parameters

    • source: this
    • Optional recursive: boolean
    • Optional distanceFromTarget: number
    • Optional worldSpace: boolean
    • Rest ...args: any[]

    Returns this

  • Parameters

    • Optional options: Partial<ICameraEvent>
    • Optional _internal: boolean
    • Optional _refresh: boolean

    Returns void

  • Parameters

    • Optional setDirty: boolean

    Returns void

  • Parameters

    • Optional setDirty: boolean

    Returns void

  • Parameters

    • enabled: boolean
    • by: string

    Returns void

  • Dispatches the setView event which triggers the main camera to set its view to this camera's view.

    Parameters

    Returns void

Generated using TypeDoc