File tree 4 files changed +26
-24
lines changed
4 files changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,12 @@ CreateBoxAsync(scene).then(function () {
61
61
//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/RiggedFigure/glTF/RiggedFigure.gltf").then(function () {
62
62
//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMan/glTF/CesiumMan.gltf").then(function () {
63
63
//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/ClearCoatTest/glTF/ClearCoatTest.gltf").then(function () {
64
+ //BABYLON.SceneLoader.AppendAsync("file:///C:/Users/garyhsu/Downloads/alien/alien.gltf").then(function () {
64
65
BABYLON . Tools . Log ( "Loaded" ) ;
65
66
67
+ //scene.animationGroups[0].goToFrame(5 * scene.animationGroups[0].targetedAnimations[0].animation.framePerSecond);
68
+ //scene.animationGroups[0].pause();
69
+
66
70
// This creates and positions a free camera (non-mesh)
67
71
scene . createDefaultCamera ( true , true , true ) ;
68
72
scene . activeCamera . alpha += Math . PI ;
Original file line number Diff line number Diff line change @@ -14,26 +14,6 @@ namespace Babylon::Polyfills::Internal
14
14
}
15
15
}
16
16
17
- struct TimeoutDispatcher ::Timeout
18
- {
19
- TimeoutId id;
20
-
21
- // Make this non-shared when JsRuntime::Dispatch supports it.
22
- std::shared_ptr<Napi::FunctionReference> function;
23
-
24
- TimePoint time;
25
-
26
- Timeout (TimeoutId id, std::shared_ptr<Napi::FunctionReference> function, TimePoint time)
27
- : id{id}
28
- , function{std::move (function)}
29
- , time{time }
30
- {
31
- }
32
-
33
- Timeout (const Timeout&) = delete ;
34
- Timeout (Timeout&&) = delete ;
35
- };
36
-
37
17
TimeoutDispatcher::TimeoutDispatcher (Babylon::JsRuntime& runtime)
38
18
: m_runtimeScheduler{runtime}
39
19
, m_thread{std::thread{&TimeoutDispatcher::ThreadFunction, this }}
Original file line number Diff line number Diff line change 13
13
14
14
namespace Babylon ::Polyfills::Internal
15
15
{
16
+ using TimeoutId = int32_t ;
17
+
16
18
class TimeoutDispatcher
17
19
{
18
- using TimeoutId = int32_t ;
19
- struct Timeout ;
20
-
21
20
public:
22
21
TimeoutDispatcher (Babylon::JsRuntime& runtime);
23
22
~TimeoutDispatcher ();
@@ -28,6 +27,26 @@ namespace Babylon::Polyfills::Internal
28
27
private:
29
28
using TimePoint = std::chrono::time_point<std::chrono::steady_clock, std::chrono::microseconds>;
30
29
30
+ struct Timeout
31
+ {
32
+ TimeoutId id;
33
+
34
+ // Make this non-shared when JsRuntime::Dispatch supports it.
35
+ std::shared_ptr<Napi::FunctionReference> function;
36
+
37
+ TimePoint time;
38
+
39
+ Timeout (TimeoutId id, std::shared_ptr<Napi::FunctionReference> function, TimePoint time)
40
+ : id{id}
41
+ , function{std::move (function)}
42
+ , time{time }
43
+ {
44
+ }
45
+
46
+ Timeout (const Timeout&) = delete ;
47
+ Timeout (Timeout&&) = delete ;
48
+ };
49
+
31
50
TimeoutId NextTimeoutId ();
32
51
void ThreadFunction ();
33
52
void CallFunction (std::shared_ptr<Napi::FunctionReference> function);
Original file line number Diff line number Diff line change 2
2
3
3
#include < Babylon/JsRuntimeScheduler.h>
4
4
#include " TimeoutDispatcher.h"
5
- #include < optional>
6
5
7
6
namespace Babylon ::Polyfills::Internal
8
7
{
You can’t perform that action at this time.
0 commit comments