public interface ActivityPose

Known direct subclasses
BaseActivityPose

The BaseActivityPose is an implementation of ActivityPose interface that wraps a platformAdapter ActivityPose.

Entity

Interface for a spatial Entity.

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 this Spatialized Activity.

AnchorEntity

An AnchorEntity is created to track a 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.

BaseEntity

The BaseEntity is an implementation of Entity interface that wraps a platform entity.

BasePanelEntity

Provides implementations for common Panel functionality.

CameraView

A ActivityPose which tracks a camera's position and view into physical space.

ContentlessEntity

An Entity that itself has no content.

GltfModelEntity

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

Head

Head is a ActivityPose used to track the position of the user's head.

PanelEntity

PanelEntity creates a spatial panel in Android XR.

PerceptionSpace

PerceptionSpace is ActivityPose used to track the origin of the space used by ARCore for XR APIs.

SurfaceEntity

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


Interface for a ActivityPose.

A ActivityPose contains a pose in activity space and it's pose can be transformed into a pose relative to another ActivityPose.

Summary

Nested types

public static class ActivityPose.HitTestFilter

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

@Retention(value = AnnotationRetention.SOURCE)
@IntDef(flag = true, value = [1, 2])
public annotation ActivityPose.HitTestFilterValue

Public methods

abstract @NonNull Pose

Returns the activity space pose for this ActivityPose.

abstract @NonNull ListenableFuture<@NonNull HitTestResult>
hitTestAsync(@NonNull Vector3 origin, @NonNull Vector3 direction)

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

abstract @NonNull ListenableFuture<@NonNull HitTestResult>
hitTestAsync(
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    @ActivityPose.HitTestFilterValue int hitTestFilter
)

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

abstract @NonNull Pose

Returns a pose relative to this ActivityPose transformed into a pose relative to the destination.

Public methods

getActivitySpacePose

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

Returns the activity space pose for this ActivityPose.

Returns
@NonNull Pose

Current Pose relative to the activity space root.

hitTestAsync

Added in 1.0.0-alpha04
abstract @NonNull ListenableFuture<@NonNull HitTestResulthitTestAsync(@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 ActivityPose.

@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 ActivityPose. Listeners will be called on the main thread if Runnable::run is supplied.

hitTestAsync

Added in 1.0.0-alpha04
abstract @NonNull ListenableFuture<@NonNull HitTestResulthitTestAsync(
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    @ActivityPose.HitTestFilterValue 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 ActivityPose.

@NonNull Vector3 direction

The direction for the hit test ray from the origin

@ActivityPose.HitTestFilterValue int hitTestFilter

Filter for which scenes to hit test. Hitting other scenes is only allowed for apps with the android.permission.ACCESS_OVERLAY_SPACE permission.

Returns
@NonNull ListenableFuture<@NonNull HitTestResult>

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

transformPoseTo

Added in 1.0.0-alpha04
abstract @NonNull Pose transformPoseTo(@NonNull Pose pose, @NonNull ActivityPose destination)

Returns a pose relative to this ActivityPose transformed into a pose relative to the destination.

Parameters
@NonNull Pose pose

A pose in this ActivityPose's local coordinate space.

@NonNull ActivityPose destination

The ActivityPose which the returned pose will be relative to.

Returns
@NonNull Pose

The pose relative to the destination ActivityPose.