gap: with the height layer on, every floating navigation mark sinks #286

Open
viberfox-agent wants to merge 1 commit from fix/268-floating-marks-water-level into main
Collaborator

Closes #268

Merged by the autopilot (docs/direction.md) after every Actions job passed on the branch head.

Closes #268 Merged by the autopilot (docs/direction.md) after every Actions job passed on the branch head.
fix(map): float navigation marks and moored boats on the water's own level
Some checks failed
CI / test cartopolis (pull_request) Failing after 11m43s
CI / wasm & android targets (pull_request) Has been skipped
053b619695
With Map ▸ Height on, a buoy sank to its shoulder. Water and the things
floating in it were placed by two different rules, and the rules are
unrelated over a river: a water polygon takes the median of the measured
field over its own outline — i.e. over the banks, the only place AHN
measured anything — while a navigation mark is `SurfaceGroup::Furniture`
and was displaced per vertex, mid-stream, against a height `fill_holes`
invented by dilating one bank into the other. Every floating form is
modelled straddling y = 0 because that is where the waterline is
(`nav_marks`' `mod form`, `furniture`'s `BOAT`), so what the disagreement
costs is freeboard: the same mark on the Waal measured 25 px of body with
the layer off and 11 px with it on, and where the hole was filled from
higher ground it would float instead.

So the level is computed once per streamed cell (`cell_water_level`, over
every water mesh in it) and handed to the water *and* to every mesh
flagged `SurfaceMesh::afloat` — the marks and the moorings. A flag rather
than a surface group of its own: a group would need its own colour,
roughness, depth bias and offset plus a second material and draw call per
cell, and it would cost the marks the Furniture group's shared material,
altitude fade and Layers toggle, which is the property that makes the
layer nearly free. The moorings are flagged at the call site because
`build_furniture_meshes` also builds the benches and the parked cars, and
those stand on the ground.

A cell with no water of its own has nothing to level against, so its
floating meshes keep today's per-vertex placement rather than a fabricated
zero; `ShotMetrics::floating_off_water` counts that case, which is the one
way the rule can go quietly wrong and is a count rather than a colour so
`--expect 'floating_off_water==0'` is exact. Computing over all of a
cell's water meshes also closes a latent seam, since a body cut into
pieces by the upload budget used to get a median per piece. With the
height layer off nothing is displaced at all, as before.

`stand_on_terrain`'s level arm is now reached by the bridge decks alone, a
deck's height being a measurement that arrives later rather than something
the cell can compute.

Not visually verified: this container cannot render, so the A/B capture of
the Waal buoy — and a first capture of the moored boats, which have never
been photographed either way — still has to be run somewhere that can.

Refs #268
Some checks failed
CI / test cartopolis (pull_request) Failing after 11m43s
CI / wasm & android targets (pull_request) Has been skipped
This pull request has changes conflicting with the target branch.
  • crates/cartopolis/src/systems/dev/shot_harness.rs
  • crates/cartopolis/src/systems/map/map_geometry.rs
  • crates/cartopolis/src/systems/map/terrain.rs
  • crates/geo/src/vector_tiles.rs
  • docs/notes/terrain-relief.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/268-floating-marks-water-level:fix/268-floating-marks-water-level
git switch fix/268-floating-marks-water-level

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/268-floating-marks-water-level
git switch fix/268-floating-marks-water-level
git rebase main
git switch main
git merge --ff-only fix/268-floating-marks-water-level
git switch fix/268-floating-marks-water-level
git rebase main
git switch main
git merge --no-ff fix/268-floating-marks-water-level
git switch main
git merge --squash fix/268-floating-marks-water-level
git switch main
git merge --ff-only fix/268-floating-marks-water-level
git switch main
git merge fix/268-floating-marks-water-level
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jeroen/cartopolis!286
No description provided.