fix(website): persist parametric shadows + FPV walk position in the scene URL#74
Merged
Conversation
…L (and fix selfShadow decode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gallery scene-URL (
?scene=) already captured camera/orbit, lighting, and basic shadow toggles — but two things were lost when sharing a link:1. Parametric shadow settings (added in #72) were never serialized. Now round-tripped:
shadowParametric(sp),shadowDefinition(sd),shadowStyle(sst, vector/pixel),shadowFollowAnimation(sfa). Also fixed a latent bug —selfShadowwas serialized but missing fromBOOLEAN_OPTIONS, so it failed to decode on reload.2. FPV walk position. In first-person, WASD moves the camera eye, but FPV is authoritative and never echoed its per-frame writes to React state, so the walked-to spot wasn't in the link. Now a debounced (~900ms settle) listener syncs the resting pose — storing the eye position (
getOrigin()) astargetso FPV re-seeds to that spot on reload. The camera-apply effect skips FPV mode so this write never fights the live controls. (Throttled on settle, not per frame, as discussed — you rarely leave FPV mid-step.)Verified end-to-end: set pixel + def 60 + azimuth → link restores them; enter FPV, walk forward, let it settle → the
targettoken updates in the link.pnpm build:websitegreen.