data class ControllerPose(val pose: Pose, val flags: Int)
// 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
| Name | Summary |
|---|---|
ControllerPose | constructor(pose: Pose, flags: Int) |
| Name | Summary |
|---|---|
Companion | object Companion |
| Name | Summary |
|---|---|
flags | val flags: Int Bit flags indicating the tracking state of the controller |
pose |
object Companion
| Name | Summary |
|---|---|
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. |