code wiki / (root) / nx_gltf_anim.nx

nx_gltf_anim.nx

buildroot/runtime/nx_gltf_anim.nx

18843 B234 linesdepth 5pulls 8 transitivereach 3 importersview sourcekind librarytopic gltf
docsdependenciesstructsconstsfunctions

about

nx_gltf_anim.nx -- ★SKINNED + ANIMATED glTF export: the being as a rigged, WALKING .glb (plays in any glTF viewer). Reuses our FK rig: each mesh vertex is rigidly bound to its nearest part's deepest bone (joints supplied by the driver). 9 joints (root + L/R shoulder,elbow,hip,knee) in a 2-level hierarchy; inverse-bind = translate(-pivot); a walk-cycle animation = per-bone quaternion rotation keyframes about X (sagittal). Includes an integer float32 + fixed-point encoder. GENERALIZED 2026-08-10 (ws=dance-motion): the writer is now gltf_anim_export_qtrack (caller-supplied full-quaternion track, any key count, any animation name) and gltf_anim_export is the walk-table wrapper over it -- ONE writer, two callers, so real mocap (nx_dance_emit) and the synthetic walk share every byte of container logic. license_tier: ORIGINAL

dependencies 5 imports · 3 importers

nx_syscalls.nx nx_trimesh.nx nx_itrig.nx nx_gltf_mesh.nx nx_glbnorm_lib.nx nx_gltf_anim.nx nx_dance_emit.nx nx_gltf_anim_gate.nx nx_retarget_emit.nx

imports: nx_syscalls.nxnx_trimesh.nxnx_itrig.nxnx_gltf_mesh.nxnx_glbnorm_lib.nx

imported by: nx_dance_emit.nxnx_gltf_anim_gate.nxnx_retarget_emit.nx

structs

none

consts

14const GA_MAGIC_3217: i64 = 3217
15const GA_MAGIC_25736: i64 = 25736
16const GA_MAGIC_4096: i64 = 4096
17const GA_MAGIC_1400: i64 = 1400
18const GA_MAGIC_1700: i64 = 1700
19const GA_MAGIC_2400: i64 = 2400
20const GA_MAGIC_8192: i64 = 8192
21const GA_MAGIC_2000000000: i64 = 2000000000
22const GA_MAGIC_32767: i64 = 32767
23const GA_MAGIC_65535: i64 = 65535
24const GA_MAGIC_65536: i64 = 65536
29const GA_K: i64 = 9 // walk keyframes (dt = 1/8 s -> exact float times, 1.0 s cycle)
30const GA_NJ: i64 = 11 // joints: 0 root, 1 Lsh,2 Lel,3 Rsh,4 Rel,5 Lhip,6 Lkn,7 Rhip,8 Rkn, 9 Lank,10 Rank (ankle = the calf landmark, unanimated; debt 1785900993)

functions

27func ga_f32fx(n: i64, fb: i64) -> i64 { if n == 0 { return 0 } return gl_f32bits(n) - (fb<<23) }
called by 1: gltf_anim_export_qtrack calls 1: gl_f32bits
38func ga_piv(j: i64, axis: i64) -> i64
57func ga_angle(j: i64, k: i64) -> i64
76func gltf_anim_export_qtrack(out: *u8, jarr: *i64, qtrk: *i64, nk: i64, aname: *u8) -> i64
216func gltf_anim_export(out: *u8, jarr: *i64) -> i64