Wreck.component
README.md
Wreck
The liner on the bottom, and the things on it that move. One component on one
entity; it is the whole wreck slice of DEADLIGHT.
On awake it derives every surface, builds the ship, and spawns the five
anchors Film.NAMES promises — Bow, PortAnchor, Forecastle,
BridgeFront, DebrisField — each carrying its own geometry, so a shot framed
against a name frames the real thing rather than a contracted fallback.
Then it joins the film clock through Film.register("wreck", ...). Everything
the wreck DOES is a function of Film.t and nothing else: the rusticles sway
down the whole side, one of them parts and falls its whole length at 41 s for
shot 7, corrosion flakes lift off the forecastle for shot 8 and rust dust falls
past the bridge for shot 11. Nothing here reads wall time, so two runs of the
film are the same film.
Using it
local c = entity.find("Wreck").component.get("Wreck")
c.status() -- { built, clumps, flakes, t }
c.at(48.0) -- put the wreck where it stands at 48 s, without running the clock
c.rebuild() -- re-derive every texture and mesh after editing a module
Component methods take no self — call them with ., not :.
Fields
generation— bump it to force a rebuild.
What it spawns
Every entity it makes is TEMPORARY: the wreck is a function of this code, not a
hundred records in the scene, and a slice that leaves un-marked entities behind
blocks the shared commit gate for the other three. It also puts every piece on
the wreck render layer as well as default, so a diagnostic capture can ask
for the ship alone (capture { renderLayers = "wreck" }) without disturbing the
other slices.
Where the parts live
deadlight.wreck.geom builds triangles, …surfaces makes the materials,
…hull is the shape of the ship, …fittings is everything bolted to it,
…growth is the rusticles and …debris is the field aft of the break.