Browse Source

Add notes

customisations
alemart 8 months ago
parent
commit
27b66d312c
2 changed files with 6 additions and 4 deletions
  1. 2
    0
      docs/api/pointer-tracker.md
  2. 4
    4
      docs/api/trackable-pointer.md

+ 2
- 0
docs/api/pointer-tracker.md View File

@@ -52,3 +52,5 @@ The space in which pointers are located. You may set it when instantiating the t
52 52
     Pointers in adjusted space are contained in normalized space, but unless the viewport is a square, one of their coordinates, x or y, will no longer range from -1 to +1. It will range from *-s* to *+s*, where *s = min(a, 1/a)*. In this expression, *a* is the aspect ratio of the viewport and *s* is less than or equal to 1.
53 53
 
54 54
     Selecting the adjusted space is useful for making sure that pointer speeds are equivalent in both axes and for preserving movement curves. Speeds are not equivalent and movement curves are not preserved by default because the normalized space is a square, whereas the viewport is a rectangle.
55
+
56
+    In summary: prefer the adjusted space when tracking movements.

+ 4
- 4
docs/api/trackable-pointer.md View File

@@ -56,7 +56,7 @@ The current velocity of the pointer, given in space units per second. You can ge
56 56
 
57 57
 `pointer.duration: number, read-only`
58 58
 
59
-The elapsed time, in seconds, since the tracking of this pointer began.
59
+The elapsed time, in seconds, since the tracking of this pointer began. You can check if this pointer represents a tap by comparing its duration to a threshold at the `"ended"` [phase](#phase). Example: `isTap = pointer.phase == "ended" && pointer.duration < 0.25`.
60 60
 
61 61
 ### movementLength
62 62
 
@@ -68,16 +68,16 @@ How much this pointer has moved, in space units, since its tracking began. You c
68 68
 
69 69
 `pointer.movementDuration: number, read-only`
70 70
 
71
-The total time, in seconds, in which this pointer has moved. You can get the average speed of motion, excluding the times in which this pointer has not moved, by calculating the ratio `movementLength / movementDuration`.
71
+The total time, in seconds, in which this pointer has moved. You can get the average speed of motion, excluding the times in which this pointer remained stationary, by calculating the ratio `movementLength / movementDuration`.
72 72
 
73 73
 ### isPrimary
74 74
 
75 75
 `pointer.isPrimary: boolean, read-only`
76 76
 
77
-Whether or not this is the primary pointer among all pointers of this [type](#type). A typical primary pointer is that of a finger that touches the screen when no other fingers are touching it.
77
+Whether or not this is the primary pointer among all pointers of this [kind](#kind). A typical primary pointer is that of a finger that touches the screen when no other fingers are touching it.
78 78
 
79 79
 ### kind
80 80
 
81 81
 `pointer.kind: string, read-only`
82 82
 
83
-The type of device that originated this pointer. Typically `"touch"`, `"mouse"` or `"pen"`.
83
+The kind of device that originated this pointer. Typically `"touch"`, `"mouse"` or `"pen"`.

Loading…
Cancel
Save