Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IOrthographicCameraApi

The api for an orthographic camera. An orthographic camera can be created by calling the createOrthographicCamera method. A camera has a multitude of properties and methods that can be used to adjust the behavior.

Hierarchy

Index

Properties

autoAdjust: boolean

Option to automatically adjust the camera to the size of the scene whenever a call to ISessionApi.customize replaced ISessionApi.node. This does not happen in case ISessionApi.automaticSceneUpdate is set to false.

cameraMovementDuration: number

The standard duration for camera movements.

damping: number

The damping factor for the camera. The dampening affects how much the camera moves even after you let it got. This smooths the usage of the camera.

defaultPosition: vec3

The default position of the camera.

defaultTarget: vec3

The default target of the camera.

The direction of the camera. (default: ORTHOGRAPHIC_CAMERA_DIRECTION.TOP)

enableKeyPan: boolean

Option to enable panning with key presses.

enablePan: boolean

Option to enable panning. Panning can be done by pressing the right mouse button or three-finger touch events.

enableZoom: boolean

Option to enable zooming. Zooming can be done with the mouse wheel or two-finger touch events.

enabled: boolean

Option to enable / disable the movement of the camera.

id: string

The id of the camera.

keyPanSpeed: number

The speed of the camera for key panning. The higher this value, the faster you can pan.

movementSmoothness: number

The factor for applying smoothing to the camera movement. The various events that come in are blended together to ensure that extremes are not as pronounced.

panSpeed: number

The speed of the camera for panning. The higher this value, the faster you can pan.

position: vec3

The current position of the camera.

revertAtMouseUp: boolean

Option to animate the camera position and target to their defaults whenever the mouse/touch up event is fired.

revertAtMouseUpDuration: number

The standard duration for revertAtMouseUp animations.

target: vec3

The current target of the camera.

The type of camera that is being used.

zoomSpeed: number

The speed of the camera for zooming. The higher this value, the faster you can zoom.

zoomToFactor: number

The factor that is used when the zoomTo function is called.

See also calculateZoomTo

name?: string

The name of the camera. Used by the platform.

order?: number

Optional order property for the camera. Used by the platform.

Methods

  • animate(path: { position: vec3; target: vec3 }[], options?: ICameraOptions): Promise<boolean>
  • Let the camera follow a path along pairs of position and target.

    Parameters

    • path: { position: vec3; target: vec3 }[]

      The defined path.

    • Optional options: ICameraOptions

      Various options to be adjusted.

    Returns Promise<boolean>

  • calculateZoomTo(zoomTarget?: IBox, startingPosition?: vec3, startingTarget?: vec3): { position: vec3; target: vec3 }
  • Calculate the position and target which a call to zoomTo would result in.

    If no target to zoom to is provided, the current bounding box is used. If no startingPosition and startingTarget are provided, the current camera position and target are used.

    see

    zoomToFactor

    Parameters

    • Optional zoomTarget: IBox

      The target to zoom to.

    • Optional startingPosition: vec3

      The starting position of the camera.

    • Optional startingTarget: vec3

      The starting target of the camera.

    Returns { position: vec3; target: vec3 }

    • position: vec3
    • target: vec3
  • project(p: vec3): vec2
  • Projects the vector from world space into the camera's normalized device coordinate (NDC) space.

    Parameters

    • p: vec3

      The point in the scene to project.

    Returns vec2

  • Reset / animate the camera to its default position and target.

    Parameters

    Returns Promise<boolean>

  • set(position: vec3, target: vec3, options?: ICameraOptions): Promise<boolean>
  • Set / animate the camera to a specific position and target.

    Parameters

    • position: vec3
    • target: vec3
    • Optional options: ICameraOptions

      Various options to be adjusted.

    Returns Promise<boolean>

  • unproject(p: vec3): vec3
  • Projects the vector from the camera's normalized device coordinate (NDC) space into world space.

    Parameters

    • p: vec3

      The point on the screen to project.

    Returns vec3

  • Zoom to a specific part of the scene, or the whole scene (default).

    Parameters

    • Optional zoomTarget: IBox

      The target to zoom to.

    • Optional options: ICameraOptions

      Various options to be adjusted.

    Returns Promise<boolean>