Kaynağa Gözat

Rename TrackablePointer.totalDistance to TrackablePointer.movementLength

customisations
alemart 8 ay önce
ebeveyn
işleme
ec2a3e01f5

+ 3
- 3
docs/api/trackable-pointer.md Dosyayı Görüntüle

@@ -58,11 +58,11 @@ The current velocity of the pointer, given in space units per second. You can ge
58 58
 
59 59
 The elapsed time, in seconds, since the tracking of this pointer began.
60 60
 
61
-### totalDistance
61
+### movementLength
62 62
 
63
-`pointer.totalDistance: number, read-only`
63
+`pointer.movementLength: number, read-only`
64 64
 
65
-How much this pointer has moved, in space units, since its tracking began. You can get the average speed of motion by calculating the ratio `totalDistance / duration`.
65
+How much this pointer has moved, in space units, since its tracking began. You can get the average speed of motion by calculating the ratio `movementLength / duration`.
66 66
 
67 67
 ### isPrimary
68 68
 

+ 2
- 2
src/trackers/pointer-tracker/pointer-tracker.ts Dosyayı Görüntüle

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

+ 1
- 1
src/trackers/pointer-tracker/trackable-pointer.ts Dosyayı Görüntüle

@@ -60,7 +60,7 @@ export interface TrackablePointer extends Trackable
60 60
     readonly duration: number;
61 61
 
62 62
     /** how much this pointer has moved, in space units, since its tracking began */
63
-    readonly totalDistance: number;
63
+    readonly movementLength: number;
64 64
 
65 65
     /** whether or not this is the primary pointer for this type */
66 66
     readonly isPrimary: boolean;

Loading…
İptal
Kaydet