FollowTarget

sealed interface FollowTarget


A FollowTarget can be used with androidx.xr.compose.spatial.FollowingSubspace to have a set of content follow a target such as an anchor or AR device.

Summary

Public companion functions

FollowTarget
Anchor(anchorEntity: AnchorEntity)

Targeting an anchor allows content to be positioned relative to that anchor's location.

FollowTarget
ArDevice(session: Session)

By designating content to follow the AR device, it will keep that content near the device camera and typically within the field of view, even as the device moves around.

Public companion functions

Anchor

Added in 1.0.0-alpha15
fun Anchor(anchorEntity: AnchorEntity): FollowTarget

Targeting an anchor allows content to be positioned relative to that anchor's location.

Parameters
anchorEntity: AnchorEntity

represents the anchor which this androidx.xr.compose.spatial.FollowingSubspace will be tethered to. As the anchor moves, so will the androidx.xr.compose.spatial.FollowingSubspace

ArDevice

Added in 1.0.0-alpha15
fun ArDevice(session: Session): FollowTarget

By designating content to follow the AR device, it will keep that content near the device camera and typically within the field of view, even as the device moves around.

The Session is required to access the device's tracking state and to perform pose transformations between coordinate spaces.

Parameters
session: Session

The current Session instance used to track the device and transform poses.