1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

XRNode - fix visibility issue

This commit is contained in:
Bastiaan Olij
2024-08-20 11:43:07 +10:00
parent ff9bc04223
commit 620cc30f2a
3 changed files with 24 additions and 4 deletions

View File

@@ -225,6 +225,7 @@ void OpenXRHandTrackingExtension::on_process() {
// not successful? then we do nothing.
print_line("OpenXR: Failed to get tracking for hand", i, "[", OpenXRAPI::get_singleton()->get_error_string(result), "]");
godot_tracker->set_has_tracking_data(false);
godot_tracker->invalidate_pose("default");
continue;
}
@@ -235,8 +236,6 @@ void OpenXRHandTrackingExtension::on_process() {
}
if (hand_trackers[i].locations.isActive) {
godot_tracker->set_has_tracking_data(true);
// SKELETON_RIG_HUMANOID bone adjustment. This rotation performs:
// OpenXR Z+ -> Godot Humanoid Y- (Back along the bone)
// OpenXR Y+ -> Godot Humanoid Z- (Out the back of the hand)
@@ -293,7 +292,8 @@ void OpenXRHandTrackingExtension::on_process() {
}
godot_tracker->set_hand_tracking_source(source);
if (location.locationFlags & XR_SPACE_LOCATION_POSITION_TRACKED_BIT) {
if (location.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT) {
godot_tracker->set_has_tracking_data(true);
godot_tracker->set_pose("default", transform, linear_velocity, angular_velocity);
} else {
godot_tracker->set_has_tracking_data(false);