瀏覽代碼

Use "normalized units"

customisations
alemart 10 月之前
父節點
當前提交
74002b9125
共有 2 個檔案被更改,包括 5 行新增5 行删除
  1. 3
    3
      docs/api/trackable-pointer.md
  2. 2
    2
      src/trackers/pointer-tracker/trackable-pointer.ts

+ 3
- 3
docs/api/trackable-pointer.md 查看文件

4
 
4
 
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.
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
 *Since:* 0.4.0
9
 *Since:* 0.4.0
10
 
10
 
32
 
32
 
33
 `pointer.position: Vector2, read-only`
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
 ### initialPosition
37
 ### initialPosition
38
 
38
 
50
 
50
 
51
 `pointer.velocity: Vector2, read-only`
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
 ### isPrimary
55
 ### isPrimary
56
 
56
 

+ 2
- 2
src/trackers/pointer-tracker/trackable-pointer.ts 查看文件

44
     /** the phase of the pointer */
44
     /** the phase of the pointer */
45
     readonly phase: TrackablePointerPhase;
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
     readonly position: Vector2;
48
     readonly position: Vector2;
49
 
49
 
50
     /** the difference between the position of the pointer in this and in the previous frame */
50
     /** the difference between the position of the pointer in this and in the previous frame */
53
     /** the position of the pointer when its tracking began */
53
     /** the position of the pointer when its tracking began */
54
     readonly initialPosition: Vector2;
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
     readonly velocity: Vector2;
57
     readonly velocity: Vector2;
58
 
58
 
59
     /** whether or not this is the primary pointer for this type */
59
     /** whether or not this is the primary pointer for this type */

Loading…
取消
儲存