From 7f751b7eee7e8491ecfaddbf9f328b0e8eedfcf4 Mon Sep 17 00:00:00 2001 From: catShark <1716967236@qq.com> Date: Sun, 11 Oct 2026 21:47:55 +0800 Subject: [PATCH] hud-7: live picture pan; fix the reset crash; tap-to-reset / hold-to-drag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported after hud-6: 触发复位后直接崩溃了;我拖动后,我希望画面立刻就有反应,而不是我松手之后才改变。 按住0.5s后拖动才是拖动,否则算复位 1. Why the picture only moved on release — a bad probe The transform-write probe compared quaternion COMPONENTS. q and -q are the same rotation and a runtime may hand back a renormalised quaternion, so a perfectly capable runtime could be judged "read-only". When it was, the drag took the rebuild branch, and that branch was throttled to "on release only" — hence the picture sitting still until the finger came up. The probe now compares the POSITION (exact, no sign ambiguity). 2. Two mechanisms, auto-selected and mutually exclusive 'transform' -> layer.transform = q (one write per change) 'space' -> layer.space = refSpace.getOffsetReferenceSpace(q) (the recentering path every WebXR app uses; a layer pose is recomputed from its space each frame) 'rebuild' -> recreate the media layer (manual escape hatch, "兼容" in the 2D panel) createVideoLayer() only bakes the transform in for 'rebuild' — otherwise the probe's own write would apply the aim twice. layer.transform is never written on the 'space' path and vice versa. stats.videoRotMode / videoTransformWritable report what was chosen. 3. The crash — create-before-destroy The reset created the replacement layer BEFORE destroying the old one: two XRMediaBinding equirect layers bound to one