ソースを参照

Update docs

customisations
alemart 8ヶ月前
コミット
897be48206
2個のファイルの変更14行の追加3行の削除
  1. 6
    2
      docs/api/pointer-tracker.md
  2. 8
    1
      src/trackers/pointer-tracker/pointer-tracker.ts

+ 6
- 2
docs/api/pointer-tracker.md ファイルの表示

24
 **Example**
24
 **Example**
25
 
25
 
26
 ```js
26
 ```js
27
-// Use default settings
27
+// Use the default settings
28
 const pointerTracker = AR.Tracker.Pointer();
28
 const pointerTracker = AR.Tracker.Pointer();
29
 
29
 
30
 // Track pointers in adjusted space
30
 // Track pointers in adjusted space
47
 
47
 
48
 - In `"normalized"` space, pointers are located in [-1,1]x[-1,1]. The origin of the space is at the center of the [viewport](viewport.md). The x-axis points to the right and the y-axis points up. This is the default space.
48
 - In `"normalized"` space, pointers are located in [-1,1]x[-1,1]. The origin of the space is at the center of the [viewport](viewport.md). The x-axis points to the right and the y-axis points up. This is the default space.
49
 
49
 
50
+    - Point (0,0) is at the center of the viewport
51
+    - The top-right corner of the viewport is at (+1,+1)
52
+    - The bottom-left corner of the viewport is at (-1,-1)
53
+
50
 - The `"adjusted"` space is similar to the normalized space, except that it is scaled so that it matches the [aspect ratio](viewport.md#aspectratio) of the viewport.
54
 - The `"adjusted"` space is similar to the normalized space, except that it is scaled so that it matches the [aspect ratio](viewport.md#aspectratio) of the viewport.
51
 
55
 
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.
56
     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
 
57
 
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.
58
     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
 
59
 
56
-    In summary: prefer the adjusted space when tracking movements.
60
+    In summary, prefer the adjusted space when working with velocities and movement curves.

+ 8
- 1
src/trackers/pointer-tracker/pointer-tracker.ts ファイルの表示

59
  *   of the space is at the center of the viewport. The x-axis points to the
59
  *   of the space is at the center of the viewport. The x-axis points to the
60
  *   right and the y-axis points up. This is the default space.
60
  *   right and the y-axis points up. This is the default space.
61
  *
61
  *
62
+ *   - Point (0,0) is at the center of the viewport
63
+ *   - The top-right corner of the viewport is at (+1,+1)
64
+ *   - The bottom-left corner of the viewport is at (-1,-1)
65
+ *
62
  * - The "adjusted" space is similar to the normalized space, except that it is
66
  * - The "adjusted" space is similar to the normalized space, except that it is
63
  *   scaled so that it matches the aspect ratio of the viewport.
67
  *   scaled so that it matches the aspect ratio of the viewport.
64
  *
68
  *
72
  *   are equivalent in both axes and for preserving movement curves. Speeds are
76
  *   are equivalent in both axes and for preserving movement curves. Speeds are
73
  *   not equivalent and movement curves are not preserved by default because
77
  *   not equivalent and movement curves are not preserved by default because
74
  *   the normalized space is a square, whereas the viewport is a rectangle.
78
  *   the normalized space is a square, whereas the viewport is a rectangle.
79
+ *
80
+ *   In summary, prefer the adjusted space when working with velocities and
81
+ *   movement curves.
75
  */
82
  */
76
-export type PointerSpace = 'normalized' | 'adjusted'; // | 'viewport';
83
+export type PointerSpace = 'normalized' | 'adjusted';
77
 
84
 
78
 /**
85
 /**
79
  * Options for instantiating a PointerTracker
86
  * Options for instantiating a PointerTracker

読み込み中…
キャンセル
保存