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

Method CreateAsync

Dependencies/xr/Source/ARCore/XR.cpp:845–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843 }
844
845 arcana::task<std::shared_ptr<System::Session>, std::exception_ptr> System::Session::CreateAsync(System& system, void* graphicsDevice)
846 {
847 // First perform the ARCore installation check, request install if not yet installed.
848 return CheckAndInstallARCoreAsync().then(arcana::inline_scheduler, arcana::cancellation::none(), []()
849 {
850 // Next check for camera permissions, and request if not already granted.
851 return CheckCameraPermissionAsync();
852 }).then(arcana::inline_scheduler, arcana::cancellation::none(), [&system, graphicsDevice]()
853 {
854 // Finally if the previous two tasks succeed, start the AR session.
855 return std::make_shared<System::Session>(system, graphicsDevice);
856 });
857 }
858
859 System::Session::Session(System& system, void* graphicsDevice)
860 : m_impl{ std::make_unique<System::Session::Impl>(*system.m_impl, graphicsDevice) }

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected