public interface ScenePose

Known direct subclasses
ActivitySpace

ActivitySpace is an Entity used to track the system-managed pose and boundary of the volume associated with a spatialized Activity.

AnchorEntity

An AnchorEntity tracks a androidx.xr.runtime.math.Pose relative to some position or surface in the "Real World." Children of this Entity will remain positioned relative to that location in the real world, for the purposes of creating Augmented Reality experiences.

CameraView

An ScenePose which tracks a camera view's position and view into physical space.

Entity

Interface for a spatial Entity.

GltfModelEntity

GltfModelEntity is a concrete implementation of Entity that hosts a glTF model.

GroupEntity

An Entity that contains no content, but can have an arbitrary number of children.

Head

Head is an ScenePose used to track the position of the user's head.

PanelEntity

PanelEntity contains an arbitrary 2D Android View, within a spatialized XR scene.

PerceptionSpace

PerceptionSpace is an ScenePose used to track the origin of the space used by ARCore for Jetpack XR APIs.

SurfaceEntity

SurfaceEntity is a concrete implementation of Entity that hosts a StereoSurface Canvas.

Known indirect subclasses
ActivityPanelEntity

ActivityPanelEntity creates a spatial panel for embedding an Activity in Android XR.

ActivitySpace

ActivitySpace is an Entity used to track the system-managed pose and boundary of the volume associated with a spatialized Activity.

AnchorEntity

An AnchorEntity tracks a androidx.xr.runtime.math.Pose relative to some position or surface in the "Real World." Children of this Entity will remain positioned relative to that location in the real world, for the purposes of creating Augmented Reality experiences.

GltfModelEntity

GltfModelEntity is a concrete implementation of Entity that hosts a glTF model.

GroupEntity

An Entity that contains no content, but can have an arbitrary number of children.

MainPanelEntity

Represents the main spatialized panel in a Scene.

PanelEntity

PanelEntity contains an arbitrary 2D Android View, within a spatialized XR scene.

SurfaceEntity

SurfaceEntity is a concrete implementation of Entity that hosts a StereoSurface Canvas.


A Pose in the Scene graph, which can be transformed into a Pose relative to another ScenePose.

Summary

Nested types

public static class ScenePose.HitTestFilter

A filter for which Scenes to hit test with ScenePose.hitTest.

Public methods

abstract @NonNull Pose

The current Pose relative to the activity space root.

abstract @NonNull HitTestResult
hitTest(@NonNull Vector3 origin, @NonNull Vector3 direction)

Creates a hit test from the specified origin in the specified direction into the Scene.

abstract @NonNull HitTestResult
hitTest(
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int hitTestFilter
)

Creates a hit test from the specified origin in the specified direction into the scene.

abstract @NonNull Pose
transformPoseTo(@NonNull Pose pose, @NonNull ScenePose destination)

Returns a Pose relative to this ScenePose, transformed into a Pose relative to the destination.

Extension functions

default final @NonNull ListenableFuture<@NonNull HitTestResult>
GuavaScenePose.hitTestAsync(
    @NonNull ScenePose receiver,
    @NonNull Session session,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction
)

Creates a HitTestResult from the specified origin in the specified direction into the scene.

default final @NonNull ListenableFuture<@NonNull HitTestResult>
GuavaScenePose.hitTestAsync(
    @NonNull ScenePose receiver,
    @NonNull Session session,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int hitTestFilter
)

Creates a HitTestResult from the specified origin in the specified direction into the scene.

Public methods

getActivitySpacePose

Added in 1.0.0-alpha05
abstract @NonNull Pose getActivitySpacePose()

The current Pose relative to the activity space root.

hitTest

abstract @NonNull HitTestResult hitTest(@NonNull Vector3 origin, @NonNull Vector3 direction)

Creates a hit test from the specified origin in the specified direction into the Scene.

Parameters
@NonNull Vector3 origin

The translation of the origin of the hit test relative to this ScenePose.

@NonNull Vector3 direction

The direction for the hit test ray from the origin.

Returns
@NonNull HitTestResult

a HitResult. The HitResult describes if it hit something and where relative to this ScenePose.

hitTest

abstract @NonNull HitTestResult hitTest(
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int hitTestFilter
)

Creates a hit test from the specified origin in the specified direction into the scene.

Parameters
@NonNull Vector3 origin

The translation of the origin of the hit test relative to this ScenePose.

@NonNull Vector3 direction

The direction for the hit test ray from the origin

int hitTestFilter

Filter for which scenes to hit test. Hitting other scenes is only allowed for apps with the com.android.extensions.xr.ACCESS_XR_OVERLAY_SPACE permission.

Returns
@NonNull HitTestResult

a HitResult. The HitResult describes if it hit something and where relative to this ScenePose.

transformPoseTo

Added in 1.0.0-alpha05
abstract @NonNull Pose transformPoseTo(@NonNull Pose pose, @NonNull ScenePose destination)

Returns a Pose relative to this ScenePose, transformed into a Pose relative to the destination.

Parameters
@NonNull Pose pose

A Pose in this ScenePose's local coordinate space.

@NonNull ScenePose destination

The ScenePose which the returned Pose will be relative to.

Returns
@NonNull Pose

The Pose relative to the destination ScenePose.

Extension functions

GuavaScenePose.hitTestAsync

default final @NonNull ListenableFuture<@NonNull HitTestResultGuavaScenePose.hitTestAsync(
    @NonNull ScenePose receiver,
    @NonNull Session session,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction
)

Creates a HitTestResult from the specified origin in the specified direction into the scene.

Parameters
@NonNull Session session

The session the ScenePose is in.

@NonNull Vector3 origin

The translation of the origin of the hit test relative to this ScenePose.

@NonNull Vector3 direction

The direction for the hit test ray from the origin.

Returns
@NonNull ListenableFuture<@NonNull HitTestResult>

a ListenableFuture. The HitResult describes if it hit something and where relative to this ScenePose. Listeners will be called on the main thread if Runnable::run is supplied.

GuavaScenePose.hitTestAsync

default final @NonNull ListenableFuture<@NonNull HitTestResultGuavaScenePose.hitTestAsync(
    @NonNull ScenePose receiver,
    @NonNull Session session,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int hitTestFilter
)

Creates a HitTestResult from the specified origin in the specified direction into the scene.

Parameters
@NonNull Session session

The session the ScenePose is in.

@NonNull Vector3 origin

The translation of the origin of the hit test relative to this ScenePose.

@NonNull Vector3 direction

The direction for the hit test ray from the origin

int hitTestFilter

Filter for which scenes to hit test. Hitting other scenes is only allowed for apps with the com.android.extensions.xr.ACCESS_XR_OVERLAY_SPACE permission.

Returns
@NonNull ListenableFuture<@NonNull HitTestResult>

a ListenableFuture. The HitResult describes if it hit something and where relative to this ScenePose. Listeners will be called on the main thread if Runnable::run is supplied.