|
@@ -383,6 +383,9 @@ export class PointerTracker implements Tracker
|
383
|
383
|
// determine how much this pointer has moved since its tracking began
|
384
|
384
|
const movementLength = previous ? previous.movementLength + deltaPosition.length() : 0;
|
385
|
385
|
|
|
386
|
+ // determine the duration of the movement
|
|
387
|
+ const movementDuration = !previous ? 0 : previous.movementDuration + (movementLength > previous.movementLength ? deltaTime : 0);
|
|
388
|
+
|
386
|
389
|
// determine whether or not this is the primary pointer for this type
|
387
|
390
|
const isPrimary = event.isPrimary;
|
388
|
391
|
|
|
@@ -391,7 +394,7 @@ export class PointerTracker implements Tracker
|
391
|
394
|
|
392
|
395
|
// we create new trackable instances on each frame;
|
393
|
396
|
// these will be exported and consumed by the user
|
394
|
|
- this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, duration, movementLength, isPrimary, kind });
|
|
397
|
+ this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, duration, movementDuration, movementLength, isPrimary, kind });
|
395
|
398
|
|
396
|
399
|
}
|
397
|
400
|
|