code wiki / (root) / nx_pose_retarget.nx

nx_pose_retarget.nx

buildroot/runtime/nx_pose_retarget.nx

3723 B73 linesdepth 3pulls 5 transitivereach 37 importersview sourcekind librarytopic pose
docsdependenciesstructsconstsfunctions

about

nx_pose_retarget.nx -- RETARGET a pose track (joint world POSITIONS) onto our rig's joint ANGLES (roadmap R3, the video->pose->MOTION heart: once R2 turns pixels into joint positions, this makes them DRIVE our rig -> motion clips for the move library / text2motion corpus, fixing the no-mocap ceiling). Inverts the sovereign FK (worldR=Ry(yaw)*Rz(elev), bones along +x -> aimed dir = (cy*ce, se, -sy*ce)): per bone aim its child, so elev=asin(dir_y), yaw=atan2(-dir_z, dir_x) in the PARENT's local frame. Chain form (each bone -> next). Needs integer atan2/asin, built on the it_* tables. license_tier: ORIGINAL

dependencies 4 imports · 2 importers

nx_syscalls.nx nx_skeleton.nx nx_itrig.nx nx_vecmath.nx nx_pose_retarget.nx nx_nxa_texc_lib.nx nx_pose_retarget_gate.nx

imports: nx_syscalls.nxnx_skeleton.nxnx_itrig.nxnx_vecmath.nx

imported by: nx_nxa_texc_lib.nxnx_pose_retarget_gate.nx

structs

none

consts

11const K_MAGIC_25736: i64 = 25736
12const K_MAGIC_4096: i64 = 4096
13const K_MAGIC_12868: i64 = 12868

functions

15func rt_isqrt(v: i64) -> i64 { return vm_isqrt(v) }
19func rt_atan2(y: i64, x: i64) -> i64
35func rt_asin(s: i64) -> i64
called by 1: rt_retarget_chain calls 2: rt_atan2rt_isqrt
45func rt_retarget_chain(base: i64, targets: *i64, nbones: i64) -> i64