The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Timeout minimum duration pulses after 0.1 seconds

+10 -3
+10 -3
src/xrt/state_trackers/oxr/oxr_input.c
··· 1829 1829 1830 1830 const XrHapticVibration *data = (const XrHapticVibration *)hapticEvent; 1831 1831 1832 - int64_t now = time_state_get_now(sess->sys->inst->timekeeping); 1833 - int64_t stop = data->duration <= 0 ? now : now + data->duration; 1832 + // This should all be moved into the drivers. 1833 + const int64_t min_pulse_time_ns = time_s_to_ns(0.1); 1834 + int64_t now_ns = time_state_get_now(sess->sys->inst->timekeeping); 1835 + int64_t stop_ns = 0; 1836 + if (data->duration <= 0) { 1837 + stop_ns = now_ns + min_pulse_time_ns; 1838 + } else { 1839 + stop_ns = now_ns + data->duration; 1840 + } 1834 1841 1835 1842 #define SET_OUT_VIBRATION(X) \ 1836 1843 if (act_attached->X.current.active && \ 1837 1844 (sub_paths.X || sub_paths.any)) { \ 1838 - set_action_output_vibration(sess, &act_attached->X, stop, \ 1845 + set_action_output_vibration(sess, &act_attached->X, stop_ns, \ 1839 1846 data); \ 1840 1847 } 1841 1848