API reference
API reference
Select your platform
No SDKs available
No versions available

ControllerPose

ControllerPose

data class ControllerPose(val pose: Pose, val flags: Int)
Experimental api that represents a controller’s pose with additional tracking state information.
The tracking state is represented as bit flags in the flags property, which can be checked using the bit constants defined in the companion object.
Example usage:
// Get the controller pose
val controllerPose = scene.getControllerPoseAtTime(isLeftHand, timestamp)

// Check if position data is valid and tracked
val isPositionValid = (controllerPose.flags and ControllerPose.LocationValidBit) != 0
val isPositionTracked = (controllerPose.flags and ControllerPose.LocationTrackedBit) != 0

// Check if orientation data is valid and tracked
val isOrientationValid = (controllerPose.flags and ControllerPose.OrientationValidBit) != 0
val isOrientationTracked = (controllerPose.flags and ControllerPose.OrientationTrackedBit) != 0

// Check if both position and orientation are valid
val isPoseValid = (controllerPose.flags and ControllerPose.ValidBits) == ControllerPose.ValidBits

// Check if both position and orientation are tracked
val isPoseTracked = (controllerPose.flags and ControllerPose.TrackedBits) == ControllerPose.TrackedBits

Constructors

NameSummary
ControllerPose
constructor(pose: Pose, flags: Int)

Types

NameSummary
Companion
object Companion

Properties

NameSummary
flags
val flags: Int

Bit flags indicating the tracking state of the controller
pose
val pose: Pose

The position and orientation of the controller

Companion

object Companion

Properties

NameSummary
LocationTrackedBit
const val LocationTrackedBit: Int = 2

Bit flag indicating that the controller’s position (location) is actively tracked. When this bit is set, the position is being updated in real-time by the tracking system.
LocationValidBit
const val LocationValidBit: Int = 1

Bit flag indicating that the controller’s position (location) is valid. When this bit is set, the position data in the pose can be considered reliable.
OrientationTrackedBit
const val OrientationTrackedBit: Int = 8

Bit flag indicating that the controller’s orientation is actively tracked. When this bit is set, the orientation is being updated in real-time by the tracking system.
OrientationValidBit
const val OrientationValidBit: Int = 4

Bit flag indicating that the controller’s orientation is valid. When this bit is set, the orientation data in the pose can be considered reliable.
TrackedBits
const val TrackedBits: Int

Combined bit mask for checking if both position and orientation are actively tracked. Use this to check if the entire pose (position and orientation) is being tracked in real-time.
ValidBits
const val ValidBits: Int

Combined bit mask for checking if both position and orientation are valid. Use this to check if the entire pose (position and orientation) is valid.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon