▣
module · drop-in viewer
slicer
Cuts closed procedural meshes along planes and caps the cut, so the katana leaves clean pieces. Used by `CrewDirector` when a katana kills a fruit thug, and again when a lying piece is slashed.
by·posted 19d ago
What it does
game.enemies.slicer
Cuts closed procedural meshes along planes and caps the cut, so the katana
leaves clean pieces. Used by CrewDirector when a katana kills a fruit thug,
and again when a lying piece is slashed.
S.cut(parts, n, p)→neg, pos: split a solid (a list of{ mat, geo }parts in one frame) by the plane throughpwith unit normaln. Crossed triangles are split with interpolated normals and UVs; the cut edges of all parts are welded by position and chained into loops, and every closed loop gets a cap on both pieces.S.cutAll(parts, { {n, p}, ... })→ every piece after cutting by each plane.S.bounds(parts)→ centre, half extents, triangle count.S.CUTmaps a flesh material to the cut-face material that shows its cross-section (tomato→cut_tomato, ...). Loops through flesh cap with it, UV-mapped to the loop's bounds so the texture's round slice fills the section; other loops (eyes, buckles) cap in their own material 1.5 mm inward.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.