Draw the mission map and let the player point at it #18
No reviewers
Labels
No labels
area/ai
area/build
area/character
area/combat
area/data
area/docs
area/game
area/net
area/ui
area/world
size
l
size
m
size
s
type
bug
type
design
type
feature
type
refactor
type
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/terra-redux!18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "3-mission-rendering-and-camera"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Puts the proving ground on screen and lets the cursor resolve to a tile. Coloured
primitives only; no art, no glTF.
Closes #3
What to look at when you run it
There is no display here, so nothing visual is claimed — only that it builds, passes
cargo test(67, up from 45),cargo clippy --all-targets -- -D warnings, andcargo fmt --check. Deploy from the main menu, then:the raised platform and pillars readable as elevation.
WASDpans,Q/Eturn,
R/Ftilt,-/=zoom. It should be hard to lose the map: pitch cannot gounder the floor or straight down, zoom is bounded, and the focus is held near the
map's extent.
and follow it up onto the raised platform and the pillars. The thing worth stress
testing is a shallow angle across a pillar — the cue should land on the pillar, not
the floor behind it.
Two things to scrutinise
Scope I added: an entry point. #3 says the mission view appears on entering
GameState::Mission, but nothing in the game entered that state, so the work would havebeen unreviewable. The root menu gains a "Deploy" button and Escape leaves a mission.
Both are placeholders — the contract board and a real victory check are #12 — and both
are called that in the code and in
CLAUDE.md.Camera ordering touches the menu. The UI camera now draws above the mission camera
and stops clearing while a mission is beneath it, otherwise the HUD would wipe the map.
Outside a mission it goes back to clearing, so the menu and the loading frames behave
exactly as before. This is the one change I cannot verify without a display, and it is
the change most likely to show up as a smear if I have it wrong.
Notes on the shape
MapLayoutis the only thing that knows where the grid sits in world space. Renderingdraws blocks from it, picking casts rays at the same blocks — one function, so the
highlight cannot end up a tile away from the cursor. It touches no ECS, which is what
makes oblique picking over varying heights testable: the tests build rays by hand and
assert that a wall is picked instead of the floor it hides.
The camera is four numbers (focus, yaw, pitch, distance) with a
Transformderived fromthem each frame, rather than a
Transformmutated in place. Its clamps are multiples ofthe map's framing radius, so a larger map frames correctly without retuning, and the
opening distance is checked against the projection's field of view rather than eyeballed.
World-space dimensions live in
theme::scale, next to thespaceladder, so the"no size literal outside
theme" rule holds for 3D as it does for UI. Terrain, hover,and lighting colours are new semantic tokens; the assignment table in
CLAUDE.mdhasthe new rows.
The headless test drives a real state transition with no window and no renderer, and
asserts the view is built on entry and gone on exit. I checked it is not vacuous by
dropping the teardown system and confirming it fails.
Two things I deliberately did not use: Bevy's mesh picking backend (an analytic ray test
is deterministic and testable headlessly, which the backend is not), and diagonal
neighbours (movement's business, not the coordinate type's).