Class CombinedCamera

Abstract base class for cameras. This class should always be inherited when you build a new camera.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(width: number, height: number, fov: number, near: number, far: number, orthoNear: number, orthoFar: number): CombinedCamera

Parameters

  • width: number
  • height: number
  • fov: number
  • near: number
  • far: number
  • orthoNear: number
  • orthoFar: number

Returns

CombinedCamera

Properties

public bottom: number

public cameraO: OrthographicCamera

public cameraP: PerspectiveCamera

public castShadow: boolean

Gets rendered into shadow map.

public children: Object3D[]

Array with object's children.

public eulerOrder: string

Order of axis for Euler angles.

public far: number

public fov: number

public frustumCulled: boolean

When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible.

public id: number

Unique number of this object instance.

public inOrthographicMode: boolean

public inPerspectiveMode: boolean

public left: number

public matrix: Matrix4

Local transform.

public matrixAutoUpdate: boolean

When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.

public matrixWorld: Matrix4

The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.

public matrixWorldInverse: Matrix4

This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.

public matrixWorldNeedsUpdate: boolean

When this is set, it calculates the matrixWorld in that frame and resets this property to false.

public name: string

Optional name of the object (doesn't need to be unique).

public near: number

public parent: Object3D

Object's parent in the scene graph.

public position: Vector3

Object's local position.

public projectionMatrix: Matrix4

This is the matrix which contains the projection.

public quaternion: Quaternion

Global rotation.

public receiveShadow: boolean

Material gets baked in shadow receiving.

public renderDepth: number

Override depth-sorting order if non null.

public right: number

public rotation: Euler

Object's local rotation (Euler angles), in radians.

public rotationAutoUpdate: boolean

When this is set, then the rotationMatrix gets calculated every frame.

public scale: Vector3

Object's local scale.

public top: number

public up: Vector3

Up direction.

public useQuaternion: boolean

Use quaternion instead of Euler angles for specifying local rotation.

public userData: any

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.

public visible: boolean

Object gets rendered if true.

public zoom: number

Methods

public add(object: Object3D)

Adds object as child of this object.

Parameters

public applyMatrix(matrix: Matrix4)

This updates the position, rotation and scale with the matrix.

Parameters

public clone(camera?: Camera): Camera

Parameters

Returns

Camera

public getDescendants(array?: Object3D[]): Object3D[]

Searches whole subgraph recursively to add all objects in the array.

Parameters

  • array?: Object3D[] optional

    optional argument that returns the the array with descendants.

Returns

Object3D[]

public getObjectById(id: string, recursive: boolean): Object3D

Searches through the object's children and returns the first with a matching id, optionally recursive.

Parameters

  • id: string

    Unique number of the object instance

  • recursive: boolean

    Boolean whether to search through the children's children. Default is false.

Returns

Object3D

public getObjectByName(name: string, recursive: boolean): Object3D

Searches through the object's children and returns the first with a matching name, optionally recursive.

Parameters

  • name: string

    String to match to the children's Object3d.name property.

  • recursive: boolean

    Boolean whether to search through the children's children. Default is false.

Returns

Object3D

public localToWorld(vector: Vector3): Vector3

Updates the vector from local space to world space.

Parameters

Returns

Vector3

public lookAt(vector: Vector3)

This make the camera look at the vector position in local space.

Parameters

public remove(object: Object3D)

Removes object as child of this object.

Parameters

public rotateOnAxis(axis: Vector3, angle: number): Object3D

Rotate an object along an axis in object space. The axis is assumed to be normalized.

Parameters

  • axis: Vector3

    A normalized vector in object space.

  • angle: number

    The angle in radians.

Returns

Object3D

public setFov(fov: number)

Parameters

  • fov: number

public setLens(focalLength: number, frameHeight?: number): number

Parameters

  • focalLength: number
  • frameHeight?: number optional

Returns

number

public setSize(width: number, height: number)

Parameters

  • width: number
  • height: number

public setZoom(zoom: number)

Parameters

  • zoom: number

public toBackView()

public toBottomView()

public toFrontView()

public toLeftView()

public toOrthographic()

public toPerspective()

public toRightView()

public toTopView()

public translateOnAxis(axis: Vector3, distance: number): Object3D

Parameters

  • axis: Vector3

    A normalized vector in object space.

  • distance: number

    The distance to translate.

Returns

Object3D

public translateX(distance: number)

Translates object along x axis by distance.

Parameters

  • distance: number

    Distance.

public translateY(distance: number)

Translates object along y axis by distance.

Parameters

  • distance: number

    Distance.

public translateZ(distance: number)

Translates object along z axis by distance.

Parameters

  • distance: number

    Distance.

public traverse(callback: (object: THREE.Object3D) => any)

Translates object along arbitrary axis by distance.

Parameters

  • callback: (object: THREE.Object3D) => any

public updateMatrix()

Updates local transform.

public updateMatrixWorld(force: boolean)

Updates global transform of the object and its children.

Parameters

  • force: boolean

public updateProjectionMatrix()

public worldToLocal(vector: Vector3): Vector3

Updates the vector from world space to local space.

Parameters

Returns

Vector3