Skip to content

viewer: live-scene walkthrough as LiveWalkthroughController - #1269

Merged
wass08 merged 3 commits into
mainfrom
viewer/walkthrough
Nov 11, 2026
Merged

wass08 merged 3 commits into
mainfrom
viewer/walkthrough

Conversation

@wass08

@wass08 wass08 commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Walking through a live (unbaked) scene no longer needs the editor. LiveWalkthroughController joins @pascal-app/viewer, next to the baked-scene GlbWalkthroughController.

  • Moved to the viewer: the controller, collider world builder, ground holes, terrain collider and mechanism targets, with their tests. Walkthrough on/off and movement mode come from useViewer. The host passes paused, externalFov, pointerInteraction, suspendOnUnlock and onExit. Door, drawer and light interaction still emit core interaction:sound, which @pascal-app/viewer/sfx plays.
  • HUD store: useFirstPersonHud moves to the viewer's main entry and viewer/ui re-exports it, so there is still one store. scene-bounds moves to core and typing-target to the viewer.
  • Editor: FirstPersonControls becomes a thin adapter that adds capture mode, the capture shutter hold, editor exit and tool-mode behaviour on top of the shared controller. Barrel names are unchanged.
  • Gates: the render-bundle check covers the controller's runtime and declarations, with editor and Next resolution forbidden. The packed live fixture enters walkthrough with renderPlugin only. It presses a movement key and requires the camera to move, the HUD and crosshair to appear, a door sound request, and an unchanged scene document.

How to test

  1. bun run check:viewer-live. In dev and preview, with storage available and denied, the result includes "live walkthrough movement, HUD, door sound, unchanged document, no errors".
  2. bun run check:render-bundle passes.
  3. The focused walkthrough tests and the editor suite (2821) pass, and apps/editor check-types passes with its pinned plugins.
  4. In the editor, enter walkthrough on a scene, then walk, open a door and use capture mode; they should behave as before. Not verified in a browser.

Screenshots / screen recording

N/A — behaviour moved, not changed; covered by the packed fixture.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

🤖 Generated with Claude Code


Note

Medium Risk
Large relocation of walkthrough physics, collision, and interaction from the editor to the viewer affects both editor capture mode and new standalone consumers; regressions are mitigated by fixture and controller tests but not fully browser-verified in-editor.

Overview
Live-scene first-person walkthrough moves out of the editor into @pascal-app/viewer as LiveWalkthroughController, so render-only hosts can walk parametric scenes with the same movement, BVH collision, and door/window/item/elevator interaction as before. The editor’s FirstPersonControls shrinks to a thin adapter (capture FOV, shutter pause, pointer/suspend behavior, exit) on top of that shared controller.

Shared infrastructure: useFirstPersonHud lives on the main viewer entry (UI re-exports the same store); computeSceneBoundsXZ moves to @pascal-app/core; isTypingTarget centralizes in the viewer and replaces scattered editor imports. Docs and the viewer README describe mounting the controller with WalkthroughHud and optional host props.

Quality gates: New unit tests for LiveWalkthroughController; the packed viewer-live fixture gains a spawn, walkthrough entry, W movement, HUD/crosshair, E door + interaction:sound / SFX fetch, unchanged scene document, and Escape exit. Render-bundle checks now require the live walkthrough in isolation without editor/Next.

Reviewed by Cursor Bugbot for commit f2eb986. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cfadbf6. Configure here.

wass08 and others added 3 commits November 11, 2026 11:04
Walking through an unbaked scene no longer needs the editor. The controller,
collider world, ground holes, terrain collider and mechanism targets move to
@pascal-app/viewer, driven by useViewer's walkthrough state; the first-person
HUD store moves to the viewer entry (viewer/ui re-exports it). The editor's
FirstPersonControls becomes a thin adapter adding capture mode and editor
exit. scene-bounds moves to core. The packed fixture walks the fixture scene
with renderPlugin only: movement, HUD, door sound and an unchanged document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
externalFov becomes a getter read at walkthrough start and teardown, as the
editor did with capture mode, so leaving a walkthrough after closing capture
restores the orbit FOV instead of keeping the walkthrough value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wass08
wass08 force-pushed the viewer/walkthrough branch from c1a58f9 to f2eb986 Compare November 11, 2026 16:06
@wass08
wass08 merged commit 46f4f53 into main Nov 11, 2026
9 checks passed
@wass08
wass08 deleted the viewer/walkthrough branch November 11, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant