SpatialMLSession

@RequiresApi(value = 27)
class SpatialMLSession : BaseHandle

A handle to each session of SpatialML framework usage. For each session, a dedicated SpatialML container for securely rendering mixed-reality components will be allocated.

One session handle must be linked to a SpatialMLInstance, on which the framework session's lifecycle depends.

Parameters

instance

The SpatialMLInstance the session is associated with.

config

The configuration during initialization.

Throws

If the usage is not allowed by the SpatialML run-time Framework, or if the framework encounter internal error and cannot perform the requested behavior.

Types

Link copied to clipboard
object Companion

Factory methods and constants for SpatialMLSession.

Link copied to clipboard

SpatialML container's type.

Link copied to clipboard
class InitInfo(val imageWidth: Int, val imageHeight: Int, val containerWidth: Int, val containerHeight: Int, val containerDepth: Int, val containerType: SpatialMLSession.ContainerType = ContainerType.VOLUMETRIC)

Configuration structure for framework session handle.

Properties

Link copied to clipboard

The BaseHandle's implementation's destructor.

Functions

Link copied to clipboard
@RequiresApi(value = 27)
fun SpatialMLSession.loadPipelinePackageFromAssets(assetRoot: String, externalGlobals: Map<String, GlobalTensor> = emptyMap()): PipelinePackageBundle

Load a SecureMR pipeline package from application assets.

Link copied to clipboard

Creates new global tensors within the context of current framework session.

Link copied to clipboard

Creates a new pipeline within the context of current framework session.

Link copied to clipboard
fun newSceneFromGLTF(gltfSceneMemory: SharedMemory): GlobalTensor

Creates an SpatialML scene from a glTF file already loaded into SharedMemory.

fun newSceneFromGLTF(gltfSceneAsset: String): GlobalTensor

Creates an SpatialML scene from a glTF file in asset.

Link copied to clipboard
suspend fun newSceneFromGLTFSuspend(gltfSceneAsset: String): GlobalTensor

Async version of newSceneFromGLTF.