FakeJxrPlatformAdapter


class FakeJxrPlatformAdapter


Test-only implementation of JxrPlatformAdapter

Summary

Public constructors

Public functions

open Unit
addSpatialCapabilitiesChangedListener(
    callbackExecutor: Executor,
    listener: Consumer<SpatialCapabilities>
)

Adds the given {@link Consumer} as a listener to be invoked when this Session's current SpatialCapabilities change.

open TextureResource?

Borrows the reflection texture from the currently set environment IBL.

open Unit

Releases the listener previously added by setSpatialVisibilityChangedListener.

open ActivityPanelEntity
createActivityPanelEntity(
    pose: Pose,
    windowBoundsPx: PixelDimensions,
    name: String,
    hostActivity: Activity,
    parent: Entity
)

Factory function to create ActivityPanel to launch/move activity into.

open AnchorEntity

A factory function to create an Anchor entity from a {@link androidx.xr.runtime.internal.Anchor}.

open AnchorEntity
createAnchorEntity(
    bounds: Dimensions,
    planeType: PlaneType,
    planeSemantic: PlaneSemantic,
    searchTimeout: Duration
)

A factory function to create an Anchor entity.

open AnchorPlacement
createAnchorPlacementForPlanes(
    planeTypeFilter: Set<PlaneType>,
    planeSemanticFilter: Set<PlaneSemantic>
)

Creates an instance of an AnchorPlacement object.

open Entity
createEntity(pose: Pose, name: String, parent: Entity)

A factory function to create a content-less entity.

open GltfEntity
createGltfEntity(
    pose: Pose,
    loadedGltf: GltfModelResource,
    parentEntity: Entity
)

A factory function to create a SceneCore GltfEntity.

open InteractableComponent
createInteractableComponent(
    executor: Executor,
    listener: InputEventListener
)

Create an Interactable component.

open LoggingEntity

A function to create a XR Runtime Entity.

open MovableComponent
createMovableComponent(
    systemMovable: Boolean,
    scaleInZ: Boolean,
    anchorPlacement: Set<AnchorPlacement>,
    shouldDisposeParentAnchor: Boolean
)

Create an instance of MovableComponent.

open PanelEntity
createPanelEntity(
    context: Context,
    pose: Pose,
    view: View,
    dimensions: Dimensions,
    name: String,
    parent: Entity
)

A factory function to create a platform PanelEntity.

open PanelEntity
createPanelEntity(
    context: Context,
    pose: Pose,
    view: View,
    pixelDimensions: PixelDimensions,
    name: String,
    parent: Entity
)

A factory function to create a platform PanelEntity.

open AnchorEntity
createPersistedAnchorEntity(uuid: UUID, searchTimeout: Duration)

A factory function to recreate an Anchor entity which was persisted in a previous session.

open PointerCaptureComponent
createPointerCaptureComponent(
    executor: Executor,
    stateListener: PointerCaptureComponent.StateListener,
    inputListener: InputEventListener
)

Create an instance of {@link PointerCaptureComponent}.

open ResizableComponent
createResizableComponent(
    minimumSize: Dimensions,
    maximumSize: Dimensions
)

Create an instance of ResizableComponent.

open SpatialPointerComponent
open SubspaceNodeEntity

A factory function to create a SubspaceNodeEntity.

open SurfaceEntity
createSurfaceEntity(
    stereoMode: Int,
    canvasShape: SurfaceEntity.CanvasShape,
    pose: Pose,
    parentEntity: Entity
)

A factory function for an Entity which displays drawable surfaces.

open ListenableFuture<MaterialResource>?
createWaterMaterial(isAlphaMapVersion: Boolean)

Creates a water material by querying it from the system's built-in materials.

open Unit

Destroys the given texture resource.

open Unit

Destroys the given water material resource.

open Unit

Disposes of the resources used by the platform adapter.

open CameraViewActivityPose?

Returns the CameraViewActivityPose for the specified camera type or null if it is not ready/available.

open TextureResource?

Returns the reflection texture from the given IBL.

open ListenableFuture<ExrImageResource>

