luvcraft/particles.lisp
A smashed fragment falls; a mote of light hangs where it was put.
Return the number of live fragments in system.
Return deterministic spread values for burst particle index.
Emit a small deterministic fragment burst for block at coordinate.
Add one weightless block mote at X,Y,Z to system, dropping the oldest
fragment when the population is full.
Advance system by seconds and compact expired fragments in place.
A tumbling fragment has no neighbours at all, so every edge of every face is a convex one.
Build the block-pipeline vertex stream for system's current fragments.
Multiplication and scalar scaling.
(system)(number)Subtraction or unary negation.
(index x y z)Addition over compatible quantities.
(particles count)(system block coordinate)The maximum of compatible quantities.
(system block x y z &key (velocity-x 0.0) (velocity-y 0.0)
(velocity-z 0.0) (size 0.05)
(lifetime 0.3) (gravity 0.0))Add one weightless BLOCK mote at X,Y,Z to SYSTEM, dropping the oldest fragment when the population is full.
Test whether one compatible scalar is at least another.
(system seconds)Test whether one compatible scalar is less than another.
(vertices particle face shade)(tile &optional (domain *block-atlas-tile-domain*))(block face)(face corner)Project CORNER onto FACE's plane as tile-local UV coordinates. The rule is read from the face's own outward normal rather than its name: horizontal faces map world X,Z straight across the tile, and lateral faces keep the world-horizontal axis as U while flipping world Y into V so tiles hang upright.
(vertices px py pz local-u local-v shade nx ny nz
sky-level block-level emission tile
edge-u-low edge-u-high edge-v-low edge-v-high)Append one interleaved vertex without constructing tuple objects. The fourth lane carries normalized raw light readings, not an art-directed bake: shader edits can change the response curve without remeshing the world. The final two scalars carry the atlas tile offset under the atlas mapping and the face's four…
(block)BLOCK's own linear material radiance, independent of propagated light.
(system)The non-negative remainder of integer division.
Short-lived block fragments for the direct manipulation feedback loop.
The particle system is a semantic session-owned object, while its small moving population and per-frame render product stay as compact records and one dense interleaved vertex array. Fragments reuse the ordinary block atlas and surface pipeline; this first effect deliberately does not cast shadows or participate in world collision.