summaryrefslogtreecommitdiffstats
path: root/modules/openxr/action_map/openxr_action_map.cpp
diff options
context:
space:
mode:
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);
}
}
}