Jitter Amoothing

This commit is contained in:
2026-07-08 12:26:48 +10:00
parent 2d492baa7d
commit 114e883f5b
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -100,7 +100,12 @@ export class TunedDetector {
* smoothing (kills jitter); moving fast => light smoothing (stays responsive).
*/
class OneEuro {
constructor(minCutoff = 1.2, beta = 0.012, dCutoff = 1.0) {
// minCutoff: baseline smoothing when still (lower = smoother but laggier).
// beta: how aggressively smoothing backs off as the value moves (higher =
// snappier tracking when you pan the phone, so ghosts follow the camera).
// Tuned for AR panning: keep jitter down when still, but track fast motion
// almost 1:1 so the world doesn't lag behind the camera.
constructor(minCutoff = 1.7, beta = 0.15, dCutoff = 1.0) {
this.minCutoff = minCutoff; this.beta = beta; this.dCutoff = dCutoff;
this.xPrev = null; this.dxPrev = 0; this.tPrev = null;
}