浏览代码

Rename class to TimeManager

customisations
alemart 10 个月前
父节点
当前提交
ae88e512e4
共有 4 个文件被更改,包括 12 次插入12 次删除
  1. 3
    3
      docs/api/session.md
  2. 1
    1
      docs/api/time-manager.md
  3. 5
    5
      src/core/session.ts
  4. 3
    3
      src/core/time-manager.ts

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

@@ -42,9 +42,9 @@ Whether or not the session has been ended. See also: [end](#end).
42 42
 
43 43
 ### time
44 44
 
45
-`session.time: Time, read-only`
45
+`session.time: TimeManager, read-only`
46 46
 
47
-A reference to the [Time](time.md) utilities of this session.
47
+A reference to the [TimeManager](time-manager.md) of this session.
48 48
 
49 49
 ### gizmos
50 50
 
@@ -91,7 +91,7 @@ Schedules a call to the `callback` function, which is intended to update and ren
91 91
 **Arguments**
92 92
 
93 93
 * `callback: function`. A function that receives two parameters:
94
-    * `time: DOMHighResTimeStamp`. Elapsed time, in milliseconds, since an arbitrary reference. This parameter is kept to mimic web standards, but its usage is discouraged. Prefer using `frame.session.time.elapsed` and `frame.session.time.delta` instead. These are especially useful for creating animations. See also: [Time](time.md).
94
+    * `time: DOMHighResTimeStamp`. Elapsed time, in milliseconds, since an arbitrary reference. This parameter is kept to mimic web standards, but its usage is discouraged. Prefer using `frame.session.time.elapsed` and `frame.session.time.delta` instead. These are especially useful for creating animations. See also: [TimeManager](time-manager.md).
95 95
     * `frame: Frame`. A [Frame](frame.md) holding the data you need to create the augmented scene.
96 96
 
97 97
 **Returns**

docs/api/time.md → docs/api/time-manager.md 查看文件

@@ -1,4 +1,4 @@
1
-# Time
1
+# TimeManager
2 2
 
3 3
 Time-related utilities. They are useful for animating virtual scenes.
4 4
 

+ 5
- 5
src/core/session.ts 查看文件

@@ -33,7 +33,7 @@ import { StatsPanel } from '../ui/stats-panel';
33 33
 import { Gizmos } from '../ui/gizmos';
34 34
 import { Frame } from './frame';
35 35
 import { Tracker } from '../trackers/tracker';
36
-import { Time } from './time';
36
+import { TimeManager } from './time-manager';
37 37
 import { Source } from '../sources/source';
38 38
 import { VideoSource } from '../sources/video-source';
39 39
 import { CanvasSource } from '../sources/canvas-source';
@@ -113,7 +113,7 @@ export class Session extends AREventTarget<SessionEventType>
113 113
     private readonly _primarySource: VideoSource | CanvasSource;
114 114
 
115 115
     /** Time Manager */
116
-    private _time: Time;
116
+    private _time: TimeManager;
117 117
 
118 118
     /** Is the session currently active? */
119 119
     private _active: boolean;
@@ -158,7 +158,7 @@ export class Session extends AREventTarget<SessionEventType>
158 158
         this._active = true;
159 159
         this._frameReady = true; // no trackers at the moment
160 160
         this._rafQueue = [];
161
-        this._time = new Time();
161
+        this._time = new TimeManager();
162 162
         this._gizmos = new Gizmos();
163 163
         this._gizmos.visible = gizmos;
164 164
 
@@ -444,9 +444,9 @@ export class Session extends AREventTarget<SessionEventType>
444 444
     }
445 445
 
446 446
     /**
447
-     * Time utilities
447
+     * Time Manager
448 448
      */
449
-    get time(): Time
449
+    get time(): TimeManager
450 450
     {
451 451
         return this._time;
452 452
     }

src/core/time.ts → src/core/time-manager.ts 查看文件

@@ -16,14 +16,14 @@
16 16
  * You should have received a copy of the GNU Lesser General Public License
17 17
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18 18
  *
19
- * time.ts
20
- * Time utilities
19
+ * time-manager.ts
20
+ * Time Manager
21 21
  */
22 22
 
23 23
 /**
24 24
  * Time Manager
25 25
  */
26
-export class Time
26
+export class TimeManager
27 27
 {
28 28
     /** time scale */
29 29
     private _scale: number = 1;

正在加载...
取消
保存