render3d: place_rec.ludic, the one encoder and decoder of a baked placement

prec_put / prec_get / prec_size (Physics' spec): PREC_FULL, 12 bytes, for trees, boulders and stones
(u16 x, z in 1/65536 of the chunk; u16 y in cm above y_base; u8 scale over the kind's lo..hi, yaw, seed,
wind), and PREC_PACKED, 7 bytes, for the stream kinds (56 bits, least significant first: x 12, z 12,
y 12 in cm, scale 6, yaw 6, seed 4, wind 4). An encode takes the cell a value falls in, a decode its
centre, so a round trip is stable; a record is read from a []byte at an offset, never a pointer.
stream_emit_baked and layer_chunk_put take (recs, at, fmt) and decode through it; the earlier sb7_*
pair is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 17:28:11 +03:00
parent 3f0bb07c16
commit 8589a5a7b4
6 changed files with 86 additions and 58 deletions

View file

@ -41,6 +41,7 @@ property Layer {
fog_src: int = -1,
ck_off: words, # per baked chunk: where its slab starts in inst, or -1 (layer_chunks.ludic)
ck_cnt: words,
lc_rec: floats, # one decoded record, reused
fog_all: bool = false, # the wall keeps (nearly) all of it: casters from sh_buf, no rebuild
fog_wall: float = 0.0,
fog_x: float = 0.0,