Class AbstractSceneLayerAbstract

A scene layer that displays objects in the 3D scene. This interface serves as a template to construct your own custom data layers. Public methods described in this class act as callbacks to particular events occurring in the view (Main or Map view) to which the scene layer is added.

Note: The mouse or touch event callbacks can also be added to individual THREE.Mesh objects inside data layers. In case of multiple callbacks, Mesh objects are prioritized over data layers. For a complete reference of all of the events supported on THREE.Mesh, see: MouseEventReceiverInterface

Hierarchy

Implements

Constructors

Properties

_targetViewport: any

If non-null, layer is only visible in that viewport

_visible: any

Visibility of the scene layer

scene: any
sceneGroup: Object3D<Event>

Container object for all 3D objects of this scene layer

signalConnections: any

List of signal connections that will be disconnected automatically when the view is destroyed

ORTHO_DEBOUNCE: number

Time in ms to debounce map view rendering by to avoid unnecessary work.

Accessors

Methods

  • Retrieve the active viewport. This is either the targetViewport if defined or otherwise the view's default viewport.
    Note: use this over targetViewport if you just need the active viewport for this layer and don't care whether a specific one or the default one is specified.

    Returns ViewportInterface

  • Parameters

    Returns boolean

  • Called after rendering of all viewports

    Parameters

    • camera: Camera

      Camera used to render the view

    Returns void

  • Called after the rendering of a scene in a viewport.

    Parameters

    • viewport: ViewportInterface

      Viewport where the rendering took place

    • scene: Scene

      The last scene that was rendered.

    Returns void

  • Called before rendering

    Parameters

    • camera: Camera

      Camera used to render the view

    Returns void

  • Called before rendering a viewport. Updates layer visibility depending on viewport and avoids raycasting objects if #targetViewport doesn't match the passed viewport.

    Note: If you override this method and change the position, orientation or scale of a mesh, and you rely on mouse events on the meshes or use getObjectsUnderCursor(), call this.sceneGroup.updateWorldMatrix(false, true); in your overridden method.

    Parameters

    Returns void

  • Called shortly after the camera has stopped moving

    Parameters

    • asyncWork: Promise<void>

      Promise which blocks until the AbstractViewInterface has completed any asynchronous work, independent of whether it rejects or resolves.

    Returns void

  • Called for mouse clicks and taps

    Parameters

    Returns boolean

    Return true to consume the event, false to pass it on

  • Called when the view is destroyed. Override this method and clean up all references to objects that would prevent garbage collection, e.g., signal handlers and transient fields that your scene layer may have put on entities.

    This implementation will detach all signal handlers registered by connectToSignal(), remove the sceneGroup from the scene and set it to undefined.

    Override this method to clean up references (and call the super class method)

    Returns void

  • Called when a key is pressed down

    Parameters

    • event: KeyboardEvent

      Key event data

    Returns boolean

    Return true to consume the event, false to pass it on to other layers

  • Called when a key is released

    Parameters

    • event: KeyboardEvent

      Key event data

    Returns boolean

    Return true to consume the event, false to pass it on to other layers

    Note

    released keys on a physical keyboard connected to an iOS device do not fire the keyup event

  • Called when the mouse wheel is used

    Parameters

    Returns boolean

    Return true to consume the event, false to pass it on

  • Called shortly after the camera inside the viewport has stopped moving

    Parameters

    • viewport: ViewportInterface

      The viewport where the camera move happened

    • asyncWork: Promise<void>

      Promise which blocks until the AbstractViewInterface has completed any asynchronous work, independent of whether it rejects or resolves.

    Returns void

  • Wrap the provided Signal into a TrackedSignal which keeps track of calls to its connect method. The connections made through the TrackedSignal will be disconnected automatically when the scene layer is destroyed.

    Type Parameters

    • CB extends ((...args) => unknown)

    Parameters

    • signal: Signal<CB>

      The signal to wrap.

    Returns TrackedSignal<CB>

    Signal that keeps track of connections made to it.

  • Callback when visible property is changed

    Returns void

Generated using TypeDoc