Design a panel's surface in the app, instead of by hand in the XML - #7
Merged
Conversation
Surfaces have existed since the day panels stopped being flat, but the only way to shape one was to type control points into the stage file. The inspector now picks the kind — Flat, Arc or Lattice — and the Previz view drags a lattice's points about. Three decisions worth keeping: Conversions sample the old shape (Surface::bake_lattice) rather than rebuilding it from parameters, so switching an arc to a lattice mid-edit does not move the picture, and resizing the grid keeps the shape it had. Re-baking a lattice at its own size is the identity, which matters because the columns and rows spinners re-bake on every change. Handles are picked from press_origin, not from where the pointer is when egui decides a press has become a drag — by that frame the pointer has already left the handle, and hit-testing the live position picks nothing at all. A handle drags in the plane through it facing the camera, so depth is the one thing a pull cannot change; any other plane lets a point run away at a glancing view and pushes the wall through the set. Also fixes the viewport being rendered at the *window's* size and squashed into the rect that shows it: previz ran at the wrong aspect and the emulation view's zoom did not mean what it said. It had to go before handles could be dragged, because an overlay computed from the true camera lands nowhere near a stretched image. And the widgets turn out to be clickable after all: egui::Context::run_ui takes a RawInput, so pointer events drive the real widget code with no window, no GPU and no NDI. The whole pick-drag-orbit path is tested that way, and it caught the press_origin bug before the app was ever run. 153 tests. The formatting churn in the files touched is rustfmt catching up on lines that were already drifting. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Surfaces have existed since panels stopped being flat, but the only way to shape one was to type control points into the stage file. The inspector now picks the kind — Flat, Arc or Lattice — and the Previz view drags a lattice's control points about.
What is in it
Surface::bake_lattice/arc_metrics/set_point,Panel::local_of/stage_of,Camera::project/ray/forward, andgeom::Ray.Three decisions worth keeping
press_origin, not from where the pointer is when egui decides a press has become a drag. By that frame the pointer has left the handle, and hit-testing the live position picks nothing at all.Two things found on the way
egui::Context::run_uitakes aRawInput, so pointer events drive the real widget code with no window, no GPU and no NDI. The whole pick-drag-orbit path is tested that way, and it caught thepress_originbug before the app was ever run.153 tests pass. Verified end to end as well: a real Arena 7.27 import, given an arc and a pulled lattice, renders through
unmapper render --previz.The formatting churn in the touched files is rustfmt catching up on lines that were already drifting.
🤖 Generated with Claude Code