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-alpha11
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-alpha11
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.

Parameters
session: Session

The current Session instance.