Skip to content

TrackerResult

An interface that represents the result generated by a tracker at a specific time. It is part of a frame.

Properties

tracker

result.tracker: Tracker, read-only

A reference to the tracker that generated this result.

trackables

result.trackables: Trackable[], read-only

An array of zero or more trackables.

Methods

of

result.of(trackerType: string): boolean

Checks if this result was generated by tracker of a certain trackerType. This is a convenient type guard for TypeScript users. See also: Tracker.is.

Since: 0.4.4

Returns

The same as tracker.is(trackerType).

Example

let result: TrackerResult;

// ...

if(result.of('image-tracker')) {
    // result is inferred to be an ImageTrackerResult
    // ...
}
else if(result.of('pointer-tracker')) {
    // result is inferred to be a PointerTrackerResult
    // ...
}
else {
    // ...
}
👨‍💻 Need help?