diff options
author | Bastiaan Olij <mux213@gmail.com> | 2022-10-17 20:18:04 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2022-10-17 20:29:19 +1100 |
commit | 1e7f00949215702e58526bbdfc92e07e0233e08d (patch) | |
tree | 022043e34954403f6225c886dfaa44fb360b6988 /modules/openxr | |
parent | 0d28820c816fa66b66a98cc6c9df25ff74cbb19f (diff) |
Fix two typos in tracker names and a bug in OpenXR haptic feedback
Diffstat (limited to 'modules/openxr')
-rw-r--r-- | modules/openxr/openxr_interface.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index 68414ae84e..e9de124f70 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -447,9 +447,18 @@ void OpenXRInterface::handle_tracker(Tracker *p_tracker) { void OpenXRInterface::trigger_haptic_pulse(const String &p_action_name, const StringName &p_tracker_name, double p_frequency, double p_amplitude, double p_duration_sec, double p_delay_sec) { ERR_FAIL_NULL(openxr_api); + Action *action = find_action(p_action_name); ERR_FAIL_NULL(action); - Tracker *tracker = find_tracker(p_tracker_name); + + // We need to map our tracker name to our OpenXR name for our inbuild names. + String tracker_name = p_tracker_name; + if (tracker_name == "left_hand") { + tracker_name = "/user/hand/left"; + } else if (tracker_name == "right_hand") { + tracker_name = "/user/hand/right"; + } + Tracker *tracker = find_tracker(tracker_name); ERR_FAIL_NULL(tracker); // TODO OpenXR does not support delay, so we may need to add support for that somehow... |