瀏覽代碼

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
 
42
 
43
 ### time
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
 ### gizmos
49
 ### gizmos
50
 
50
 
91
 **Arguments**
91
 **Arguments**
92
 
92
 
93
 * `callback: function`. A function that receives two parameters:
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
     * `frame: Frame`. A [Frame](frame.md) holding the data you need to create the augmented scene.
95
     * `frame: Frame`. A [Frame](frame.md) holding the data you need to create the augmented scene.
96
 
96
 
97
 **Returns**
97
 **Returns**

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

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

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

33
 import { Gizmos } from '../ui/gizmos';
33
 import { Gizmos } from '../ui/gizmos';
34
 import { Frame } from './frame';
34
 import { Frame } from './frame';
35
 import { Tracker } from '../trackers/tracker';
35
 import { Tracker } from '../trackers/tracker';
36
-import { Time } from './time';
36
+import { TimeManager } from './time-manager';
37
 import { Source } from '../sources/source';
37
 import { Source } from '../sources/source';
38
 import { VideoSource } from '../sources/video-source';
38
 import { VideoSource } from '../sources/video-source';
39
 import { CanvasSource } from '../sources/canvas-source';
39
 import { CanvasSource } from '../sources/canvas-source';
113
     private readonly _primarySource: VideoSource | CanvasSource;
113
     private readonly _primarySource: VideoSource | CanvasSource;
114
 
114
 
115
     /** Time Manager */
115
     /** Time Manager */
116
-    private _time: Time;
116
+    private _time: TimeManager;
117
 
117
 
118
     /** Is the session currently active? */
118
     /** Is the session currently active? */
119
     private _active: boolean;
119
     private _active: boolean;
158
         this._active = true;
158
         this._active = true;
159
         this._frameReady = true; // no trackers at the moment
159
         this._frameReady = true; // no trackers at the moment
160
         this._rafQueue = [];
160
         this._rafQueue = [];
161
-        this._time = new Time();
161
+        this._time = new TimeManager();
162
         this._gizmos = new Gizmos();
162
         this._gizmos = new Gizmos();
163
         this._gizmos.visible = gizmos;
163
         this._gizmos.visible = gizmos;
164
 
164
 
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
         return this._time;
451
         return this._time;
452
     }
452
     }

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

16
  * You should have received a copy of the GNU Lesser General Public License
16
  * You should have received a copy of the GNU Lesser General Public License
17
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
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
  * Time Manager
24
  * Time Manager
25
  */
25
  */
26
-export class Time
26
+export class TimeManager
27
 {
27
 {
28
     /** time scale */
28
     /** time scale */
29
     private _scale: number = 1;
29
     private _scale: number = 1;

Loading…
取消
儲存