BaseActivityPose


abstract class BaseActivityPose<RtActivityPoseType : ActivityPose> : ActivityPose

Known direct subclasses
BaseEntity

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

CameraView

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

Head

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

PerceptionSpace

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

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.

BasePanelEntity

Provides implementations for common Panel functionality.

ContentlessEntity

An Entity that itself has no content.

GltfModelEntity

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

PanelEntity

PanelEntity creates a spatial panel in Android XR.

SurfaceEntity

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


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

Summary

Public constructors

<RtActivityPoseType : ActivityPose> BaseActivityPose(
    rtActivityPose: RtActivityPoseType
)

Public functions

open Pose

Returns the activity space pose for this ActivityPose.

open ListenableFuture<HitTestResult>
hitTestAsync(origin: Vector3, direction: Vector3)

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

open ListenableFuture<HitTestResult>
hitTestAsync(
    origin: Vector3,
    direction: Vector3,
    @ActivityPose.HitTestFilterValue hitTestFilter: Int
)

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

open Pose
transformPoseTo(pose: Pose, destination: ActivityPose)

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

Public constructors

BaseActivityPose

<RtActivityPoseType : ActivityPose> BaseActivityPose(
    rtActivityPose: RtActivityPoseType
)

Public functions

getActivitySpacePose

open fun getActivitySpacePose(): Pose

Returns the activity space pose for this ActivityPose.

Returns
Pose

Current Pose relative to the activity space root.

hitTestAsync

open fun hitTestAsync(origin: Vector3, direction: Vector3): ListenableFuture<HitTestResult>

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

Parameters
origin: Vector3

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

direction: Vector3

The direction for the hit test ray from the origin.

Returns
ListenableFuture<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

open fun hitTestAsync(
    origin: Vector3,
    direction: Vector3,
    @ActivityPose.HitTestFilterValue hitTestFilter: Int
): ListenableFuture<HitTestResult>

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

Parameters
origin: Vector3

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

direction: Vector3

The direction for the hit test ray from the origin

@ActivityPose.HitTestFilterValue hitTestFilter: Int

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

Returns
ListenableFuture<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

open fun transformPoseTo(pose: Pose, destination: ActivityPose): Pose

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

Parameters
pose: Pose

A pose in this ActivityPose's local coordinate space.

destination: ActivityPose

The ActivityPose which the returned pose will be relative to.

Returns
Pose

The pose relative to the destination ActivityPose.