You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tracker.md 1.0KB

Tracker

An interface that represents a generic tracker. Trackers analyze input data in some way and are meant to be attached to a session. Refer to the concepts for more information.

An Image Tracker is an implementation of a tracker, and so is a PointerTracker.

Properties

type

tracker.type: string, read-only

A string representing the type of the tracker.

Deprecated since: 0.4.4. Use tracker.is() instead.

Methods

is

tracker.is(type: string): boolean

Checks if this tracker is of a certain type. This works as a convenient type-narrowing method for TypeScript users.

Since: 0.4.4

Returns

true if and only if type === tracker.type

Example

let tracker: Tracker;

// ...

if(tracker.is('image-tracker')) {
    // tracker is inferred to be an ImageTracker
    // ...
}
else if(tracker.is('pointer-tracker')) {
    // tracker is inferred to be a PointerTracker
    // ...
}
else {
    // ...
}