// 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
data class ControllerPose(val pose: Pose, val flags: Int)
ControllerPose
(
pose
,
flags
)
:
ControllerPose |
Signature
constructor(pose: Pose, flags: Int) Parameters
pose:
Pose
flags:
Int
Returns |
flags
:
Int
[Get] |
Bit flags indicating the tracking state of the controller
Signature
val flags: Int |
pose
:
Pose [Get] |
The position and orientation of the controller
Signature
val pose: Pose |
LocationTrackedBit
:
Int
[Get] |
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.
Signature
const val LocationTrackedBit: Int = 2 |
LocationValidBit
:
Int
[Get] |
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.
Signature
const val LocationValidBit: Int = 1 |
OrientationTrackedBit
:
Int
[Get] |
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.
Signature
const val OrientationTrackedBit: Int = 8 |
OrientationValidBit
:
Int
[Get] |
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.
Signature
const val OrientationValidBit: Int = 4 |
TrackedBits
:
Int
[Get] |
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.
Signature
const val TrackedBits: Int |
ValidBits
:
Int
[Get] |
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.
Signature
const val ValidBits: Int |