Adds geospatial capabilities to three.js cameras.

Hierarchy (view full)

Implements

Constructors

Accessors

  • get height(): number
  • The height, in pixels, of this view.

    Returns number

  • get maxFarPlane(): number
  • Gets or sets the maximum distance allowed for the camera far plane.

    Returns number

  • set maxFarPlane(distance): void
  • Parameters

    • distance: number

    Returns void

  • get minNearPlane(): number
  • Gets or sets the minimum distance allowed for the camera near plane.

    Returns number

  • set minNearPlane(distance): void
  • Parameters

    • distance: number

    Returns void

  • get width(): number
  • The width, in pixels, of this view.

    Returns number

Methods

  • Adds a listener to an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<ViewEvents[T], T, renderer.View>

      The function that gets called when the event is fired.

    Returns void

  • Fire an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • event: BaseEvent<T> & ViewEvents[T]

      The event that gets fired.

    Returns void

  • Computes a PointOfView for the given object.

    Parameters

    • obj: Object3D<Object3DEventMap> | Box3

      The object to compute the point of view, or a world space bounding box.

    • Optionaloptions: {
          camera?: Camera;
      }

      Optional parameters.

      • Optionalcamera?: Camera

        The optional camera to compute this point of view. If unspecified, the currently active camera on this view is used.

    Returns null | Readonly<PointOfView>

    The readonly point of view if it could be computed, null otherwise.

  • Setup the camera to match the specified object or point of view.

    • If the argument is a PointOfView, this will be used directly.
    • If the object implements HasDefaultPointOfView, this will be used to compute the point of view.
    • Otherwise, a default point of view is computed from the object's bounding box.

    Important note: this method does not update any camera controls that are controlling the camera. Those controls have to be updated manually so they do not override the new camera position. For example, controls that have a target must be updated so that the target position matches the one returned by this method.

    Parameters

    • obj: Object3D<Object3DEventMap> | PointOfView | HasDefaultPointOfView

      The object to go to.

    • Optionaloptions: {
          allowTranslation?: boolean;
      }

      The options.

      • OptionalallowTranslation?: boolean

        Allow moving the camera. If false, the camera is only rotated to look at the object.

        true
        

    Returns null | Readonly<PointOfView>

    The immutable PointOfView that was used to setup the camera, or null if it couldn't be computed.

  • Checks if listener is added to an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<ViewEvents[T], T, renderer.View>

      The function that gets called when the event is fired.

    Returns boolean

  • Parameters

    • worldOBB: OBB

    Returns boolean

  • Return the position in the requested CRS, or in camera's CRS if undefined.

    Parameters

    • Optionalcrs: string

      if defined (e.g 'EPSG:4236') the camera position will be returned in this CRS

    Returns Coordinates

    Coordinates object holding camera's position

  • Removes a listener from an event type.

    Type Parameters

    • T extends "change"

    Parameters

    • type: T

      The type of the listener that gets removed.

    • listener: EventListener<ViewEvents[T], T, renderer.View>

      The listener function that gets removed.

    Returns void

  • Resets the near and far planes to their default value.

    Returns void

  • Registers external controls that must be udpated periodically.

    Note: this is the case of simple controls in the examples/{js,jsm}/controls folder of THREE.js (e.g MapControls):

    • they fire 'change' events when the controls' state has changed and the view must be rendered,
    • they have an update() method to update the controls' state.

    For more complex controls, such as the package camera-controls, a more complex logic is required. Please refer to the appropriate examples for a detailed documentation on how to bind Giro3D and those controls.

    Parameters

    • controls: null | ExternalControls

      The controls to register. If null, currently registered controls are unregistered (they are not disabled however).

    Returns void

  • Parameters

    • Optionalwidth: number
    • Optionalheight: number

    Returns void

MMNEPVFCICPMFPCPTTAAATR