ActivitySpaceTester
public final class ActivitySpaceTester
A test-only data accessor for ActivitySpace that enables direct manipulation and inspection of its internal state.
Summary
Public methods |
|
|---|---|
final HitTestResult |
The |
final @NonNull BoundingBox |
The recommended box for content to be placed in when in Full Space Mode. |
final void |
setHitTestResult(HitTestResult value)The |
final void |
The recommended box for content to be placed in when in Full Space Mode. |
final void |
triggerOnBoundsChanged(@NonNull FloatSize3d bounds)Sets the |
final void |
Simulates a change to the underlying space's origin. |
Public methods
getHitTestResult
public final HitTestResult getHitTestResult()
The HitTestResult to be returned by subsequent calls to ActivitySpace.hitTest.
This property is typically used for testing or simulation purposes, allowing you to define the outcome of hit tests performed within the ActivitySpace.
Setting a non-null value describes the location and normal of the closest object hit, relative to the origin of the hit test ray. Set to null to simulate the hit test not intersecting with any objects.
getRecommendedContentBoxInFullSpace
public final @NonNull BoundingBox getRecommendedContentBoxInFullSpace()
The recommended box for content to be placed in when in Full Space Mode.
The box is relative to the ActivitySpace's coordinate system. It is not scaled by the ActivitySpace's transform. The dimensions are always in meters. This provides a device-specific default volume that developers can use to size their content appropriately.
setHitTestResult
public final void setHitTestResult(HitTestResult value)
The HitTestResult to be returned by subsequent calls to ActivitySpace.hitTest.
This property is typically used for testing or simulation purposes, allowing you to define the outcome of hit tests performed within the ActivitySpace.
Setting a non-null value describes the location and normal of the closest object hit, relative to the origin of the hit test ray. Set to null to simulate the hit test not intersecting with any objects.
setRecommendedContentBoxInFullSpace
public final void setRecommendedContentBoxInFullSpace(@NonNull BoundingBox value)
The recommended box for content to be placed in when in Full Space Mode.
The box is relative to the ActivitySpace's coordinate system. It is not scaled by the ActivitySpace's transform. The dimensions are always in meters. This provides a device-specific default volume that developers can use to size their content appropriately.
triggerOnBoundsChanged
public final void triggerOnBoundsChanged(@NonNull FloatSize3d bounds)
Sets the ActivitySpace bounds, invoking all registered listeners with the new bounds.
| Parameters | |
|---|---|
@NonNull FloatSize3d bounds |
The new bounds to propagate to the listeners. |
triggerOnOriginChanged
public final void triggerOnOriginChanged()
Simulates a change to the underlying space's origin.
This function manually triggers any listeners registered via ActivitySpace.addOriginChangedListener, allowing tests to verify that the application correctly responds to spatial updates from the system.