Options
All
  • Public
  • Public/Protected
  • All
Menu

CustomLayer enables API users to create a scene layer in any view. Creating a subclass that extends CustomLayer can leverage the event handlers deliniated in SceneLayerInterface.

Hierarchy

Index

Constructors

constructor

Properties

Protected sceneGroup

sceneGroup: Object3D<Event>

Container object for all 3D objects of this scene layer

view

Static Protected Readonly ORTHO_DEBOUNCE

ORTHO_DEBOUNCE: number

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

Accessors

targetViewport

visible

  • get visible(): boolean
  • set visible(visible: boolean): void
  • Returns boolean

  • Parameters

    • visible: boolean

    Returns void

Methods

getActiveViewport

Protected isVisibleInViewport

onAfterRender

  • onAfterRender(camera: Camera): void
  • Called after rendering of all viewports

    Parameters

    • camera: Camera

      Camera used to render the view

    Returns void

onAfterRenderViewport

onAfterSceneRenderViewport

onBeforeRender

  • onBeforeRender(camera: Camera): void

onBeforeRenderViewport

  • Called before rendering a viewport. Updates layer visibility depending on viewport and avoids raycasting objects if {@link #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

onCameraMoveEnd

  • onCameraMoveEnd(asyncWork: Promise<void>): void
  • Called shortly after the camera has stopped moving

    Parameters

    • asyncWork: Promise<void>

      Promise which blocks until the {@link AbstractView} has completed any asynchronous work, independent of whether it rejects or resolves.

    Returns void

onClick

  • Called for mouse clicks and taps

    Parameters

    Returns boolean

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

onContextMenu

  • Called when the context menu is about to be shown

    Return context menu items from this method to add them to the context menu. Return undefined (or do not implement the method) if you do not want to add an entry from the specific layer. Return false to prevent the context menu from opening.

    Parameters

    Returns OnContextMenuResult

    List of context menu items

onDestroy

  • onDestroy(): void
  • 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

onDoubleClick

onHold

onKeyDown

  • onKeyDown(event: KeyboardEvent): boolean
  • 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

onKeyUp

  • onKeyUp(event: KeyboardEvent): boolean
  • Called when a key is released

    note

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

    Parameters

    • event: KeyboardEvent

      Key event data

    Returns boolean

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

onMouseMove

onMouseWheel

onTransitionEnd

onTransitionStart

onViewportCameraMoveEnd

  • 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 {@link AbstractView} has completed any asynchronous work, independent of whether it rejects or resolves.

    Returns void

Protected trackSignal

  • 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: (...args: unknown[]) => unknown

    Parameters

    • signal: Signal<CB>

      The signal to wrap.

    Returns TrackedSignal<CB>

    Signal that keeps track of connections made to it.

Protected visibilityChanged

  • visibilityChanged(): void

Generated using TypeDoc