SpatialEnvironmentTester


class SpatialEnvironmentTester


A test utility for accessing and inspecting the spatial data associated with the SpatialEnvironment.

Summary

Public functions

Unit
triggerPassthroughOpacityChanged(
    opacity: @FloatRange(from = 0.0, to = 1.0) Float
)

Simulates a change in the user-visible passthrough opacity, notifying all registered listeners.

Unit

Simulates a change in the active state of the preferred spatial environment, notifying all registered listeners.

Public functions

triggerPassthroughOpacityChanged

Added in 1.0.0-alpha16
fun triggerPassthroughOpacityChanged(
    opacity: @FloatRange(from = 0.0, to = 1.0) Float
): Unit

Simulates a change in the user-visible passthrough opacity, notifying all registered listeners.

This affects the value returned by SpatialEnvironment.currentPassthroughOpacity and triggers callbacks registered via SpatialEnvironment.addPassthroughOpacityChangedListener.

A value of 0.0f means no passthrough is shown, and a value of 1.0f means the passthrough completely obscures the spatial environment geometry and skybox.

Parameters
opacity: @FloatRange(from = 0.0, to = 1.0) Float

The current passthrough opacity value between 0.0f and 1.0f.

triggerSpatialEnvironmentChanged

Added in 1.0.0-alpha16
fun triggerSpatialEnvironmentChanged(active: Boolean): Unit

Simulates a change in the active state of the preferred spatial environment, notifying all registered listeners.

This affects the value returned by SpatialEnvironment.isPreferredSpatialEnvironmentActive and triggers callbacks registered via SpatialEnvironment.addSpatialEnvironmentChangedListener.

Parameters
active: Boolean

True if the environment preference is active.