Log inGet started
Package

kit.module

Newest version

README.md

demo.props.kit

The props slice's shared floor: the material names, the two spawn helpers, the deterministic noise, the film clock and the easings. Everything in the slice requires it; it requires nothing.

Materials

M.MAT maps a kit name (brass, crystal, velvet, bulbLive, ...) to the Prop* material it stands for, and M.mat(name) resolves it. Nothing in the slice names a colour twice: a prop names a kit material and the look of that material is decided in one file.

Spawning

M.group(parent, name, p) for an empty named child, M.part(parent, name, opt) for a drawn primitive — mesh, mat, p, s, r, visible, shadows. M.rot(yaw, pitch, roll) and M.axis(ax, ay, az, angle) return quaternions as 4-arrays, which is the shape localRotation takes.

Deterministic noise

Nothing in this slice calls math.random: two takes of the film must be the same film, so every scatter is a pure function of an index and a fixed salt. M.hash(i, salt) in [0, 1), M.span(i, salt, lo, hi) mapped into a range, and M.stream(seed) for a walker that advances the salt for you.

The film clock

M.now() is the cutscene's time while a cutscene plays, and a free-running accumulator otherwise, so a prop still moves for a capture taken by hand between takes. M.tick(dt) advances that fallback and is called once a frame by PropsDriver alone; M.rewind() puts it back to zero.

M.since(t0) is the seconds of film since a beat fired at t0, or -1 for "that beat has not happened". A sequence keyed on it survives the clock being SEEKED: land behind the beat and the sequence reads as un-fired again, which is what the shot before it should look like, rather than freezing whatever pose the sequence held when the clock jumped.

Easing

M.sat, M.ramp(t, a, b), M.outCubic, M.inCubic, M.lerp3 — small, named and shared, so a beat's ramp reads the same everywhere in the slice.