code wiki / (root) / nx_quadruped.nx

nx_quadruped.nx

buildroot/runtime/nx_quadruped.nx

10014 B183 linesdepth 5pulls 7 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_quadruped.nx -- QUADRUPED rig + walk gait + body-fill: the bestiary's ANIMALS move too (operator thesis: reuse synthetic assets "from animals to people to monsters" + give them motion). An 18-joint quadruped rig on the SAME nx_skeleton FK substrate (root barrel -> chest/head + hips/tail + 4 three-bone legs), a DIAGONAL WALK gait (FL+HR swing in phase, FR+HL antiphase -- the real quadruped walk coordination; legs point -y so a pitch(Rz) swing moves the foot along the body axis x), and quadpose_fill = the wolf body as bone-anchored ellipsoids + sphere-chain legs/tail on the CURRENT pose, rendering on the production shader like everything else. Gait parameters are data (amplitudes/period per call). license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_bodypose.nx nx_itrig.nx nx_quadruped.nx nx_quad_gaits_gate.nx nx_wolf_walk_gate.nx

imports: nx_syscalls.nxnx_bodypose.nxnx_itrig.nx

imported by: nx_quad_gaits_gate.nxnx_wolf_walk_gate.nx

structs

none

consts

11const QR_MAGIC_12868: i64 = 12868
12const QR_MAGIC_25736: i64 = 25736
13const QR_MAGIC_4096: i64 = 4096
14const QR_MAGIC_6434: i64 = 6434
15const QR_MAGIC_2048: i64 = 2048
16const QR_MAGIC_2300: i64 = 2300
17const QR_MAGIC_2900: i64 = 2900
19const QR_ROOT: i64 = 0
20const QR_CHEST: i64 = 1
21const QR_HEAD: i64 = 2
22const QR_HIPS: i64 = 3
23const QR_FLHIP: i64 = 4
24const QR_FLKNEE: i64 = 5
25const QR_FLFOOT: i64 = 6
26const QR_FRHIP: i64 = 7
27const QR_FRKNEE: i64 = 8
28const QR_FRFOOT: i64 = 9
29const QR_HLHIP: i64 = 10
30const QR_HLKNEE: i64 = 11
31const QR_HLFOOT: i64 = 12
32const QR_HRHIP: i64 = 13
33const QR_HRKNEE: i64 = 14
34const QR_HRFOOT: i64 = 15
35const QR_TAIL1: i64 = 16
36const QR_TAIL2: i64 = 17

functions

38func qdeg(d: i64) -> i64 { return d * QR_MAGIC_12868 / 180 }
41func quad_build(sk: i64) -> i64
called by 2: mainmain calls 2: sk_initsk_add_bone
66func quad_gait_pose(sk: i64, t4096: i64, swing_deg: i64) -> i64
called by 1: main calls 3: it_sin4096qdegsk_pose
93func qleg(a: i64, ampfx: i64, off: i64) -> i64 { let p: i64 = a + off * QR_MAGIC_25736 / QR_MAGIC_4096; return ampfx * it_sin4096(p) / QR_MAGIC_4096 }
called by 1: quad_gait_pose_g calls 1: it_sin4096
94func qabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: quad_gait_pose_g
98func quad_gait_pose_g(sk: i64, t4096: i64, gait: i64) -> i64
125func quad_add_horns(base: i64, n0: i64, sk: i64) -> i64
called by 1: main calls 3: sys_mmapbp_anchorsdf_clear_ops
138func quadpose_fill(base: i64, sk: i64) -> i64