Loads an ExrImage for the given asset name from the assets folder using the Split Engine route.

open ListenableFuture<ExrImageResource>
loadExrImageByByteArray(assetData: ByteArray, assetKey: String)

Loads an ExrImage from a provided byte array using the Split Engine route.

open ListenableFuture<GltfModelResource>

Loads glTF Asset for the given asset name from the assets folder using the Split Engine route.

open ListenableFuture<GltfModelResource>
loadGltfByByteArray(assetData: ByteArray, assetKey: String)

Loads glTF Asset from a provided byte array.

open ListenableFuture<TextureResource>?
loadTexture(assetName: String, sampler: TextureSampler)

Loads a texture resource for the given asset name or URL.

open Unit

Releases the given {@link Consumer} from receiving updates when the Session's {@link SpatialCapabilities} change.

open Unit

If the primary Activity for the Session that owns this object has focus, causes it to be placed in FullSpace Mode.

open Unit

If the primary Activity for the Session that owns this object has focus, causes it to be placed in HomeSpace Mode.

open Unit

Sets the alpha map for the water material.

open Unit
setAlphaStepMultiplier(
    material: MaterialResource,
    alphaStepMultiplier: Float
)

Sets the alpha step multiplier for the water material.

open Bundle

Sets the full space mode flag to the given {@link Bundle}.

open Bundle

Sets the inherit full space mode environment flag to the given {@link Bundle}.

open Unit
setNormalBoundary(material: MaterialResource, normalBoundary: Float)

Sets the normal boundary for the water material.

open Unit

Sets the normal map texture for the water material.

open Unit
setNormalSpeed(material: MaterialResource, normalSpeed: Float)

Sets the normal speed for the water material.

open Unit
setNormalTiling(material: MaterialResource, normalTiling: Float)

Sets the normal tiling for the water material.

open Unit
setNormalZ(material: MaterialResource, normalZ: Float)

Sets the normal z for the water material.

open Unit
setPreferredAspectRatio(activity: Activity, preferredRatio: Float)

Sets a preferred main panel aspect ratio for home space mode.

open Unit
setReflectionCube(
    material: MaterialResource,
    reflectionCube: TextureResource
)

Sets the reflection cube texture for the water material.

open Unit
setSpatialVisibilityChangedListener(
    callbackExecutor: Executor,
    listener: Consumer<SpatialVisibility>
)

Sets the listener to be invoked when the spatial visibility of the rendered content of the entire scene (all entities, including children of anchors and activitySpace) changes within the user's field of view.

open Unit

Starts the renderer.

open Unit

Stops the renderer.

Public properties

open ActivitySpace

Returns the Activity Space entity at the root of the scene.

open Entity

Returns the entity that represents the ActivitySpace root.

open AudioTrackExtensionsWrapper

Returns a AudioTrackExtensionsWrapper instance.

open HeadActivityPose?

Returns the HeadActivityPose for the session or null if it not ready.

open PanelEntity

Get the PanelEntity associated with the main window for the Runtime.

open MediaPlayerExtensionsWrapper

Returns a MediaPlayerExtensionsWrapper instance.

open PerceptionSpaceActivityPose

Returns the PerceptionSpaceActivityPose for the Session.

open SoundPoolExtensionsWrapper

Returns a SoundPoolExtensionsWrapper instance.

open SpatialCapabilities

Return the Spatial Capabilities set that are currently supported by the platform.

open SpatialEnvironment

Returns the Environment for the Session.

Public constructors

FakeJxrPlatformAdapter

Added in 1.0.0-alpha04
FakeJxrPlatformAdapter()

Public functions

addSpatialCapabilitiesChangedListener

Added in 1.0.0-alpha04
open fun addSpatialCapabilitiesChangedListener(
    callbackExecutor: Executor,
    listener: Consumer<SpatialCapabilities>
): Unit

Adds the given {@link Consumer} as a listener to be invoked when this Session's current SpatialCapabilities change. {@link Consumer#accept(SpatialCapabilities)} will be invoked on the given Executor.

borrowReflectionTexture

