Class PerspectiveCamera0

Empty class with the constructor same as PerspectiveCamera in three.js. This can be used to remain compatible with three.js construct signature.

Hierarchy (View Summary)

Constructors

Properties

activateMain: (
    this: ICamera,
    options?: Partial<ICameraEvent>,
    _internal?: boolean,
    _refresh?: boolean,
) => void = iCameraCommons.activateMain
add: (...object: IObject3D[]) => this

Adds another Object3D as child of this Object3D.

An arbitrary number of objects may be added

assetType: "camera" = ...
autoAspect: boolean

Automatically manage aspect ratio based on window/canvas size. Defaults to true if domElement(canvas) is set.

autoLookAtTarget: boolean = false

Automatically make the camera look at the target on setDirty call Defaults to false. Note that this must be set to true to make the camera look at the target without any controls

autoNearFar: boolean = true

Automatically manage near and far clipping planes based on scene size.

children: IObject3D[]

Array with object's children.

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

[]

clone: (recursive?: boolean) => this

Returns a clone of this object and optionally all descendants.

Type declaration

    • (recursive?: boolean): this
    • Parameters

      • Optionalrecursive: boolean

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

      Returns this

controlsMode: string
copy: (
    source: Camera | IObject3D | ICamera,
    recursive?: boolean,
    distanceFromTarget?: number,
    worldSpace?: boolean,
) => this

Copy the given object into this object

Type declaration

    • (
          source: Camera | IObject3D | ICamera,
          recursive?: boolean,
          distanceFromTarget?: number,
          worldSpace?: boolean,
      ): this
    • Parameters

      • source: Camera | IObject3D | ICamera
      • Optionalrecursive: boolean

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

      • OptionaldistanceFromTarget: number
      • OptionalworldSpace: boolean

      Returns this

Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

deactivateMain: (
    this: ICamera,
    options?: Partial<ICameraEvent>,
    _internal?: boolean,
    _refresh?: boolean,
) => void = iCameraCommons.deactivateMain
dispatchEvent: (event: ICameraEvent) => void

Fire an event type.

Type declaration

dollyFov: boolean = false

Automatically move the camera(dolly) when the field of view(fov) changes. Works when controls are enabled or autoLookAtTarget is true.

Note - this is not exact

far: number = 50

Far clipping plane. This is managed by RootScene for active cameras To change the maximum that's possible set maxFarPlane To use a fixed value set autoNearFar to false and set maxFarPlane

focus: number

Object distance used for stereoscopy and depth-of-field effects.

This parameter does not influence the projection matrix unless a StereoCamera is being used.

10

fov: number

Camera frustum vertical field of view, from bottom to top of view, in degrees.

Expects a Float

50

getObjectById: <T extends IObject3D = IObject3D>(id: number) => undefined | T

Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

Type declaration

    • <T extends IObject3D = IObject3D>(id: number): undefined | T
    • Type Parameters

      Parameters

      • id: number

        Unique number of the object instance. Expects a Integer

      Returns undefined | T

Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

id

getObjectByName: <T extends IObject3D = IObject3D>(
    name: string,
) => undefined | T

Searches through an object and its children, starting with the object itself, and returns the first with a matching name.

Type declaration

Note that for most objects the name is an empty string by default

getObjectByProperty: <T extends IObject3D = IObject3D>(
    name: string,
    value: string,
) => undefined | T

Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.

Type declaration

    • <T extends IObject3D = IObject3D>(name: string, value: string): undefined | T
    • Type Parameters

      Parameters

      • name: string

        the property name to search for.

      • value: string

        value of the given property.

      Returns undefined | T

maxFarPlane: number = 1000

Maximum far clipping plane allowed. (Distance from camera) Used in RootScene when autoNearFar is true.

minNearPlane: number = 0.5

Minimum near clipping plane allowed. (Distance from camera) Used in RootScene when autoNearFar is true.

0.2
name: string

Optional name of the object

(doesn't need to be unique).

""

near: number = 0.01

Near clipping plane. This is managed by RootScene for active cameras To change the minimum that's possible set minNearPlane To use a fixed value set autoNearFar to false and set minNearPlane

parent: null | IObject3D

Object's parent in the scene graph.

An object can have at most one parent.

null

position: Vector3

Object's local position.

new THREE.Vector3() - that is (0, 0, 0).

refreshTarget: (
    this: ICamera,
    distanceFromTarget?: number,
    setDirty?: boolean,
) => void = iCameraCommons.refreshTarget
refreshUi: (this: ICamera) => void = iCameraCommons.refreshUi
remove: (...object: IObject3D[]) => this

Removes a Object3D as child of this Object3D.

An arbitrary number of objects may be removed.

Group for info on manually grouping objects.

target: Vector3 = ...

The target position of the camera (where the camera looks at). Also syncs with the controls.target, so it's not required to set that separately. Note: this is always in world-space Note: autoLookAtTarget must be set to true to make the camera look at the target when no controls are enabled

traverse: (callback: (object: IObject3D) => void) => void

Executes the callback on this object and all descendants.

Type declaration

    • (callback: (object: IObject3D) => void): void
    • 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.

traverseAncestors: (callback: (object: IObject3D) => void) => void

Executes the callback on all ancestors.

Type declaration

    • (callback: (object: IObject3D) => void): void
    • 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.

traverseVisible: (callback: (object: IObject3D) => void) => void

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

Type declaration

    • (callback: (object: IObject3D) => void): void
    • Parameters

      • callback: (object: IObject3D) => void

        A function with as first argument an Object3D object.

      Returns void

Descendants of invisible objects are not traversed.

uiConfig: UiObjectConfig = ...
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.

{}

visible: boolean

Object gets rendered if true.

true

zoom: number

Gets or sets the zoom factor of the camera.

1

Accessors

Methods

  • Serializes this camera with controls to JSON.

    Parameters

    • Optionalmeta: any

      metadata for serialization

    • baseOnly: boolean = false

      Calls only super.toJSON, does internal three.js serialization. Set it to true only if you know what you are doing.

    Returns any