feat: wire the dev Motion button (label reflects state); chip toggle routes through the same setter
This commit is contained in:
+17
-3
@@ -43,8 +43,16 @@ let camMode = 'none';
|
||||
|
||||
/* Diagnostic: freeze all ghost motion (bob/sway/wander/path) so ghosts sit at their
|
||||
* static spawn position — tells tracking jitter apart from the float animation.
|
||||
* Defaults ON in dev; tap the tracking HUD chip to toggle. */
|
||||
* Defaults ON in dev; toggle with the "Motion" button (or the tracking chip). */
|
||||
let freezeGhosts = false;
|
||||
function setFreeze(v) {
|
||||
freezeGhosts = v;
|
||||
const b = $('#motionBtn');
|
||||
if (b) {
|
||||
b.textContent = `Motion: ${v ? 'frozen' : 'on'}`;
|
||||
b.classList.toggle('frozen', v);
|
||||
}
|
||||
}
|
||||
|
||||
let info = { mode: 'dev' };
|
||||
let scene3, camera3, renderer, video, canvas2d, ctx2d;
|
||||
@@ -233,7 +241,13 @@ async function start() {
|
||||
|
||||
// dev-mode pose readout + tap-to-cycle modes
|
||||
if (info.mode === 'dev') {
|
||||
freezeGhosts = true; // start static so tracking jitter is isolated from ghost float
|
||||
// start static so tracking jitter can't be mistaken for the ghost's own float
|
||||
const mb = $('#motionBtn');
|
||||
if (mb) {
|
||||
mb.classList.remove('hidden');
|
||||
mb.addEventListener('click', () => setFreeze(!freezeGhosts));
|
||||
}
|
||||
setFreeze(true);
|
||||
dbgEl = $('#dbg');
|
||||
if (dbgEl) {
|
||||
dbgEl.style.display = 'block';
|
||||
@@ -267,7 +281,7 @@ async function start() {
|
||||
const trk = $('#trk');
|
||||
if (trk) {
|
||||
trk.style.pointerEvents = 'auto';
|
||||
trk.addEventListener('click', () => { freezeGhosts = !freezeGhosts; });
|
||||
trk.addEventListener('click', () => setFreeze(!freezeGhosts));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user