code wiki / (root) / nx_quadruped.nx

nx_quadruped.nx

buildroot/runtime/nx_quadruped.nx

17398 B298 linesdepth 5pulls 9 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
16const QR_PHASE_FULL: i64 = 4096
18const QR_TRIG_Q12: i64 = 4096
22const QR_PHASE_QUARTER: i64 = 1024
25const QR_ANGLE_QUARTER: i64 = 6434
26const QR_MAGIC_2048: i64 = 2048
27const QR_MAGIC_2300: i64 = 2300
28const QR_MAGIC_2900: i64 = 2900
30const QR_ROOT: i64 = 0
31const QR_CHEST: i64 = 1
32const QR_HEAD: i64 = 2
33const QR_HIPS: i64 = 3
34const QR_FLHIP: i64 = 4
35const QR_FLKNEE: i64 = 5
36const QR_FLFOOT: i64 = 6
37const QR_FRHIP: i64 = 7
38const QR_FRKNEE: i64 = 8
39const QR_FRFOOT: i64 = 9
40const QR_HLHIP: i64 = 10
41const QR_HLKNEE: i64 = 11
42const QR_HLFOOT: i64 = 12
43const QR_HRHIP: i64 = 13
44const QR_HRKNEE: i64 = 14
45const QR_HRFOOT: i64 = 15
46const QR_TAIL1: i64 = 16
47const QR_TAIL2: i64 = 17

functions

49func qdeg(d: i64) -> i64 { return d * QR_MAGIC_12868 / 180 }
61func quad_leg_swing(sk: i64, foot: i64, hip: i64) -> i64
called by 2: leg_sigquad_diag_phase calls 1: sk_bone
70func quad_diag_phase(sk: i64) -> i64
93func quad_diag_sync_permil(sk: i64, gait: i64, nsamp: i64) -> i64
115func quad_build(sk: i64) -> i64
called by 1: main calls 2: sk_initsk_add_bone
140func quad_gait_pose(sk: i64, t4096: i64, swing_deg: i64) -> i64
188func qleg(a: i64, ampfx: i64, off: i64) -> i64 { let p: i64 = a + off * QR_MAGIC_25736 / QR_TRIG_Q12; return ampfx * it_sin4096(p) / QR_TRIG_Q12 }
called by 1: quad_gait_pose_g calls 1: it_sin4096
189func qabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: quad_gait_pose_g
193func quad_gait_pose_g(sk: i64, t4096: i64, gait: i64) -> i64
240func quad_add_horns(base: i64, n0: i64, sk: i64) -> i64
called by 1: main calls 2: sys_mmapbp_anchor
253func quadpose_fill(base: i64, sk: i64) -> i64