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

ControllerPose Class

Modifiers: final
Experimental api that represents a controller's pose with additional tracking state information.
The tracking state is represented as bit flags in the ControllerPose.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

Signature

data class ControllerPose(val pose: Pose, val flags: Int)

Constructors

ControllerPose ( pose , flags ) : ControllerPose
Signature
constructor(pose: Pose, flags: Int)
Parameters
pose: Pose
The position and orientation of the controller
flags: Int
Bit flags indicating the tracking state of the controller

Properties

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

Companion Object

Companion Object Properties

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
Did you find this page helpful?
Thumbs up icon
Thumbs down icon