Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractSceneLayer

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private _targetViewport

_targetViewport: any

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

Private _visible

_visible: any

Visibility of the scene layer

Private scene

scene: any

Protected sceneGroup

sceneGroup: Object3D

Container object for all 3D objects of this scene layer

Private signalConnections

signalConnections: any

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

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

Methods

getActiveViewport

  • 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

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

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: Function

    Parameters

    • signal: Signal<CB>

      The signal to wrap.

    Returns TrackedSignal<CB>

    Signal that keeps track of connections made to it.

Protected visibilityChanged

  • visibilityChanged(): void
  • Callback when visible property is changed

    Returns void

Generated using TypeDoc