From 4fb60da456e76b2c190ade363d64a9fa9927d0d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 03:37:43 +0000 Subject: [PATCH 1/3] Initial plan From 9e6a8b503a32c207fcc466c215906da5dbc38837 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 03:40:56 +0000 Subject: [PATCH 2/3] Add explanatory comments for haptic timing constants Co-authored-by: nalathethird <36301692+nalathethird@users.noreply.github.com> --- bHapticsManager/ModernBHapticsWorkerThread.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bHapticsManager/ModernBHapticsWorkerThread.cs b/bHapticsManager/ModernBHapticsWorkerThread.cs index e426dec..ec47066 100644 --- a/bHapticsManager/ModernBHapticsWorkerThread.cs +++ b/bHapticsManager/ModernBHapticsWorkerThread.cs @@ -16,7 +16,17 @@ private class HapticPointData(HapticPoint point) { public float VibrationPhi { get; set; } } + // Worker thread update rate: 8ms = 125 Hz + // Reduced from 10ms (100 Hz) to 8ms for smoother haptic feedback and better temporal resolution. + // Higher update rates provide more responsive haptic effects, particularly for fast-changing + // sensations like vibration and pain pulses. private const int UPDATE_INTERVAL_MS = 8; + + // Haptic frame duration: how long each submitted frame persists on the device + // Increased from 40ms to 100ms to ensure smooth overlap between frames and prevent gaps. + // The 100ms duration (with 8ms updates) provides ~12x frame overlap, creating seamless + // haptic transitions. Too short a duration can cause perceptible stuttering or dropouts, + // while too long can reduce responsiveness to rapid intensity changes. private const int SUBMISSION_DURATION_MS = 100; private readonly InputInterface _inputInterface; From 4eb498d1d42007dc190b0bb8e06b01550a59b10e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 03:41:45 +0000 Subject: [PATCH 3/3] Fix frame overlap calculation in comment (12x -> 12.5x) Co-authored-by: nalathethird <36301692+nalathethird@users.noreply.github.com> --- bHapticsManager/ModernBHapticsWorkerThread.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bHapticsManager/ModernBHapticsWorkerThread.cs b/bHapticsManager/ModernBHapticsWorkerThread.cs index ec47066..d94e1e6 100644 --- a/bHapticsManager/ModernBHapticsWorkerThread.cs +++ b/bHapticsManager/ModernBHapticsWorkerThread.cs @@ -24,7 +24,7 @@ private class HapticPointData(HapticPoint point) { // Haptic frame duration: how long each submitted frame persists on the device // Increased from 40ms to 100ms to ensure smooth overlap between frames and prevent gaps. - // The 100ms duration (with 8ms updates) provides ~12x frame overlap, creating seamless + // The 100ms duration (with 8ms updates) provides ~12.5x frame overlap, creating seamless // haptic transitions. Too short a duration can cause perceptible stuttering or dropouts, // while too long can reduce responsiveness to rapid intensity changes. private const int SUBMISSION_DURATION_MS = 100;