Class OrthographicCamera2

Hierarchy (View Summary)

Implements

Constructors

  • Parameters

    • OptionalcontrolsMode: string
    • OptionaldomElement: HTMLCanvasElement
    • OptionalautoAspect: boolean
    • OptionalfrustumSize: number
    • Optionalleft: number
    • Optionalright: number
    • Optionaltop: number
    • Optionalbottom: number
    • Optionalnear: number
    • Optionalfar: number
    • Optionalaspect: number

    Returns OrthographicCamera2

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

aspect: number

Aspect ratio to use when frustumSize is defined

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.

bottom: number

Camera frustum bottom plane.

Expects a Float.

-1

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

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

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

left: number

Camera frustum left plane.

Expects a Float

-1

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.

right: number

Camera frustum right plane.

Expects a Float

1

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

top: number

Camera frustum top plane.

Expects a Float

1

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

  • See also cameraHelpers.glsl

    Parameters

    • material: {
          defines: Record<string, undefined | string | number>;
          uniforms: { [p: string]: IUniform };
      }

    Returns this