Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MainViewInterface

Hierarchy

Index

Properties

active

active: boolean

Whether this view will be rendered, invalidates scene when true.

currViewingDir

currViewingDir: ViewOrientationInterface

Current view orientation

scene

scene: Scene

Object that contains items that will be rendered in the view. For more information ThreeJS.Scene

Methods

addToScene

centerOn

  • centerOn(position: Vector3, frustumDepth?: number): void
  • Center all viewports on the specified location

    Parameters

    • position: Vector3

      Position to center view on

    • Optional frustumDepth: number

      Adjust the frustum size of orthographic cameras so that far - near = frustumDepth

    Returns void

closeContextMenu

  • closeContextMenu(): void

createSceneGroup

  • createSceneGroup(): Object3D

forgetTween

  • forgetTween(tween: Tween): void
  • Remove a tween from the watch list. Call this from tween's

    onComplete()
    method.

    Parameters

    • tween: Tween

    Returns void

getCamera

  • getCamera(): Camera
  • note

    If there are multiple viewports, this shall return the camera for the default one

    Returns Camera

    The camera used to render the view

getCurrentCursorPosition

  • Retrieves data about the current cursor position in this view.

    Returns CursorDataInterface

    Data about the current cursor position

getCursorLayer

  • Returns the Cursor layer

    Returns SceneLayerInterface

    Cursor layer if found, undefined otherwise

getDefaultViewport

getFov

  • getFov(): number
  • Get the field of view of the default viewport

    Returns number

    Field of view [degrees]

getImage

  • Return the currently active image.

    note

    The image can be undefined.

    Returns ImageInterface

    Currently active image

getLastMousePosition

getLocationMarkerLayer

  • Returns the LocationMarker layer

    Returns SceneLayerInterface

    LocationMarker layer if found, undefined otherwise

getObjectsUnderCursor

getPoiLayer

getPositionOnGroundPlane

  • getPositionOnGroundPlane(x: number, y: number, z: number, viewport?: ViewportInterface): Vector3
  • Get 3D position of specified screen coordinates assuming a ground plane at given height

    note

    This method is viewport-aware and takes care of the extra transformation.

    note

    Unprojects the screen coordinates and intersects the ray with a plane with normal (0,0,1) at specified height in order to get the 3D point coordinates on the plane.

    note

    If z is undefined, the plane is assumed to be 1 unit away from the camera position in the direction the camera is facing.

    Parameters

    • x: number

      Screen X coordinate

    • y: number

      Screen Y coordinate

    • z: number

      Z coordinate of ground plane. Can be undefined.

    • Optional viewport: ViewportInterface

      Viewport to use (optional)

    Returns Vector3

    3D position of mouse or gesture event on the plane (or null)

getRouteLayer

getScreenshot

invalidateScene

  • invalidateScene(callback?: () => void): void
  • Invalidates the scene so that it is rendered. Call this method whenever things happen that modify the appearance of the scene (e.g. a texture download finishes).

    Parameters

    • Optional callback: () => void

      callback to be run after scene has been rendered

        • (): void
        • Returns void

    Returns void

unprojectEvent

  • unprojectEvent(event: MouseEvent, z?: number): Vector3
  • Unproject screen-space coordinates given as input event.

    note

    This method is viewport-aware and takes care of the extra transformation.

    Parameters

    • event: MouseEvent

      Hammer.JS event data

    • Optional z: number

      Z coordinate in screen-space (defaults to 1 if not provided)

    Returns Vector3

    Unprojected coordinates (local coordinates)

unprojectScreenCoordinates

  • unprojectScreenCoordinates(x: number, y: number, z?: number, viewport?: ViewportInterface): Vector3
  • Unproject screen-space coordinates (relative to the viewport, i.e. (0,0) is the upper left corner of the rendering DIV).

    Parameters

    • x: number

      X coordinate in screen-space

    • y: number

      Y coordinate in screen-space

    • Optional z: number

      Z coordinate in screen-space (defaults to 1 if not provided)

    • Optional viewport: ViewportInterface

      The viewport to use for unprojection

    Returns Vector3

    Unprojected coordinates (local coordinates)

updateFov

  • updateFov(fov: number): void
  • Set the field of view of the default viewport

    Parameters

    • fov: number

      Field of view [degrees]

    Returns void

updateOrientation

watchTween

  • watchTween(tween: Tween): void
  • Add a tween to the watch list. Call this when you start a tween. As long as at least one tween is watched, fixed-rate rendering is enabled.

    Parameters

    • tween: Tween

      Tween to watch

    Returns void

Generated using TypeDoc