nx_gltf_anim.nx
buildroot/runtime/nx_gltf_anim.nx
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
imports: nx_syscalls.nxnx_trimesh.nxnx_itrig.nxnx_gltf_mesh.nx
imported by: nx_gltf_anim_gate.nxnx_retarget_emit.nx
structs
| none |
consts
| 10 | const GA_MAGIC_3217: i64 = 3217 |
| 11 | const GA_MAGIC_25736: i64 = 25736 |
| 12 | const GA_MAGIC_4096: i64 = 4096 |
| 13 | const GA_MAGIC_1400: i64 = 1400 |
| 14 | const GA_MAGIC_1700: i64 = 1700 |
| 15 | const GA_MAGIC_2400: i64 = 2400 |
| 16 | const GA_MAGIC_8192: i64 = 8192 |
| 17 | const GA_MAGIC_2000000000: i64 = 2000000000 |
| 18 | const GA_MAGIC_32767: i64 = 32767 |
| 19 | const GA_MAGIC_65535: i64 = 65535 |
| 20 | const GA_MAGIC_65536: i64 = 65536 |
| 25 | const GA_K: i64 = 9 // walk keyframes (dt = 1/8 s -> exact float times, 1.0 s cycle) |
| 26 | const 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
| 23 | func ga_f32fx(n: i64, fb: i64) -> i64 { if n == 0 { return 0 } return gl_f32bits(n) - (fb<<23) } |
| 34 | func ga_piv(j: i64, axis: i64) -> i64 |
| 53 | func ga_angle(j: i64, k: i64) -> i64 |
| 69 | func gltf_anim_export(out: *u8, jarr: *i64) -> i64 |