From a8e1c944ee091979019e1d94805d8fbdb0bd026e Mon Sep 17 00:00:00 2001 From: zarik5 Date: Mon, 12 Aug 2024 12:12:50 +0200 Subject: [PATCH] fix(client_openxr): :bug: Fix crash with vibration on Focus 3 (#2324) --- alvr/client_openxr/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alvr/client_openxr/src/lib.rs b/alvr/client_openxr/src/lib.rs index bfe9fb16f5..46e77ac26f 100644 --- a/alvr/client_openxr/src/lib.rs +++ b/alvr/client_openxr/src/lib.rs @@ -385,8 +385,8 @@ pub fn entry_point() { &xr_session, xr::Path::NULL, &xr::HapticVibration::new() - .amplitude(amplitude) - .frequency(frequency) + .amplitude(amplitude.clamp(0.0, 1.0)) + .frequency(frequency.max(0.0)) .duration(xr::Duration::from_nanos(duration.as_nanos() as _)), ) .unwrap();