class SceneTester


A test utility for accessing and inspecting the data associated with the androidx.xr.scenecore.Scene.

Summary

Public functions

open operator Boolean
equals(other: Any?)
open Int
Unit

Simulates a runtime spatial mode change by dispatching the provided SpaceChangeEvent to the Scene.

Unit

Invoking this function simulates a runtime visibility change.

Public properties

PanelClippingConfig

The current clipping configuration of all panels in the Scene.

Set<SpatialCapability>

Simulates the spatial capabilities of the Session.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

triggerSpaceChanged

Added in 1.0.0-alpha16
fun triggerSpaceChanged(spaceChangeEvent: SpaceChangeEvent): Unit

Simulates a runtime spatial mode change by dispatching the provided SpaceChangeEvent to the Scene.

This will trigger the custom listener registered via Scene.setSpaceChangedListener. If no custom listener is registered, or if it has been cleared via Scene.clearSpaceChangedListener, this invokes the default internal listener which automatically applies the recommended pose and scale from the event to the Scene.keyEntity.

Note: The listener is executed asynchronously on the java.util.concurrent.Executor configured for the listener (defaults to the main thread).

Parameters
spaceChangeEvent: SpaceChangeEvent

The simulated SpaceChangeEvent containing the recommended pose and scale to dispatch.

triggerSpatialVisibilityChanged

Added in 1.0.0-alpha16
fun triggerSpatialVisibilityChanged(spatialVisibility: SpatialVisibility): Unit

Invoking this function simulates a runtime visibility change. This is useful for testing how the application handles transitions between different visibility states (e.g., releasing resources when HIDDEN).

Invoking this function will trigger any listeners registered via Scene.addSpatialVisibilityChangedListener.

Public properties

panelClippingConfig

Added in 1.0.0-alpha16
val panelClippingConfigPanelClippingConfig

The current clipping configuration of all panels in the Scene.

This property reflects the result of setting the Scene.panelClippingConfig value.

spatialCapabilities

Added in 1.0.0-alpha16
var spatialCapabilitiesSet<SpatialCapability>

Simulates the spatial capabilities of the Session.

This property's value changes in response to calls to Scene.requestFullSpaceMode and Scene.requestHomeSpaceMode. Any listeners registered via Scene.addSpatialCapabilitiesChangedListener are triggered upon a change in this value.