From 59683fc2b95c7853ce188bd67edb749cc822c3f3 Mon Sep 17 00:00:00 2001 From: Riccardo Zaglia Date: Mon, 12 Aug 2024 12:03:35 +0200 Subject: [PATCH] fix(client_openxr): :bug: Fix crash with vibration on Focus 3 --- 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();