|
@@ -304,6 +304,9 @@ export class PointerTracker implements Tracker
|
304
|
304
|
// determine the elapsed time since the tracking began
|
305
|
305
|
const elapsedTime = previous ? previous.elapsedTime + deltaTime : 0;
|
306
|
306
|
|
|
307
|
+ // determine how much this pointer has moved since its tracking began
|
|
308
|
+ const totalDistance = previous ? previous.totalDistance + deltaPosition.length() : 0;
|
|
309
|
+
|
307
|
310
|
// determine whether or not this is the primary pointer for this type
|
308
|
311
|
const isPrimary = event.isPrimary;
|
309
|
312
|
|
|
@@ -312,7 +315,7 @@ export class PointerTracker implements Tracker
|
312
|
315
|
|
313
|
316
|
// we create new trackable instances on each frame;
|
314
|
317
|
// these will be exported and consumed by the user
|
315
|
|
- this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, elapsedTime, isPrimary, kind });
|
|
318
|
+ this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, elapsedTime, totalDistance, isPrimary, kind });
|
316
|
319
|
|
317
|
320
|
}
|
318
|
321
|
|