Name | Summary |
---|---|
VrActivity | constructor() |
Name | Summary |
---|---|
Companion | object Companion |
Name | Summary |
---|---|
componentManager | val componentManager: ComponentManager |
scene | var scene: Scene |
spatialContext | var spatialContext: SpatialContext |
systemManager | val systemManager: SystemManager |
Name | Summary |
---|---|
dispatchGenericMotionEvent | open fun dispatchGenericMotionEvent(event: <Error class: unknown class>): Boolean Dispatches a generic motion event to the appropriate game controller. |
dispatchKeyEvent | open fun dispatchKeyEvent(event: <Error class: unknown class>): Boolean Dispatches a key event to the appropriate game controller. |
doFrame | open fun doFrame(frameTimeNanos: Long) Called when a new display frame is being rendered. |
findFeature | inline fun <T : SpatialFeature> findFeature(): T fun <T : SpatialFeature> findFeature(clazz: KClass<T>): T |
getComponentManager | fun getComponentManager(): ComponentManager Returns the singleton component manager for the application. |
getDataModel | fun getDataModel(): DataModel Returns the singleton DataModel for the application. |
getGameControllerDeviceIds | fun getGameControllerDeviceIds(): Set<Int> Returns a set of device IDs for all connected game controllers. |
getSceneObject | fun getSceneObject(): Scene Returns the singleton scene object for the application. |
getSystemManager | fun getSystemManager(): SystemManager Returns the singleton system manager for the application. |
loadLibrary | open fun loadLibrary(name: String) Loads a native C++ library. This method should be called in onCreate(). |
onCreate | open fun onCreate(savedInstanceState: <Error class: unknown class>?) Called when the VRActivity is first created. This method creates the necessary building blocks for a Spatial application. It initializes the VrActivity, including loading the Meta Spatial SDK library, registering game controller management, creating a new spatial instance, and initializing the SpatialFeature manager. |
onDestroy | open fun onDestroy() Called when the app is destroyed. VrActivity::onDestroy will clean up all the resources and trigger garbage collection. If you override this method, be sure to call super.onDestroy(). |
onPause | open fun onPause() Called as part of the activity lifecycle when an activity is going into the background, but has not yet been killed. The counterpart to onResume(). If you override this method, be sure to call super.onPause(). |
onPostResume | open fun onPostResume() Called after activity resume is complete. If you override this method, be sure to call super.onPostResume(). |
onRecenter | open fun onRecenter() This hook is called when the VRActivity is recentered. |
onResume | open fun onResume() Called when the activity will start interacting with the user. If you override this method, be sure to call super.onResume() |
onSceneReady | open fun onSceneReady() This hook is called on the first onResume(), after the scene is loaded in onCreate(). It will invoke all the onSceneReady() hooks of the registered SpatialFeatures. |
onSceneTick | open fun onSceneTick() Called every tick in the application to update the scene. |
onStart | open fun onStart() Called when the activity is becoming visible to the user. If you override this method, be sure to call super.onStart(). |
onStop | open fun onStop() Called when the app is no longer visible to the user. You will next receive either onRestart(), onDestroy(), or nothing, depending on later user activity. If you override this method, be sure to call super.onStop(). |
onVRPause | open fun onVRPause() This hook is called when the VRActivity switches from immersive to non-immersive mode. It will invoke all the onVRPause() hooks of the registered SpatialFeatures. |
onVRReady | open fun onVRReady() This hook is called when the immersive Spatial application is first loaded or is changed from 2D mode to immersive (VR) mode. It will invoke all the onVRReady() hooks of the registered SpatialFeatures. |
pinGameController | fun pinGameController(deviceId: Int, func: (<Error class: unknown class>?, <Error class: unknown class>?) -> Unit) Pins a game controller with the given device ID and associates it with the given function. |
registerFeatures | open fun registerFeatures(): List<SpatialFeature> Override this method to register your own SpatialFeatures. This is called in onCreate(). |
registerRequiredOpenXRExtensions | open fun registerRequiredOpenXRExtensions(): List<String> |
registerSystemFeatures | open fun registerSystemFeatures(): List<SpatialFeature> |
runOnMainThread | fun runOnMainThread(runnable: Runnable) This method provides a way to run a Runnable on the activity’s main thread. |
setBaseHref | open fun setBaseHref(baseHref: String) Sets the base href for the application. |
tryFindFeature | inline fun <T : SpatialFeature> tryFindFeature(): T? fun <T : SpatialFeature> tryFindFeature(clazz: KClass<T>): T? |
unpinGameController | fun unpinGameController(deviceId: Int) Unpins a game controller with the given device ID. |
useVolumes | open fun useVolumes(): Boolean |