Parcourir la source

Use "normalized units"

customisations
alemart il y a 10 mois
Parent
révision
74002b9125

+ 3
- 3
docs/api/trackable-pointer.md Voir le fichier

@@ -4,7 +4,7 @@ A [trackable](trackable.md) that represents a pointer tracked by a [PointerTrack
4 4
 
5 5
 A pointer is an abstraction that represents an instance of user input that targets one or more coordinates on a screen. For example, each point of contact between fingers and a multitouch screen generate a pointer. Devices such as a mouse and a pen/stylus also generate pointers.
6 6
 
7
-Pointers are positioned in the [viewport](viewport.md), and their positions are given in normalized coordinates. Normalized coordinates range from -1 to +1. The center of the viewport is at (0,0). The top-right corner is at (1,1). The bottom-left corner is at (-1,-1).
7
+Pointers are positioned in the [viewport](viewport.md). Their positions are given in normalized units, which range from -1 to +1. The center of the viewport is at (0,0). The top-right corner is at (1,1). The bottom-left corner is at (-1,-1).
8 8
 
9 9
 *Since:* 0.4.0
10 10
 
@@ -32,7 +32,7 @@ The phase of the pointer. It's one of the following strings:
32 32
 
33 33
 `pointer.position: Vector2, read-only`
34 34
 
35
-The current position of the pointer, given in normalized coordinates.
35
+The current position of the pointer, given in normalized units.
36 36
 
37 37
 ### initialPosition
38 38
 
@@ -50,7 +50,7 @@ The difference between the position of the pointer in this and in the previous f
50 50
 
51 51
 `pointer.velocity: Vector2, read-only`
52 52
 
53
-The current velocity of the pointer, given in normalized coordinates per second. You can get the speed of motion by calculating the [magnitude](vector2.md#length) of this vector.
53
+The current velocity of the pointer, given in normalized units per second. You can get the speed of motion by calculating the [magnitude](vector2.md#length) of this vector.
54 54
 
55 55
 ### isPrimary
56 56
 

+ 2
- 2
src/trackers/pointer-tracker/trackable-pointer.ts Voir le fichier

@@ -44,7 +44,7 @@ export interface TrackablePointer extends Trackable
44 44
     /** the phase of the pointer */
45 45
     readonly phase: TrackablePointerPhase;
46 46
 
47
-    /** current position in normalized coordinates [-1,1]x[-1,1] */
47
+    /** current position in normalized units [-1,1]x[-1,1] */
48 48
     readonly position: Vector2;
49 49
 
50 50
     /** the difference between the position of the pointer in this and in the previous frame */
@@ -53,7 +53,7 @@ export interface TrackablePointer extends Trackable
53 53
     /** the position of the pointer when its tracking began */
54 54
     readonly initialPosition: Vector2;
55 55
 
56
-    /** current velocity, given in normalized coordinates per second */
56
+    /** current velocity, given in normalized units per second */
57 57
     readonly velocity: Vector2;
58 58
 
59 59
     /** whether or not this is the primary pointer for this type */

Chargement…
Annuler
Enregistrer