code wiki / (root) / nx_autorig.nx

nx_autorig.nx

buildroot/runtime/nx_autorig.nx

6418 B152 linesdepth 3pulls 4 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_autorig.nx -- AUTO-RIG + PHYSICS-PARAM EMIT (generator-path R5, operator: the ecosystem emits rigged, physics-ready objects -- not hand-authored per object). Given ANY generated SDF-part object (t2mesh output, the pioneer body, ...), DERIVE from its geometry: (1) a SKELETON -- parts whose ellipsoids touch (support- distance test along the center line, + the object's smin blend as slack) form a graph; a BFS spanning tree from the largest-volume part (the natural pelvis-style root) = the bones; (2) MASS per part (volume rx*ry*rz); (3) COLLISION proxy per part (the ellipsoid itself); (4) a SOFT param per part (mean radius -- bigger part = softer/jigglier; v0 heuristic, data-driven refinement later). Serializes as an NXRG1 data pack (magic + corrupt-reject) per the pack economy (NXM1/NXCH1/...). Integer, deterministic. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_sdfrender.nx nx_autorig.nx nx_autorig_gate.nx nx_genloop_gate.nx

imports: nx_syscalls.nxnx_sdfrender.nx

imported by: nx_autorig_gate.nxnx_genloop_gate.nx

structs

none

consts

12const AR_MAXP: i64 = 32

functions

14func ar_isqrt(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 }
16func ar_np(base: i64) -> i64
called by 1: ar_build
24func ar_support(base: i64, i: i64, dx: i64, dy: i64, dz: i64, dist: i64) -> i64
called by 1: ar_gap calls 1: ar_isqrt
34func ar_gap(base: i64, i: i64, j: i64) -> i64
called by 1: ar_build calls 2: ar_isqrtar_support
44func ar_vol(base: i64, i: i64) -> i64
called by 1: ar_build
51func ar_build(base: i64, bones: *i64, masses: *i64, soft: *i64, out: *i64) -> i64
113func ar_pack(base: i64, bones: *i64, masses: *i64, soft: *i64, out: *i64, buf: *u8) -> i64
called by 1: main
135func ar_unpack_ok(buf: *u8, len: i64) -> i64
called by 1: main