Also report controller tracked if valid data is provided
@@ -549,11 +549,13 @@ void oxri_update_frame() {
XrResult res = xrLocateSpace(xrc_space_grip[hand], xr_app_space, xr_time, &space_location);
bool tracked_pos = false;
bool tracked_rot = false;
+ bool valid_pos = false;
+ bool valid_rot = false;
if (XR_UNQUALIFIED_SUCCESS(res)) {
tracked_pos = (space_location.locationFlags & XR_SPACE_LOCATION_POSITION_TRACKED_BIT) != 0;
tracked_rot = (space_location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT) != 0;
- bool valid_pos = (space_location.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT) != 0;
- bool valid_rot = (space_location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT) != 0;
+ valid_pos = (space_location.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT) != 0;
+ valid_rot = (space_location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT) != 0;
if (valid_pos) {
vec3 local_pos;
memcpy(&local_pos, &space_location.pose.position, sizeof(vec3));
@@ -567,7 +569,7 @@ void oxri_update_frame() {
input_controllers[hand].tracked_pos = tracked_pos ? track_state_known : (valid_pos ? track_state_inferred : track_state_lost);
input_controllers[hand].tracked_rot = tracked_rot ? track_state_known : (valid_rot ? track_state_inferred : track_state_lost);
}
- input_controllers[hand].tracked = button_make_state(input_controllers[hand].tracked & button_state_active, (tracked_pos || tracked_rot));
+ input_controllers[hand].tracked = button_make_state(input_controllers[hand].tracked & button_state_active, (tracked_pos || tracked_rot || valid_pos || valid_rot));
// Controller aim pose
XrActionStatePose state_aim = { XR_TYPE_ACTION_STATE_POSE };