Added in 1.0.0-alpha04
open fun borrowReflectionTexture(): TextureResource?

Borrows the reflection texture from the currently set environment IBL.

clearSpatialVisibilityChangedListener

Added in 1.0.0-alpha04
open fun clearSpatialVisibilityChangedListener(): Unit

Releases the listener previously added by setSpatialVisibilityChangedListener.

createActivityPanelEntity

Added in 1.0.0-alpha04
open fun createActivityPanelEntity(
    pose: Pose,
    windowBoundsPx: PixelDimensions,
    name: String,
    hostActivity: Activity,
    parent: Entity
): ActivityPanelEntity

Factory function to create ActivityPanel to launch/move activity into.

Parameters
pose: Pose

Initial pose of the panel.

windowBoundsPx: PixelDimensions

Boundary for the window

name: String

Name of the panel.

hostActivity: Activity

Activity to host the panel.

parent: Entity

Parent entity.

createAnchorEntity

Added in 1.0.0-alpha04
open fun createAnchorEntity(anchor: Anchor): AnchorEntity

A factory function to create an Anchor entity from a {@link androidx.xr.runtime.internal.Anchor}.

Parameters
anchor: Anchor

The {@link androidx.xr.runtime.internal.Anchor} to create the Anchor entity from.

createAnchorEntity

Added in 1.0.0-alpha04
open fun createAnchorEntity(
    bounds: Dimensions,
    planeType: PlaneType,
    planeSemantic: PlaneSemantic,
    searchTimeout: Duration
): AnchorEntity

A factory function to create an Anchor entity.

Parameters
bounds: Dimensions

Bounds for this Anchor.

planeType: PlaneType

Orientation of the plane to which this anchor should attach.

planeSemantic: PlaneSemantic

Semantic type of the plane to which this anchor should attach.

searchTimeout: Duration

How long to search for an anchor. If this is Duration.ZERO, this will search for an anchor indefinitely.

createAnchorPlacementForPlanes

Added in 1.0.0-alpha04
open fun createAnchorPlacementForPlanes(
    planeTypeFilter: Set<PlaneType>,
    planeSemanticFilter: Set<PlaneSemantic>
): AnchorPlacement

Creates an instance of an AnchorPlacement object.

This can be used in movable components to specify the anchor placement for the entity.

Parameters
planeTypeFilter: Set<PlaneType>

A set of plane types to filter for.

planeSemanticFilter: Set<PlaneSemantic>

A set of plane semantics to filter for.

Returns
AnchorPlacement

AnchorPlacement instance.

createEntity

Added in 1.0.0-alpha04
open fun createEntity(pose: Pose, name: String, parent: Entity): Entity

A factory function to create a content-less entity. This entity is used as a connection point for attaching children entities and managing them (i.e. setPose()) as a group.

Parameters
pose: Pose

Initial pose of the entity.

name: String

Name of the entity.

parent: Entity

Parent entity.

createGltfEntity

Added in 1.0.0-alpha04
open fun createGltfEntity(
    pose: Pose,
    loadedGltf: GltfModelResource,
    parentEntity: Entity
): GltfEntity

A factory function to create a SceneCore GltfEntity. The parent may be the activity space or GltfEntity in the scene.

createInteractableComponent

Added in 1.0.0-alpha04
open fun createInteractableComponent(
    executor: Executor,
    listener: InputEventListener
): InteractableComponent

Create an Interactable component.

Parameters
executor: Executor

Executor to use for input callbacks.

listener: InputEventListener

JxrPlatformAdapter.InputEventListener for this component.

Returns
InteractableComponent

InteractableComponent instance.

createLoggingEntity

Added in 1.0.0-alpha04
open fun createLoggingEntity(pose: Pose): LoggingEntity

A function to create a XR Runtime Entity.

createMovableComponent

Added in 1.0.0-alpha04
open fun createMovableComponent(
    systemMovable: Boolean,
    scaleInZ: Boolean,
    anchorPlacement: Set<AnchorPlacement>,
    shouldDisposeParentAnchor: Boolean
): MovableComponent

