X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=skeleton.h;h=c5f59da39fcc31ab581e1e2396c73351b28bb863;hb=56f320d8ce6e8997370ec8e02fe50ca2d07b67f0;hp=4f35d58e25d50681b462cfac7596f3a8b02991da;hpb=2a238d32da833812e837cf38e16a7685c98db5c3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/skeleton.h b/skeleton.h index 4f35d58..c5f59da 100644 --- a/skeleton.h +++ b/skeleton.h @@ -61,10 +61,14 @@ VG_STATIC u32 skeleton_bone_id( struct skeleton *skele, const char *name ) return i; } + vg_error( "skeleton_bone_id( *, \"%s\" );\n", name ); + vg_fatal_exit_loop( "Bone does not exist\n" ); + return 0; } -VG_STATIC void keyframe_copy_pose( mdl_keyframe *kfa, mdl_keyframe *kfb, int num ) +VG_STATIC void keyframe_copy_pose( mdl_keyframe *kfa, mdl_keyframe *kfb, + int num ) { for( int i=0; ibone_count-1 ); } +VG_STATIC void skeleton_copy_pose( struct skeleton *skele, + mdl_keyframe *kfa, mdl_keyframe *kfd ) +{ + keyframe_copy_pose( kfa, kfd, skele->bone_count-1 ); +} + /* * Sample animation between 2 closest frames using time value. Output is a * keyframe buffer that is allocated with an appropriate size @@ -376,7 +386,7 @@ VG_STATIC void skeleton_apply_standard( struct skeleton *skele, mdl_keyframe *po * Get an animation by name */ VG_STATIC struct skeleton_anim *skeleton_get_anim( struct skeleton *skele, - const char *name ) + const char *name ) { for( int i=0; ianim_count; i++ ) { @@ -386,6 +396,9 @@ VG_STATIC struct skeleton_anim *skeleton_get_anim( struct skeleton *skele, return anim; } + vg_error( "skeleton_get_anim( *, \"%s\" )\n", name ); + vg_fatal_exit_loop( "Invalid animation name\n" ); + return NULL; }