hud-6: pan the 180° video window about the eye; padlock as a panel button
ADDENDUM 8 — panning the video window (yaw/pitch about the eye)
The 180° window was hard-wired dead ahead, so scenes staged below the horizon
could only be watched by physically lowering the head. The video layer is an
XREquirectLayer with radius 0, i.e. the content sits at infinity: only its
ORIENTATION is visible and translating it does nothing. So panning is purely
layer.transform's rotation, which rotates the content about the eye point — no
parallax, no swim when the head moves, and no decode/upload cost (8K HEVC
DirectPlay untouched). Only the video rotates; the panel (refSpace, fixed pose)
and the subtitles (viewer space, head-locked) stay in front of the user.
state.videoYaw (+ = picture moved RIGHT)
state.videoPitch (+ = picture moved UP)
q = qy(-yaw) * qx(pitch) -> aim = (cos p·sin yaw, sin p, -cos p·cos yaw)
Interaction is one affordance in the panel, above the progress bar (the owner's
requested placement): a drag strip. Pinch and drag -> the picture follows the
hand 1:1; three taps within 1.6 s reset it (taps counted on RELEASE, so a drag
cannot be mistaken for one); the live angles are printed on the strip. The drag
is driven by the RAY's own direction delta rather than a cursor position on the
panel: a panel-space cursor leaves the panel after a few degrees, while ray
rotation has no range limit and keeps the content point under the cursor.
Controls.hold() freezes the panel auto-hide for the drag's duration.
Pitch is limited only by a gimbal guard (±(π/2 - 0.02)) per "不限"; yaw wraps to
[-π, π]. Both reset to 0 on every VR session — not persisted.
Runtime risk: XREquirectLayer.transform is settable per spec but a runtime may
ignore the write, so it is probed once per session (write a known rotation, read
it back) -> stats.videoRotMode = 'live' (transform write per frame) or
'rebuild' (recreate the media layer, but only on creation/release/reset, never
per frame). THIS PROBE NEEDS A REAL XR SESSION — it is the one thing not
verifiable offline.
ADDENDUM 7b (previous pass, in this commit's tree) — the padlock
The padlock had been given its own quad layer parked 0.45 m to the right of the
panel. On device it could not be selected while the panel was shown but could
when it was hidden. Aiming is the binding constraint: with hands the only
pointing device is a ray, and the cursor's acceptance window reaches the panel's
own right edge, so the badge was outside every reachable ray; its hit test also
used the panel's layer geometry, which is why the behaviour flipped with panel
visibility. It is now an ordinary panel button (media row, fifth slot) using the
same hitTest/handleSelect path as every other button, and "locked" is a third
panel mode (0.26 × 0.10 m) that draws and hit-tests ONLY the padlock. Locking
swaps the panel in place and lets it auto-hide; the next summon shows the padlock
alone; unlocking restores the full panel and ignores presses for 500 ms.
handleSelect() no longer falls back to pressing the panel centre when no ray hit
exists.
Panel: expanded grew 0.72 × 0.21 m -> 0.72 × 0.26 m (canvas 1440 × 520) for the
drag strip; every row re-proportioned.
Verified offline against the real bundle: quaternion/drag maths (aim direction
for ±yaw/±pitch, unit norm, azimuth/elevation recovery, yaw wrap, pitch clamp,
"aimed point ends up under the cursor"), panel hit bands on the new canvas
(strip 0..0.20, inert readout 0.20..0.30, seek 0.30..0.52, media 0.52..0.74,
subtitle 0.84..1.0, no dead column), the strip's drawn readout, and hold().
build.py --check passes; deployed as mvp-2e32e6 and confirmed live on the Quest
(hud-6, videoYaw/videoPitch 0, errors empty).
This commit is contained in:
+28
-6
@@ -1,8 +1,8 @@
|
||||
# Jellyfin Web VR180 — 项目交接文档
|
||||
|
||||
> 给新对话用。读完这份就能接手,不需要重新调查环境。
|
||||
> 最后更新:已部署版本 `7616c9`(`NS.version = hud-5`;ADDENDUM 6 字幕深度/大小解耦
|
||||
> + ADDENDUM 7 唤出门限/进 VR 前面板精简 + ADDENDUM 7b 锁按钮与「锁定」面板模式)
|
||||
> 最后更新:已部署版本 `2e32e6`(`NS.version = hud-6`;ADDENDUM 6 字幕深度/大小解耦
|
||||
> + 7 唤出门限/前面板精简 + 7b 锁按钮与「锁定」面板模式 + 8 画面拖动搬迁)
|
||||
> 已在 Quest 浏览器里实机验证模块加载 + 锁定数学(`subLockAngle/subAngleDeg`,`errors: []`);
|
||||
> **VR 会话内的观感还没看过**。
|
||||
|
||||
@@ -132,11 +132,11 @@ jelllyfin_vr_web_plugin/
|
||||
├── README.md ← 技术记录(含全部实测数据)
|
||||
├── HANDOFF.md ← 本文档
|
||||
├── src/
|
||||
│ ├── 00-core.js (343 行) 命名空间、共享状态、GL 助手、层/帧钩子注册表、能力探测
|
||||
│ ├── 00-core.js (353 行) 命名空间、共享状态、GL 助手、层/帧钩子注册表、能力探测
|
||||
│ ├── 10-subtitles.js (1022 行) 字幕:libass 画布 → 头锁定 quad 层(HUD)+ 视角尺寸锁定
|
||||
│ ├── 20-controls.js (1930 行) 控制面板:进度条/按钮/光束/光标/锁按钮,canvas 2D → quad 层
|
||||
│ ├── 20-controls.js (2078 行) 控制面板:拖动条/进度条/按钮/光束/光标/锁,canvas 2D → quad 层
|
||||
│ ├── 30-hands.js (569 行) **系统手部模型**:Three.js + 官方 generic-hand GLB → projection 层
|
||||
│ └── 90-main.js (1420 行) 引导、会话生命周期、rAF 代理、输入分发、设置面板、持久化
|
||||
│ └── 90-main.js (1641 行) 引导、会话生命周期、rAF 代理、输入分发、设置面板、持久化、画面搬迁
|
||||
├── build.py ← src/*.js 按文件名顺序拼接 → dist/jfvr.js;`--check` 只做语法检查
|
||||
├── deploy.py ← 构建 + 上传进容器 + 注入 script 标签;`rollback` 还原
|
||||
├── quest.sh ← 一键重连 Quest 的 ADB + CDP 转发
|
||||
@@ -285,6 +285,7 @@ WebXR 规范:需要 *transient activation*。前面不能有 `await`,否则
|
||||
| 引导线(十字双光束) | ✅ 任何时候都显示 |
|
||||
| 面板唤出门限 | ✅ 只有指示线指向/靠近面板时才唤出;唤出那一下不算点击;500ms 内忽略 |
|
||||
| 锁按钮(面板不启动) | ✅ 面板媒体行的第五个按钮:上锁后切到「只显示锁」的最小面板,并同样自动隐藏;每次进 VR 重置为未锁 |
|
||||
| 画面搬迁(180°窗口) | ✅ 面板进度条上方的拖动条:按住拖动,画面绕眼点左右上下转;连点 3 次复位;每次进 VR 回正前方 |
|
||||
| 按压反馈 | ✅ 圆环放大 1.9× + 蓝填充 + 变白,300ms |
|
||||
| 字幕抓拖 | ✅ 注视选中 + 手移动拖(与视线解耦,避免转头就飘) |
|
||||
| 字幕深度/大小解耦 | ✅ 默认「锁定视角尺寸」:拉近/拉远只改深度,视角大小与画面位置不变 |
|
||||
@@ -410,7 +411,9 @@ handsReady / handsErr / handsSources / handsFrames
|
||||
subMode / subCanvasSize / subCrop / subTex / subOpacity / subPlacement
|
||||
subLockAngle / subAngleDeg / subTextDeg / subYOverZ ← ADDENDUM 6
|
||||
ctlSubsOn / ctlSubDist / ctlSubAngle / ctlSubLock ← 控制条实际画出的值
|
||||
ctlLock / ctlMode / pressAt / lastActivate ← ADDENDUM 7/7b 锁与唤出判定
|
||||
ctlLock / ctlMode / ctlHold / pressAt / lastActivate ← ADDENDUM 7/7b 锁、面板保持与唤出判定
|
||||
videoYaw / videoPitch / videoAngleLive / videoRotMode ← ADDENDUM 8 画面搬迁
|
||||
videoRebuilds / videoReset / viewDrag / viewTaps
|
||||
ctlHidden / ctlVisible / ctlBeamOn / ctlDraws / ctlErr
|
||||
panelPose / grab / grabValue / saved
|
||||
errors[] 最近错误
|
||||
@@ -452,3 +455,22 @@ errors[] 最近错误
|
||||
[ ] 确认 fps 仍在 ~110+,targetFrameRate 120
|
||||
[ ] 确认面板/字幕/手模型均无异常
|
||||
```
|
||||
|
||||
### 6.14 画面搬迁为什么是"纯旋转"(ADDENDUM 8)
|
||||
|
||||
等距柱状图层 `radius = 0`,语义是**内容在无穷远**。这决定了三件事:
|
||||
|
||||
- 平移这个球**看不出任何变化**,所以搬画面只能是 `layer.transform` 的**旋转**
|
||||
- 远景没有视差,所以转头/走动时画面**不会游动**
|
||||
- 旋转中心就是**球心=眼点**,正好是"以我眼睛为旋转点"
|
||||
|
||||
而且只转视频层:面板在 `refSpace` 固定姿态、字幕在 viewer 空间头锁定,所以**UI 不会跟着
|
||||
画面跑**。代价为零(不解码、不重传纹理、不动 8K HEVC DirectPlay)。
|
||||
|
||||
拖动用**射线自身的方向差**而不是面板上的坐标:面板坐标挪几度就出界了,射线旋转无行程限制,
|
||||
而且"光标下的那个点始终在光标下",才像"抓住画面拖"。
|
||||
|
||||
**唯一的未知**:`XREquirectLayer.transform` 规范上可写,但运行时可能忽略。所以每会话探测一次
|
||||
(写一个已知旋转再读回):`live` = 每帧写 transform(零成本);`rebuild` = 只能重建媒体层,
|
||||
那就只在**创建/松手/复位**时重建,拖动过程中画面在松手后追上。见 `stats.videoRotMode` /
|
||||
`videoRebuilds`。**这条必须真机验证,离线测不出来。**
|
||||
|
||||
Reference in New Issue
Block a user