Create an instance of MovableComponent. This component allows the user to move the entity.

Parameters
systemMovable: Boolean

A boolean which causes the system to automatically apply transform updates to the entity in response to user interaction.

scaleInZ: Boolean

A boolean which tells the system to update the scale of the Entity as the user moves it closer and further away. This is mostly useful for Panel auto-rescaling with Distance

anchorPlacement: Set<AnchorPlacement>

AnchorPlacement information for when to anchor the entity.

shouldDisposeParentAnchor: Boolean

A boolean which tells the system to dispose of the parent anchor if that entity was created by the moveable component and is moved off of it.

createPanelEntity

Added in 1.0.0-alpha04
open fun createPanelEntity(
    context: Context,
    pose: Pose,
    view: View,
    dimensions: Dimensions,
    name: String,
    parent: Entity
): PanelEntity

A factory function to create a platform PanelEntity. The parent can be any entity.

Parameters
context: Context

Application Context.

pose: Pose

Initial pose of the panel.

view: View

View inflating this panel.

dimensions: Dimensions

Size of the panel in meters.

name: String

Name of the panel.

parent: Entity

Parent entity.

createPanelEntity

Added in 1.0.0-alpha04
open fun createPanelEntity(
    context: Context,
    pose: Pose,
    view: View,
    pixelDimensions: PixelDimensions,
    name: String,
    parent: Entity
): PanelEntity

A factory function to create a platform PanelEntity. The parent can be any entity.

Parameters
context: Context

Application Context.

pose: Pose

Initial pose of the panel.

view: View

View inflating this panel.

pixelDimensions: PixelDimensions

Dimensions for the underlying surface for the given view in pixels.

name: String

Name of the panel.

parent: Entity

Parent entity.

createPersistedAnchorEntity

Added in 1.0.0-alpha04
open fun createPersistedAnchorEntity(uuid: UUID, searchTimeout: Duration): AnchorEntity

A factory function to recreate an Anchor entity which was persisted in a previous session.

Parameters
uuid: UUID

The UUID of the persisted anchor.

searchTimeout: Duration

How long to search for an anchor. If this is Duration.ZERO, this will search for an anchor indefinitely.

createPointerCaptureComponent

Added in 1.0.0-alpha04
open fun createPointerCaptureComponent(
    executor: Executor,
    stateListener: PointerCaptureComponent.StateListener,
    inputListener: InputEventListener
): PointerCaptureComponent

Create an instance of {@link PointerCaptureComponent}. This component allows the user to capture and redirect to itself all input that would be received by entities other than the Entity it is attached to and that entity's children.

In order to enable pointer capture, an application must be in full space and the entity it is attached to must be visible.

Attach this component to the entity to enable pointer capture, detach the component to restore normal input flow.

Parameters
executor: Executor

Executor used to propagate state and input events.

stateListener: PointerCaptureComponent.StateListener

Callback for updates to the state of pointer capture. Pointer capture may be temporarily lost by the application for a variety of reasons and this callback will notify of when that happens.

inputListener: InputEventListener

Callback that will receive captured InputEvents

createResizableComponent

Added in 1.0.0-alpha04
open fun createResizableComponent(
    minimumSize: Dimensions,
    maximumSize: Dimensions
): ResizableComponent

Create an instance of ResizableComponent. This component allows the user to resize the entity.

Parameters
minimumSize: Dimensions

Minimum size constraint.

maximumSize: Dimensions

Maximum size constraint.

createSpatialPointerComponent

Added in 1.0.0-alpha04
open fun createSpatialPointerComponent(): SpatialPointerComponent

createSubspaceNodeEntity

Added in 1.0.0-alpha04
open fun createSubspaceNodeEntity(subspaceNode: SubspaceNode, size: Dimensions): SubspaceNodeEntity

A factory function to create a SubspaceNodeEntity.

Parameters
subspaceNode: SubspaceNode

The SubspaceNode to create the SubspaceNodeEntity from.

size: Dimensions

The size to make the SubspaceNodeEntity.

createSurfaceEntity

