File tree Expand file tree Collapse file tree 4 files changed +26
-24
lines changed Expand file tree Collapse file tree 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 () {
6161//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/RiggedFigure/glTF/RiggedFigure.gltf").then(function () {
6262//BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/CesiumMan/glTF/CesiumMan.gltf").then(function () {
6363//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 () {
6465 BABYLON . Tools . Log ( "Loaded" ) ;
6566
67+ //scene.animationGroups[0].goToFrame(5 * scene.animationGroups[0].targetedAnimations[0].animation.framePerSecond);
68+ //scene.animationGroups[0].pause();
69+
6670 // This creates and positions a free camera (non-mesh)
6771 scene . createDefaultCamera ( true , true , true ) ;
6872 scene . activeCamera . alpha += Math . PI ;
Original file line number Diff line number Diff line change @@ -14,26 +14,6 @@ namespace Babylon::Polyfills::Internal
1414 }
1515 }
1616
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-
3717 TimeoutDispatcher::TimeoutDispatcher (Babylon::JsRuntime& runtime)
3818 : m_runtimeScheduler{runtime}
3919 , m_thread{std::thread{&TimeoutDispatcher::ThreadFunction, this }}
Original file line number Diff line number Diff line change 1313
1414namespace Babylon ::Polyfills::Internal
1515{
16+ using TimeoutId = int32_t ;
17+
1618 class TimeoutDispatcher
1719 {
18- using TimeoutId = int32_t ;
19- struct Timeout ;
20-
2120 public:
2221 TimeoutDispatcher (Babylon::JsRuntime& runtime);
2322 ~TimeoutDispatcher ();
@@ -28,6 +27,26 @@ namespace Babylon::Polyfills::Internal
2827 private:
2928 using TimePoint = std::chrono::time_point<std::chrono::steady_clock, std::chrono::microseconds>;
3029
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+
3150 TimeoutId NextTimeoutId ();
3251 void ThreadFunction ();
3352 void CallFunction (std::shared_ptr<Napi::FunctionReference> function);
Original file line number Diff line number Diff line change 22
33#include < Babylon/JsRuntimeScheduler.h>
44#include " TimeoutDispatcher.h"
5- #include < optional>
65
76namespace Babylon ::Polyfills::Internal
87{
You can’t perform that action at this time.
0 commit comments