code wiki / (root) / nx_softbind.nx

nx_softbind.nx

buildroot/runtime/nx_softbind.nx

6519 B128 linesdepth 3pulls 3 transitivereach 9 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_softbind.nx -- LIB: BINDS nx_softdyn to character geometry (roadmap rung A4, 2026-08-01). The solver was proven 7/7 in isolation but bound to NOTHING -- no body part consumed it, so nothing in the game visibly jiggled. This lib is the missing joint-anchor contract: each mob owns SB_PTS spring points (hair / chest / skirt class), each seated at a fixed local offset from the mob ROOT, stepped once per sim tick from root motion ONLY (organ truth -- the same source as the mobdx/mobdz/mobdy doors), yielding signed Q8 offsets a renderer ADDS to its designated joints on top of the animated pose (spring-decomposed-skinning pattern: helper offsets over the animation, never replacing it). Pure function of the root trajectory => bit-deterministic, so replay / netsync / save-transparency hold by construction. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 6 importers

nx_syscalls.nx nx_softdyn.nx nx_softbind.nx nx_cg_restprobe.nx nx_mr_lagprobe.nx nx_softbind_gate.nx nx_softtissue_conserve_gate.nx nx_softtissue_mr_gate.nx nx_wasm_craft.nx

imports: nx_syscalls.nxnx_softdyn.nx

imported by: nx_cg_restprobe.nxnx_mr_lagprobe.nxnx_softbind_gate.nxnx_softtissue_conserve_gate.nxnx_softtissue_mr_gate.nxnx_wasm_craft.nx

structs

none

consts

13const SB_MAGIC_5381: i64 = 5381
14const SB_MAGIC_1000000007: i64 = 1000000007
16const SB_PTS: i64 = 3
17const SB_HAIR: i64 = 0
18const SB_CHEST: i64 = 1
19const SB_SKIRT: i64 = 2
25const SB_K_HAIR: i64 = 200
26const SB_C_HAIR: i64 = 60
27const SB_K_CHEST: i64 = 85
28const SB_C_CHEST: i64 = 110
29const SB_K_SKIRT: i64 = 300
30const SB_C_SKIRT: i64 = 80
36const SB_K_CHEST_BASE: i64 = 60
37const SB_K_CHEST_STEP: i64 = 25
38const SB_C_CHEST_BASE: i64 = 100
39const SB_C_CHEST_STEP: i64 = 16
41const SB_MAXD_HAIR: i64 = 6
42const SB_MAXD_CHEST: i64 = 2 // +-3.1cm: tissue-vs-bone p2p <= 6.2cm, the cited band
43const SB_MAXD_SKIRT: i64 = 5
45const SB_OFFY_HAIR: i64 = 17
46const SB_OFFY_CHEST: i64 = 12
47const SB_OFFY_SKIRT: i64 = 7

functions

49func sb_k(kind: i64) -> i64 { if kind == SB_HAIR { return SB_K_HAIR } if kind == SB_CHEST { return SB_K_CHEST } return SB_K_SKIRT }
called by 1: sb_tick_mob
50func sb_c(kind: i64) -> i64 { if kind == SB_HAIR { return SB_C_HAIR } if kind == SB_CHEST { return SB_C_CHEST } return SB_C_SKIRT }
called by 1: sb_tick_mob
51func sb_maxd(kind: i64) -> i64 { if kind == SB_HAIR { return SB_MAXD_HAIR } if kind == SB_CHEST { return SB_MAXD_CHEST } return SB_MAXD_SKIRT }
called by 2: sb_tick_mobmain
52func sb_offy(kind: i64) -> i64 { if kind == SB_HAIR { return SB_OFFY_HAIR } if kind == SB_CHEST { return SB_OFFY_CHEST } return SB_OFFY_SKIRT }
55func sb_alloc(nmobs: i64) -> *i64 { return sd_alloc(nmobs*SB_PTS) }
58func sb_seat_mob(st: *i64, mobi: i64, rx: i64, ry: i64, rz: i64) -> i64
65func sb_tick_mob(st: *i64, mobi: i64, rx: i64, ry: i64, rz: i64) -> i64
called by 1: main calls 5: sd_stepsb_offysb_ksb_csb_maxd
74func sb_tick_pt(st: *i64, mobi: i64, kind: i64, rx: i64, ry: i64, rz: i64, K: i64, C: i64, maxd: i64) -> i64
79func sb_tick_mob_firm(st: *i64, mobi: i64, rx: i64, ry: i64, rz: i64, firm: i64) -> i64
called by 1: mob_tick calls 1: sb_tick_pt
91func sb_impulse_mob(st: *i64, mobi: i64, ix: i64, iy: i64, iz: i64) -> i64
called by 4: mainmaincg_freeze_sdmain calls 1: sd_impulse
100func sb_off_x_q8(st: *i64, mobi: i64, kind: i64, rx: i64) -> i64
called by 3: mainsbxmain
103func sb_off_y_q8(st: *i64, mobi: i64, kind: i64, ry: i64) -> i64
called by 5: mainmainsbysbybmain calls 1: sb_offy
106func sb_off_z_q8(st: *i64, mobi: i64, kind: i64, rz: i64) -> i64
called by 2: sbzmain
110func sb_disp_q8(st: *i64, mobi: i64, kind: i64, rx: i64, ry: i64, rz: i64) -> i64
called by 1: main calls 2: sd_disp_q8sb_offy
114func sb_energy(st: *i64, mobi: i64, kind: i64) -> i64 { return sd_energy(st, mobi*SB_PTS + kind) }
called by 2: mainmain calls 1: sd_energy
117func sb_ck(st: *i64, nmobs: i64) -> i64
called by 3: mainsbckmain