Added in 1.0.0-alpha04
open fun createSurfaceEntity(
    stereoMode: Int,
    canvasShape: SurfaceEntity.CanvasShape,
    pose: Pose,
    parentEntity: Entity
): SurfaceEntity

A factory function for an Entity which displays drawable surfaces.

createWaterMaterial

Added in 1.0.0-alpha04
open fun createWaterMaterial(isAlphaMapVersion: Boolean): ListenableFuture<MaterialResource>?

Creates a water material by querying it from the system's built-in materials. The future returned by this method will fire listeners on the UI thread if Runnable::run is supplied.

destroyTexture

Added in 1.0.0-alpha04
open fun destroyTexture(texture: TextureResource): Unit

Destroys the given texture resource.

destroyWaterMaterial

Added in 1.0.0-alpha04
open fun destroyWaterMaterial(material: MaterialResource): Unit

Destroys the given water material resource.

dispose

Added in 1.0.0-alpha04
open fun dispose(): Unit

Disposes of the resources used by the platform adapter.

getCameraViewActivityPose

Added in 1.0.0-alpha04
open fun getCameraViewActivityPose(cameraType: Int): CameraViewActivityPose?

Returns the CameraViewActivityPose for the specified camera type or null if it is not ready/available.

getReflectionTextureFromIbl

Added in 1.0.0-alpha04
open fun getReflectionTextureFromIbl(iblToken: ExrImageResource): TextureResource?

Returns the reflection texture from the given IBL.

loadExrImageByAssetName

Added in 1.0.0-alpha04
open fun loadExrImageByAssetName(assetName: String): ListenableFuture<ExrImageResource>

Loads an ExrImage for the given asset name from the assets folder using the Split Engine route.

loadExrImageByByteArray

Added in 1.0.0-alpha04
open fun loadExrImageByByteArray(assetData: ByteArray, assetKey: String): ListenableFuture<ExrImageResource>

Loads an ExrImage from a provided byte array using the Split Engine route.

loadGltfByAssetName

Added in 1.0.0-alpha04
open fun loadGltfByAssetName(assetName: String): ListenableFuture<GltfModelResource>

Loads glTF Asset for the given asset name from the assets folder using the Split Engine route. The future returned by this method will fire listeners on the UI thread if Runnable::run is supplied.

loadGltfByByteArray

Added in 1.0.0-alpha04
open fun loadGltfByByteArray(assetData: ByteArray, assetKey: String): ListenableFuture<GltfModelResource>

Loads glTF Asset from a provided byte array. The future returned by this method will fire listeners on the UI thread if Runnable::run is supplied.

loadTexture

Added in 1.0.0-alpha04
open fun loadTexture(assetName: String, sampler: TextureSampler): ListenableFuture<TextureResource>?

Loads a texture resource for the given asset name or URL. The future returned by this method will fire listeners on the UI thread if Runnable::run is supplied.

removeSpatialCapabilitiesChangedListener

Added in 1.0.0-alpha04
open fun removeSpatialCapabilitiesChangedListener(
    listener: Consumer<SpatialCapabilities>
): Unit

Releases the given {@link Consumer} from receiving updates when the Session's {@link SpatialCapabilities} change.

requestFullSpaceMode

Added in 1.0.0-alpha04
open fun requestFullSpaceMode(): Unit

If the primary Activity for the Session that owns this object has focus, causes it to be placed in FullSpace Mode. Otherwise, this call does nothing.

requestHomeSpaceMode

Added in 1.0.0-alpha04
open fun requestHomeSpaceMode(): Unit

If the primary Activity for the Session that owns this object has focus, causes it to be placed in HomeSpace Mode. Otherwise, this call does nothing.

setAlphaMap

Added in 1.0.0-alpha04
open fun setAlphaMap(material: MaterialResource, alphaMap: TextureResource): Unit

Sets the alpha map for the water material.

setAlphaStepMultiplier

Added in 1.0.0-alpha04
open fun setAlphaStepMultiplier(
    material: MaterialResource,
    alphaStepMultiplier: Float
): Unit

Sets the alpha step multiplier for the water material.

setFullSpaceMode

