BaseScenePose


abstract class BaseScenePose<RtActivityPoseType : ActivityPose> : ScenePose

Known direct subclasses
BaseEntity

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

CameraView

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

Head

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

PerceptionSpace

PerceptionSpace is an ScenePose used to track the origin of the space used by ARCore for Jetpack 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 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.


The BaseScenePose implements the ScenePose interface.

Summary

Protected constructors

<RtActivityPoseType : ActivityPose> BaseScenePose(
    rtActivityPose: RtActivityPoseType
)

Public functions

open suspend HitTestResult
hitTest(origin: Vector3, direction: Vector3)

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

open suspend HitTestResult
hitTest(origin: Vector3, direction: Vector3, hitTestFilter: Int)

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

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

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

Public properties

open Pose

The current Pose relative to the activity space root.

Protected constructors

BaseScenePose

protected <RtActivityPoseType : ActivityPose> BaseScenePose(
    rtActivityPose: RtActivityPoseType
)

Public functions

hitTest

open suspend fun hitTest(origin: Vector3, direction: Vector3): 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 ScenePose.

direction: Vector3

The direction for the hit test ray from the origin.

Returns
HitTestResult

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

hitTest

open suspend fun hitTest(origin: Vector3, direction: Vector3, hitTestFilter: Int): 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 ScenePose.

direction: Vector3

The direction for the hit test ray from the origin

hitTestFilter: Int

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
HitTestResult

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

transformPoseTo

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

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

Parameters
pose: Pose

A Pose in this ScenePose's local coordinate space.

destination: ScenePose

The ScenePose which the returned Pose will be relative to.

Returns
Pose

The Pose relative to the destination ScenePose.

Public properties

activitySpacePose

open val activitySpacePosePose

The current Pose relative to the activity space root.