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
+2 -2
View File
@@ -270,7 +270,7 @@ async function start() {
return;
}
detector = new TunedDetector({ dictionaryName: 'ARUCO_4X4_1000' }).setPreset('forgiving');
tracker = new MarkerTracker({ coastMs: 300, smooth: true });
tracker = new MarkerTracker({ coastMs: 120, smooth: true }); // short coast: don't linger on stale pose while panning
await new Promise((res) => { if (video.readyState >= 2) res(); else video.onloadeddata = () => res(); });
sizeAll();
@@ -327,7 +327,7 @@ function loop(now) {
// 3) animate ghosts: smooth toward server target, apply yaw + idle wobble
const t = now / 1000;
for (const obj of ghostObjs.values()) {
obj.group.position.lerp(obj.targetPos, 0.25); // smooth network updates
obj.group.position.lerp(obj.targetPos, 0.5); // smooth network updates (snappier follow)
if (obj._yaw != null) {
// face travel/authored yaw, eased
const cur = obj.group.rotation.y;