code wiki / (root) / nx_gltf_anim.nx

nx_gltf_anim.nx

buildroot/runtime/nx_gltf_anim.nx

16628 B195 linesdepth 4pulls 5 transitivereach 2 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. license_tier: ORIGINAL

dependencies 4 imports · 2 importers

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

imports: nx_syscalls.nxnx_trimesh.nxnx_itrig.nxnx_gltf_mesh.nx

imported by: nx_gltf_anim_gate.nxnx_retarget_emit.nx

structs

none

consts

10const GA_MAGIC_3217: i64 = 3217
11const GA_MAGIC_25736: i64 = 25736
12const GA_MAGIC_4096: i64 = 4096
13const GA_MAGIC_1400: i64 = 1400
14const GA_MAGIC_1700: i64 = 1700
15const GA_MAGIC_2400: i64 = 2400
16const GA_MAGIC_8192: i64 = 8192
17const GA_MAGIC_2000000000: i64 = 2000000000
18const GA_MAGIC_32767: i64 = 32767
19const GA_MAGIC_65535: i64 = 65535
20const GA_MAGIC_65536: i64 = 65536
25const GA_K: i64 = 9 // walk keyframes (dt = 1/8 s -> exact float times, 1.0 s cycle)
26const 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

23func ga_f32fx(n: i64, fb: i64) -> i64 { if n == 0 { return 0 } return gl_f32bits(n) - (fb<<23) }
called by 1: gltf_anim_export calls 1: gl_f32bits
34func ga_piv(j: i64, axis: i64) -> i64
53func ga_angle(j: i64, k: i64) -> i64
69func gltf_anim_export(out: *u8, jarr: *i64) -> i64