From 254fff37ffbaf9410170cd75fe39b21e69e310e7 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Mon, 8 Jun 2026 18:13:18 -0700 Subject: [PATCH] Pull out shared smoothFollow logic --- gnome/src/shared | 2 +- gnome/src/virtualdisplayeffect.js | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/gnome/src/shared b/gnome/src/shared index 65376ad..f8e9aeb 160000 --- a/gnome/src/shared +++ b/gnome/src/shared @@ -1 +1 @@ -Subproject commit 65376ad92e0cecfc0bf77ced15ed0d32e33c6f82 +Subproject commit f8e9aeb9a240a40d5c5608821847dc4dfccddfad diff --git a/gnome/src/virtualdisplayeffect.js b/gnome/src/virtualdisplayeffect.js index ed6310b..235fd72 100644 --- a/gnome/src/virtualdisplayeffect.js +++ b/gnome/src/virtualdisplayeffect.js @@ -6,17 +6,7 @@ import Shell from 'gi://Shell'; import Globals from './globals.js'; import { degreeToRadian, diagonalToCrossFOVs, fovConversionFns } from './shared/math.js'; - - -// these need to mirror the values in XRLinuxDriver -// https://github.com/wheaney/XRLinuxDriver/blob/main/src/plugins/smooth_follow.c#L31 -export const SMOOTH_FOLLOW_SLERP_TIMELINE_MS = 1000; -const SMOOTH_FOLLOW_SLERP_FACTOR = Math.pow(1-0.999, 1/SMOOTH_FOLLOW_SLERP_TIMELINE_MS); - -// this mirror's how the driver's slerp function progresses so our effect will match it -function smoothFollowSlerpProgress(elapsedMs) { - return 1 - Math.pow(SMOOTH_FOLLOW_SLERP_FACTOR, elapsedMs); -} +import { SMOOTH_FOLLOW_SLERP_TIMELINE_MS, smoothFollowSlerpProgress } from './shared/smoothFollow.js'; // how far to look ahead is how old the IMU data is plus a constant that is either the default for this device or an override function lookAheadMS(imuDateMs, lookAheadCfg, override) {