C Specification

The application can chain an XrHandJointVelocitiesEXT structure to the next pointer of XrHandJointLocationsEXT when calling xrLocateHandJointsEXT to retrieve the hand joint velocities.

// Provided by XR_EXT_hand_tracking
typedef struct XrHandJointVelocitiesEXT {
    XrStructureType            type;
    void*                      next;
    uint32_t                   jointCount;
    XrHandJointVelocityEXT*    jointVelocities;
} XrHandJointVelocitiesEXT;

Members

Member Descriptions
  • type is the XrStructureType of this structure.

  • next is NULL or a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.

  • jointCount is a uint32_t describing the number of elements in jointVelocities array.

  • jointVelocities is an array of XrHandJointVelocityEXT receiving the returned hand joint velocities.

Description

The application must allocate the memory for the output array jointVelocities that can contain at least jointCount of XrHandJointVelocityEXT.

The application must input jointCount as described by the XrHandJointSetEXT when creating the XrHandTrackerEXT. Otherwise, the runtime must return XR_ERROR_VALIDATION_FAILURE.

The runtime must update the jointVelocities array in the order so that the application can index elements using the corresponding hand joint enum (e.g. XrHandJointEXT) as described by the XrHandJointSetEXT when creating the XrHandTrackerEXT. For example, when the XrHandTrackerEXT is created with XR_HAND_JOINT_SET_DEFAULT_EXT, the application must set the jointCount to XR_HAND_JOINT_COUNT_EXT, and the returned jointVelocities array must be ordered to be indexed by enum XrHandJointEXT enum.

If the returned XrHandJointLocationsEXT::isActive is false, it indicates the hand tracker did not detect a hand input or the application lost input focus. In this case, the runtime must return all jointVelocities with neither XR_SPACE_VELOCITY_LINEAR_VALID_BIT nor XR_SPACE_VELOCITY_ANGULAR_VALID_BIT set.

If an XrHandJointVelocitiesEXT structure is chained to XrHandJointLocationsEXT::next, the returned XrHandJointLocationsEXT::isActive is true, and the velocity is observed or can be calculated by the runtime, the runtime must fill in the linear velocity of each hand joint within the reference frame of XrHandJointsLocateInfoEXT::baseSpace and set the XR_SPACE_VELOCITY_LINEAR_VALID_BIT. Similarly, if an XrHandJointVelocitiesEXT structure is chained to XrHandJointLocationsEXT::next, the returned XrHandJointLocationsEXT::isActive is true, and the angular velocity is observed or can be calculated by the runtime, the runtime must fill in the angular velocity of each joint within the reference frame of XrHandJointsLocateInfoEXT::baseSpace and set the XR_SPACE_VELOCITY_ANGULAR_VALID_BIT.

Valid Usage (Implicit)

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2024, The Khronos Group Inc.