}
vg_error( "skeleton_bone_id( *, \"%s\" );\n", name );
- vg_fatal_exit_loop( "Bone does not exist\n" );
+ vg_fatal_error( "Bone does not exist\n" );
return 0;
}
kfb[i] = kfa[i];
}
+
+/* apply a rotation from the perspective of root */
+VG_STATIC void keyframe_rotate_around( mdl_keyframe *kf,
+ v3f origin, v3f offset, v4f q )
+{
+ v3f v0, co;
+ v3_add( kf->co, offset, co );
+ v3_sub( co, origin, v0 );
+ q_mulv( q, v0, v0 );
+ v3_add( v0, origin, co );
+ v3_sub( co, offset, kf->co );
+
+ q_mul( q, kf->q, kf->q );
+ q_normalize( kf->q );
+}
+
/*
* Lerp between two sets of keyframes and store in dest. Rotations use Nlerp.
*/
}
vg_error( "skeleton_get_anim( *, \"%s\" )\n", name );
- vg_fatal_exit_loop( "Invalid animation name\n" );
+ vg_fatal_error( "Invalid animation name\n" );
return NULL;
}
VG_STATIC void skeleton_fatal_err(void)
{
- vg_fatal_exit_loop( "Skeleton setup failed" );
+ vg_fatal_error( "Skeleton setup failed" );
}
/* Setup an animated skeleton from model. mdl's metadata should stick around */