MCPcopy Create free account
hub / github.com/BabylonJS/BabylonNative / SetEngine

Method SetEngine

Plugins/NativeXr/Source/NativeXr.cpp:162–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160 }
161
162 void SetEngine(Napi::Object& jsEngine)
163 {
164 // This implementation must be switched to simply unwrapping the JavaScript object as soon as NativeEngine
165 // is transitioned away from a singleton pattern. Part of that change will remove the GetEngine method, as
166 // documented in https://github.com/BabylonJS/BabylonNative/issues/62
167 auto nativeEngine = jsEngine.Get("_native").As<Napi::Object>();
168 auto getEngine = nativeEngine.Get("getEngine").As<Napi::Function>();
169 m_engineImpl = getEngine.Call(nativeEngine, {}).As<Napi::External<NativeEngine>>().Data();
170 }
171
172 void DoFrame(std::function<void(const xr::System::Session::Frame&)> callback)
173 {

Callers 2

SetEngineMethod · 0.45

Calls 3

CallMethod · 0.80
GetMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected