Options
All
  • Public
  • Public/Protected
  • All
Menu

A Marker with an HTML label attached to it, managed by an AnnotationsPlugin.

Hierarchy

Index

Constructors

Properties

eye: number[]

Optional World-space position for Camera.eye, used when this Annotation is associated with a Camera position.

Undefined by default.

id: string

ID of this Component, unique within the Scene.

Components are mapped by this ID in {@link Scene.components}.

property

id

look: number[]

Optional World-space position for Camera.look, used when this Annotation is associated with a Camera position.

Undefined by default.

meta: any

Arbitrary, user-defined metadata on this component.

property

metadata

The AnnotationsPlugin this Annotation was created by.

projection: string

Optional projection type for Camera.projection, used when this Annotation is associated with a Camera position.

Undefined by default.

scene: Scene

The parent Scene that contains this Component.

property

scene

final
up: number[]

Optional World-space position for Camera.up, used when this Annotation is associated with a Camera position.

Undefined by default.

viewer: Viewer

The viewer that contains this Scene.

property

viewer

Accessors

  • get canvasPos(): number[]
  • Canvas-space 2D coordinates of this Marker.

    This property is read-only and is automatically calculated from Marker.worldPos and the current Camera position and projection.

    The Marker fires a "canvasPos" event whenever this property changes.

    Returns number[]

  • get occludable(): boolean
  • set occludable(arg: boolean): void
  • Gets whether occlusion testing is performed for this Marker.

    When this is true, then Marker.visible will be false whenever the Marker is occluded by an Entity in the 3D view.

    Returns boolean

  • Sets whether occlusion testing is performed for this Marker.

    When this is true, then Marker.visible will be false whenever the Marker is occluded by an Entity in the 3D view.

    The Scene periodically occlusion-tests all Markers on every 20th "tick" (which represents a rendered frame). We can adjust that frequency via property Scene.ticksPerOcclusionTest.

    Parameters

    • arg: boolean

    Returns void

  • get origin(): number[]
  • The Component that owns the lifecycle of this Component, if any.

    When that component is destroyed, this component will be automatically destroyed also.

    Will be null if this Component has no owner.

    property

    owner

    Returns Component

  • get rtcPos(): number[]
  • get viewPos(): number[]
  • View-space 3D coordinates of this Marker.

    This property is read-only and is automatically calculated from Marker.worldPos and the current Camera position.

    The Marker fires a "viewPos" event whenever this property changes.

    Returns number[]

  • get visible(): boolean
  • get worldPos(): number[]
  • set worldPos(arg: number[]): void
  • Gets the World-space 3D position of this Marker.

    Fires a "worldPos" event with new World position.

    Returns number[]

  • Sets the World-space 3D position of this Marker.

    Fires a "worldPos" event with new World position.

    Parameters

    • arg: number[]

    Returns void

Methods

  • clear(): void
  • destroy(): void
  • error(message: string): void
  • Logs an error for this component to the JavaScript console.

    The console message will have this format: [ERROR] [<component type> =<component id>: <message>

    Also fires the message as an "error" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • fire(event: string, value: any, forget?: boolean): void
  • Fires an event on this component.

    Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    • Optional forget: boolean

    Returns void

  • getField(key: string): string
  • getLabelShown(): boolean
  • getMarkerShown(): boolean
  • getValues(): {}
  • hasSubs(event: string): boolean
  • Returns true if there are any subscribers to the given event on this component.

    Parameters

    • event: string

      The event

    Returns boolean

    True if there are any subscribers to the given event on this component.

  • isType(type: any): boolean
  • log(message: string): void
  • Logs a console debugging message for this component.

    The console message will have this format: [LOG] [<component type> <component id>: <message>

    Also fires the message as a "log" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • off(subId: string): void
  • on(event: string, callback: Function, scope?: any): string
  • Subscribes to an event on this component.

    The callback is be called with this component as scope.

    Parameters

    • event: string

      The event

    • callback: Function

      Called fired on the event

    • Optional scope: any

    Returns string

    Handle to the subscription, which may be used to unsubscribe with .off.

  • once(event: string, callback: Function, scope?: any): void
  • Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

    This is equivalent to calling Component.on, and then calling Component.off inside the callback function.

    Parameters

    • event: string

      Data event to listen to

    • callback: Function

      Called when fresh data is available at the event

    • Optional scope: any

    Returns void

  • setField(key: string, value: string): void
  • setLabelShown(shown: boolean): void
  • setMarkerShown(shown: boolean): void
  • setValues(values: {}): void
  • warn(message: string): void
  • Logs a warning for this component to the JavaScript console.

    The console message will have this format: [WARN] [<component type> =<component id>: <message>

    Also fires the message as a "warn" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

Generated using TypeDoc