1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

OpenXR: change bindings to 'flatten' source paths

This commit is contained in:
Bastiaan Olij
2024-10-14 15:29:40 +11:00
parent 44fa552343
commit 3e36f52524
6 changed files with 154 additions and 100 deletions

View File

@@ -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();
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;
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);
}
}
if (!arr.has(top_path)) {
arr.push_back(top_path);
}
}
}