nx_softjiggle.nx
buildroot/runtime/nx_softjiggle.nx
about
nx_softjiggle.nx -- JIGGLE-BONE soft dynamics (operator 2026-07-03: "we also want jiggle physics" -- the
VaM-class secondary-motion substrate). Industry-standard model: a jiggle NODE is a point mass tethered to
an ANCHOR (the skeleton/animation drives the anchor; the node lags, overshoots, decays = jiggle) by a
spring-damper, with gravity influence and a HARD max-stretch clamp (no explosion, by construction).
ALL INTEGER (pos fx256, vel fx65536, 60Hz -- the same fixed-point law as nx_phys3d) => deterministic,
byte-identical replays. Per-node stiffness/damping/stretch/gravity are DATA (the moddable-architecture law:
a body-part profile = 4 numbers a mod can ship). Chains (node anchored to another node) compose ponytails/
cloth strips. Base-relative: runs native AND in-wasm. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_softjiggle_gate.nxnx_wasm_physlab.nx
structs
| none |
consts
| 16 | const SJ_MAXN: i64 = 128 |
| 17 | const SJ_MAXC: i64 = 32 |
functions
| 19 | func sj_hdr(base: i64) -> *i64 { return base as *i64 } // [0]=node count [1]=capsule count |
| 20 | func sj_node(base: i64, id: i64) -> *i64 { return (base + 64 + id * 128) as *i64 } |
| 23 | func sj_capsule(base: i64, id: i64) -> *i64 { return (base + 64 + SJ_MAXN * 128 + id * 64) as *i64 } |
| 24 | func sj_bytes() -> i64 { return 64 + SJ_MAXN * 128 + SJ_MAXC * 64 } called by 1: main |
| 26 | func sj_init(base: i64) -> i64 |
| 33 | func sj_add_capsule(base: i64, x0: i64, y0: i64, z0: i64, x1: i64, y1: i64, z1: i64, r: i64) -> i64 |
| 44 | func sj_isqrt(v: i64) -> i64 |
| 52 | func sj_add(base: i64, x: i64, y: i64, z: i64, k: i64, damp: i64, maxstretch: i64, gscale: i64) -> i64 |
| 66 | func sj_anchor(base: i64, id: i64, x: i64, y: i64, z: i64) -> i64 |
| 71 | func sj_chain(base: i64, id: i64, parent: i64) -> i64 |
| 76 | func sj_pos(base: i64, id: i64, axis: i64) -> i64 |
| 81 | func sj_iabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 84 | func sj_axis(x: i64, ax: i64, v: i64, k: i64, damp: i64) -> i64 called by 1: sj_step |
| 90 | func sj_step(base: i64) -> i64 |