mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge commit godotengine/godot@b9437c3938
This commit is contained in:
@@ -289,6 +289,13 @@ void OpenXRInterface::_load_action_map() {
|
||||
if (ip.is_valid()) {
|
||||
openxr_api->interaction_profile_clear_bindings(ip);
|
||||
|
||||
for (Ref<OpenXRBindingModifier> xr_binding_modifier : xr_interaction_profile->get_binding_modifiers()) {
|
||||
PackedByteArray bm = xr_binding_modifier->get_ip_modification();
|
||||
if (!bm.is_empty()) {
|
||||
openxr_api->interaction_profile_add_modifier(ip, bm);
|
||||
}
|
||||
}
|
||||
|
||||
Array xr_bindings = xr_interaction_profile->get_bindings();
|
||||
for (int j = 0; j < xr_bindings.size(); j++) {
|
||||
Ref<OpenXRIPBinding> xr_binding = xr_bindings[j];
|
||||
@@ -302,7 +309,18 @@ void OpenXRInterface::_load_action_map() {
|
||||
continue;
|
||||
}
|
||||
|
||||
openxr_api->interaction_profile_add_binding(ip, action->action_rid, xr_binding->get_binding_path());
|
||||
int binding_no = openxr_api->interaction_profile_add_binding(ip, action->action_rid, xr_binding->get_binding_path());
|
||||
if (binding_no >= 0) {
|
||||
for (Ref<OpenXRBindingModifier> xr_binding_modifier : xr_binding->get_binding_modifiers()) {
|
||||
// Binding modifiers on bindings can be added to the interaction profile.
|
||||
PackedByteArray bm = xr_binding_modifier->get_ip_modification();
|
||||
if (!bm.is_empty()) {
|
||||
openxr_api->interaction_profile_add_modifier(ip, bm);
|
||||
}
|
||||
|
||||
// And possibly in the future on the binding itself, we're just preparing for that eventuality.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now submit our suggestions
|
||||
@@ -595,8 +613,8 @@ void OpenXRInterface::free_trackers() {
|
||||
void OpenXRInterface::free_interaction_profiles() {
|
||||
ERR_FAIL_NULL(openxr_api);
|
||||
|
||||
for (int i = 0; i < interaction_profiles.size(); i++) {
|
||||
openxr_api->interaction_profile_free(interaction_profiles[i]);
|
||||
for (const RID &interaction_profile : interaction_profiles) {
|
||||
openxr_api->interaction_profile_free(interaction_profile);
|
||||
}
|
||||
interaction_profiles.clear();
|
||||
}
|
||||
@@ -1055,6 +1073,30 @@ RID OpenXRInterface::get_depth_texture() {
|
||||
}
|
||||
}
|
||||
|
||||
RID OpenXRInterface::get_velocity_texture() {
|
||||
if (openxr_api) {
|
||||
return openxr_api->get_velocity_texture();
|
||||
} else {
|
||||
return RID();
|
||||
}
|
||||
}
|
||||
|
||||
RID OpenXRInterface::get_velocity_depth_texture() {
|
||||
if (openxr_api) {
|
||||
return openxr_api->get_velocity_depth_texture();
|
||||
} else {
|
||||
return RID();
|
||||
}
|
||||
}
|
||||
|
||||
Size2i OpenXRInterface::get_velocity_target_size() {
|
||||
if (openxr_api) {
|
||||
return openxr_api->get_velocity_target_size();
|
||||
} else {
|
||||
return Size2i();
|
||||
}
|
||||
}
|
||||
|
||||
void OpenXRInterface::handle_hand_tracking(const String &p_path, OpenXRHandTrackingExtension::HandTrackedHands p_hand) {
|
||||
OpenXRHandTrackingExtension *hand_tracking_ext = OpenXRHandTrackingExtension::get_singleton();
|
||||
if (hand_tracking_ext && hand_tracking_ext->get_active()) {
|
||||
|
||||
Reference in New Issue
Block a user