|
@@ -269,6 +269,9 @@ export class PointerTracker implements Tracker
|
269
|
269
|
// determine the velocity
|
270
|
270
|
const velocity = deltaPosition._clone()._scale(inverseDeltaTime);
|
271
|
271
|
|
|
272
|
+ // determine the elapsed time since the tracking began
|
|
273
|
+ const elapsedTime = previous ? previous.elapsedTime + deltaTime : 0;
|
|
274
|
+
|
272
|
275
|
// determine whether or not this is the primary pointer for this type
|
273
|
276
|
const isPrimary = event.isPrimary;
|
274
|
277
|
|
|
@@ -277,7 +280,7 @@ export class PointerTracker implements Tracker
|
277
|
280
|
|
278
|
281
|
// we create new trackable instances on each frame;
|
279
|
282
|
// these will be exported and consumed by the user
|
280
|
|
- this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, isPrimary, type });
|
|
283
|
+ this._newPointers.set(id, { id, phase, position, deltaPosition, initialPosition, velocity, elapsedTime, isPrimary, type });
|
281
|
284
|
|
282
|
285
|
}
|
283
|
286
|
|