Added in 1.0.0-alpha04
open fun setFullSpaceMode(bundle: Bundle): Bundle

Sets the full space mode flag to the given {@link Bundle}.

The {@link Bundle} then could be used to launch an {@link Activity} with requesting to enter full space mode through {@link Activity#startActivity}. If there's a bundle used for customizing how the {@link Activity} should be started by {@link ActivityOptions.toBundle} or {@link androidx.core.app.ActivityOptionsCompat.toBundle}, it's suggested to use the bundle to call this method.

The flag will be ignored when no {@link Intent.FLAG_ACTIVITY_NEW_TASK} is set in the bundle, or it is not started from a focused Activity context.

This flag is also ignored when the {@link android.window.PROPERTY_XR_ACTIVITY_START_MODE} property is set to a value other than XR_ACTIVITY_START_MODE_UNDEFINED in the AndroidManifest.xml file for the activity being launched.

Parameters
bundle: Bundle

the input bundle to set with the full space mode flag.

Returns
Bundle

the input {@code bundle} with the full space mode flag set.

setFullSpaceModeWithEnvironmentInherited

Added in 1.0.0-alpha04
open fun setFullSpaceModeWithEnvironmentInherited(bundle: Bundle): Bundle

Sets the inherit full space mode environment flag to the given {@link Bundle}.

The {@link Bundle} then could be used to launch an {@link Activity} with requesting to enter full space mode while inherit the existing environment through {@link Activity#startActivity}. If there's a bundle used for customizing how the {@link Activity} should be started by {@link ActivityOptions.toBundle} or {@link androidx.core.app.ActivityOptionsCompat.toBundle}, it's suggested to use the bundle to call this method.

When launched, the activity will be in full space mode and also inherits the environment from the launching activity. If the inherited environment needs to be animated, the launching activity has to continue updating the environment even after the activity is put into the stopped state.

The flag will be ignored when no {@link Intent.FLAG_ACTIVITY_NEW_TASK} is set in the intent, or it is not started from a focused Activity context.

The flag will also be ignored when there is no environment to inherit or the activity has its own environment set already.

This flag is ignored too when the {@link android.window.PROPERTY_XR_ACTIVITY_START_MODE} property is set to a value other than XR_ACTIVITY_START_MODE_UNDEFINED in the AndroidManifest.xml file for the activity being launched.

For security reasons, Z testing for the new activity is disabled, and the activity is always drawn on top of the inherited environment. Because Z testing is disabled, the activity should not spatialize itself.

Parameters
bundle: Bundle

the input bundle to set with the inherit full space mode environment flag.

Returns
Bundle

the input {@code bundle} with the inherit full space mode flag set.

setNormalBoundary

Added in 1.0.0-alpha04
open fun setNormalBoundary(material: MaterialResource, normalBoundary: Float): Unit

Sets the normal boundary for the water material.

setNormalMap

Added in 1.0.0-alpha04
open fun setNormalMap(material: MaterialResource, normalMap: TextureResource): Unit

Sets the normal map texture for the water material.

setNormalSpeed

Added in 1.0.0-alpha04
open fun setNormalSpeed(material: MaterialResource, normalSpeed: Float): Unit

Sets the normal speed for the water material.

setNormalTiling

Added in 1.0.0-alpha04
open fun setNormalTiling(material: MaterialResource, normalTiling: Float): Unit

Sets the normal tiling for the water material.

setNormalZ

Added in 1.0.0-alpha04
open fun setNormalZ(material: MaterialResource, normalZ: Float): Unit

Sets the normal z for the water material.

setPreferredAspectRatio

Added in 1.0.0-alpha04
open fun setPreferredAspectRatio(activity: Activity, preferredRatio: Float): Unit

Sets a preferred main panel aspect ratio for home space mode.

The ratio is only applied to the activity. If the activity launches another activity in the same task, the ratio is not applied to the new activity. Also, while the activity is in full space mode, the preference is temporarily removed.

If the activity's current aspect ratio differs from the {@code preferredRatio}, the panel is automatically resized. This resizing preserves the panel's area. To avoid runtime resizing, consider specifying the desired aspect ratio in your {@code AndroidManifest.xml}. This ensures your activity launches with the preferred aspect ratio from the start.

Parameters
activity: Activity

the activity to set the preference.

preferredRatio: Float

the aspect ratio determined by taking the panel's width over its height. A value <= 0.0f means there are no preferences.

setReflectionCube

Added in 1.0.0-alpha04
open fun setReflectionCube(
    material: MaterialResource,
    reflectionCube: TextureResource
): Unit

Sets the reflection cube texture for the water material.

setSpatialVisibilityChangedListener

Added in 1.0.0-alpha04
open fun setSpatialVisibilityChangedListener(
    callbackExecutor: Executor,
    listener: Consumer<SpatialVisibility>
): Unit

Sets the listener to be invoked when the spatial visibility of the rendered content of the entire scene (all entities, including children of anchors and activitySpace) changes within the user's field of view.

This API only checks if the bounds of the renderable content are within the user's field of view. It does not check if the rendered content is visible to the user. For example, if the user is looking straight ahead, and there's only a single invisible child entity (alpha = 0) in front of the user, this API will return SpatialVisibility.WITHIN_FOV even though the user cannot see anything.

The listener is invoked on the provided executor. If the app intends to modify the UI elements/views during the callback, the app should provide the thread executor that is appropriate for the UI operations. For example, if the app is using the main thread to render the UI, the app should provide the main thread (Looper.getMainLooper()) executor. If the app is using a separate thread to render the UI, the app should provide the executor for that thread.

There can only be one listener set at a time. If a new listener is set, the previous listener will be released.

Parameters
callbackExecutor: Executor

The executor to run the listener on.

listener: Consumer<SpatialVisibility>

The Consumer to be invoked asynchronously on the given callbackExecutor whenever the spatial visibility of the renderable content changes. The parameter passed to the Consumer’s accept method is the new value for SpatialVisibility.

startRenderer

Added in 1.0.0-alpha04
open fun startRenderer(): Unit

Starts the renderer.

stopRenderer

Added in 1.0.0-alpha04
open fun stopRenderer(): Unit

Stops the renderer.

Public properties

activitySpace

Added in 1.0.0-alpha04
open val activitySpaceActivitySpace

Returns the Activity Space entity at the root of the scene.

activitySpaceRootImpl

Added in 1.0.0-alpha04
open val activitySpaceRootImplEntity

Returns the entity that represents the ActivitySpace root.

SDK's factory methods are expected to use this entity as the default parent for all content entities when no parent is specified.

audioTrackExtensionsWrapper

Added in 1.0.0-alpha04
open val audioTrackExtensionsWrapperAudioTrackExtensionsWrapper

Returns a AudioTrackExtensionsWrapper instance.

headActivityPose

Added in 1.0.0-alpha04
open val headActivityPoseHeadActivityPose?

Returns the HeadActivityPose for the session or null if it not ready.

mainPanelEntity

Added in 1.0.0-alpha04
open val mainPanelEntityPanelEntity

Get the PanelEntity associated with the main window for the Runtime.

mediaPlayerExtensionsWrapper

Added in 1.0.0-alpha04
open val mediaPlayerExtensionsWrapperMediaPlayerExtensionsWrapper

Returns a MediaPlayerExtensionsWrapper instance.

perceptionSpaceActivityPose

Added in 1.0.0-alpha04
open val perceptionSpaceActivityPosePerceptionSpaceActivityPose

Returns the PerceptionSpaceActivityPose for the Session.

soundPoolExtensionsWrapper

Added in 1.0.0-alpha04
open val soundPoolExtensionsWrapperSoundPoolExtensionsWrapper

Returns a SoundPoolExtensionsWrapper instance.

spatialCapabilities

Added in 1.0.0-alpha04
open val spatialCapabilitiesSpatialCapabilities

Return the Spatial Capabilities set that are currently supported by the platform.

spatialEnvironment

Added in 1.0.0-alpha04
open val spatialEnvironmentSpatialEnvironment

Returns the Environment for the Session.