code wiki / _hdl_build / nx_softbody_region_gate.nx
nx_softbody_region_gate.nx
buildroot/runtime/_hdl_build/nx_softbody_region_gate.nx
about
nx_softbody_region_gate.nx -- gate for the BODY-REGION soft physics + THE OCCLUSION LAW.
T1 GRAVITY PARAM: gmul_y=0 -> ring holds its rest shape exactly-ish; gmul_y=256 -> the bottom node sags
measurably = the TittyMagic-class gravity knob is REAL data.
T2 THE OCCLUSION LAW (the operator's ask, measured): a capsule pressed into the RIGHT of the ring ->
(a) contact nodes held near the collider surface, (b) the FAR (left) nodes BULGE OUTWARD beyond rest
(displaced volume redistributed = physics beyond the visible contact area), (c) capsule removed ->
the ring RECOVERS to rest (elastic, no permanent dent).
T3 VOLUME PROXY: cross-section area with the capsule embedded stays >= 85% of rest area WITH voldist,
and beats the voldist=0 control (the knob does the conserving).
T4 PARAMS ARE DATA: mass 256 vs 1024 -> different response speed; colsoft 256 vs 64 -> different depth.
T5 determinism: two regions, same script -> byte-identical node state.
+ PNG knowledge/nx_region_occlusion.png: rest ring vs embedded-capsule ring, the BULGE visible.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_png.nxnx_softbody_region.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 18 | func hw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 19 | func pn(v: i64) -> i64 |
| 31 | func gabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: main |
| 32 | func isq(v: i64) -> i64 { if v <= 0 { return 0 } var x: i64 = v; var y: i64 = (x + 1) / 2; while y < x { x = y; y = (x + v / x) / 2 } return x } called by 1: nodelen |
| 33 | func nodelen(base: i64, i: i64) -> i64 |
| 40 | func plot(base: i64, fb: *i64, TW: i64, TH: i64, xoff: i64) -> i64 |
| 83 | func main() -> i64 |