summaryrefslogtreecommitdiffstats
path: root/modules/openxr/action_map/openxr_action_map.cpp
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-10-24 13:23:03 -0500
committerThaddeus Crews <repiteo@outlook.com>2024-10-24 13:23:03 -0500
commit8b6c7bf64c97c1945b3564f3d451a311013112dd (patch)
treef7b14c5970d9e4102a63c9297b1bf0f165f02b56 /modules/openxr/action_map/openxr_action_map.cpp
parentfd757070358daab63825df196a8047e6aef0fcc6 (diff)
parent3e36f52524b9ce65a50962aa62b52f4b8add64b3 (diff)
downloadredot-engine-8b6c7bf64c97c1945b3564f3d451a311013112dd.tar.gz
Merge pull request #98163 from BastiaanOlij/openxr_flatten_bindings
OpenXR: change bindings to 'flatten' source paths
Diffstat (limited to 'modules/openxr/action_map/openxr_action_map.cpp')
-rw-r--r--modules/openxr/action_map/openxr_action_map.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/modules/openxr/action_map/openxr_action_map.cpp b/modules/openxr/action_map/openxr_action_map.cpp
index 5430a41d6d..f924386ecf 100644
--- a/modules/openxr/action_map/openxr_action_map.cpp
+++ b/modules/openxr/action_map/openxr_action_map.cpp
@@ -576,20 +576,15 @@ PackedStringArray OpenXRActionMap::get_top_level_paths(const Ref<OpenXRAction> p
const OpenXRInteractionProfileMetadata::InteractionProfile *profile = OpenXRInteractionProfileMetadata::get_singleton()->get_profile(ip->get_interaction_profile_path());
if (profile != nullptr) {
- for (int j = 0; j < ip->get_binding_count(); j++) {
- Ref<OpenXRIPBinding> binding = ip->get_binding(j);
- if (binding->get_action() == p_action) {
- PackedStringArray paths = binding->get_paths();
-
- for (int k = 0; k < paths.size(); k++) {
- const OpenXRInteractionProfileMetadata::IOPath *io_path = profile->get_io_path(paths[k]);
- if (io_path != nullptr) {
- String top_path = io_path->top_level_path;
-
- if (!arr.has(top_path)) {
- arr.push_back(top_path);
- }
- }
+ Vector<Ref<OpenXRIPBinding>> bindings = ip->get_bindings_for_action(p_action);
+ for (const Ref<OpenXRIPBinding> &binding : bindings) {
+ String binding_path = binding->get_binding_path();
+ const OpenXRInteractionProfileMetadata::IOPath *io_path = profile->get_io_path(binding_path);
+ if (io_path != nullptr) {
+ String top_path = io_path->top_level_path;
+
+ if (!arr.has(top_path)) {
+ arr.push_back(top_path);
}
}
}