@twinfinity/core
    Preparing search index...

    Class CoordinateTracker<Tracked3D>

    CoordinateTracker contains methods for tracking a screen space coordinate from a 3D position.

    Type Parameters

    Index

    Constructors

    Properties

    onUpdateObservable: Observable<TrackCoordinate2D<Tracked3D>> = ...

    Called when a tracked 3D coordinate changes its 2D position (when camera is manipulated). Same as onUpdate but using a Observable instead.

    Accessors

    • get size(): number

      Number of items currently being tracked.

      Returns number

    Methods

    • Removes all tracked coordinates from the tracker.

      Returns void

    • Disposes the coordinate tracker.

      Returns void

    • Allows iteration of all entities that are tracked (and their ids)

      Returns IterableIterator<[unknown, Tracked3D]>

      collection of all tracked entities and their id.

    • Immediately force a recalculation of all 2D coordinates

      Returns void

    • Register a callback which will be called when the active camera moves. It is called once for each coordinate registered by track.

      Parameters

      Returns void

    • This method takes a coordinate in 3D to track screen space position when the camera moves. When method is called events on onUpdateObservable are immediately raised for the passed coordinate. Same coordinate can be passed multiple times (with same id) but it will only be added once. However events onUpdateObservable will still be immediately raised and report 2D coordinates data even if coordinate is already tracked.

      Parameters

      • coordinate: Tracked3D

        Coordinate to track.

      • Optionalid: unknown

        Optional. If not specified an id will be generated

      Returns unknown

      id of tracked coordinate.

    • Stops tracking of a 3D coordinate.

      Parameters

      • id: unknown

        Id of 3D coordinate to stop tracking

      Returns undefined | Tracked3D

      Object that was untracked. If there is no such object then undefined.