+ /* additive effects */
+ u32 apply_to[] = { av->id_hip,
+ av->id_ik_hand_l,
+ av->id_ik_hand_r,
+ av->id_ik_elbow_l,
+ av->id_ik_elbow_r };
+
+ float apply_rates[] = { 1.0f,
+ 0.75f,
+ 0.75f,
+ 0.75f,
+ 0.75f };
+
+ for( int i=0; i<vg_list_size(apply_to); i ++ ){
+ pose->keyframes[apply_to[i]-1].co[0] += animator->offset[0]*add_grab_mod;
+ pose->keyframes[apply_to[i]-1].co[2] += animator->offset[2]*add_grab_mod;
+ }
+
+ /* angle 'correction' */
+ v3f origin;
+ v3_add( av->sk.bones[av->id_hip].co, kf_hip->co, origin );
+
+ for( int i=0; i<vg_list_size(apply_to); i ++ ){
+ mdl_keyframe *kf = &pose->keyframes[apply_to[i]-1];
+ keyframe_rotate_around( kf, origin, av->sk.bones[apply_to[i]].co,
+ animator->qfixuptotal );
+ }
+
+ /* trick rotation */
+ v4f qtrick, qyaw, qpitch, qroll;
+ q_axis_angle( qyaw, (v3f){0.0f,1.0f,0.0f}, animator->board_euler[0] );
+ q_axis_angle( qpitch, (v3f){1.0f,0.0f,0.0f}, animator->board_euler[1] );
+ q_axis_angle( qroll, (v3f){0.0f,0.0f,1.0f}, animator->board_euler[2] );
+
+ q_mul( qyaw, qroll, qtrick );
+ q_mul( qpitch, qtrick, qtrick );
+ q_mul( kf_board->q, qtrick, kf_board->q );
+ q_normalize( kf_board->q );
+
+ kf_foot_l->co[2] = vg_lerpf( kf_foot_l->co[2], animator->foot_offset[0],
+ 0.5f * animator->weight );
+ kf_foot_r->co[2] = vg_lerpf( kf_foot_r->co[2], animator->foot_offset[1],
+ -0.5f * animator->weight );
+
+ kf_foot_l->co[1] += animator->slap;
+ kf_foot_r->co[1] += animator->slap;
+ kf_knee_l->co[1] += animator->slap;
+ kf_knee_r->co[1] += animator->slap;
+ kf_board->co[1] += animator->slap * animator->subslap;
+ kf_hip->co[1] += animator->slap * 0.25f;
+
+ if( animator->trick_type == k_trick_type_kickflip ){
+ kf_foot_l->co[0] += animator->trick_foot * 0.2f;
+ kf_foot_l->co[1] -= animator->trick_foot * 0.18f;
+ }
+ else if( animator->trick_type == k_trick_type_shuvit ){
+ kf_foot_l->co[0] += animator->trick_foot * 0.1f;
+ kf_foot_r->co[0] -= animator->trick_foot * 0.15f;
+ kf_foot_l->co[1] -= animator->trick_foot * 0.18f;
+ kf_foot_r->co[1] -= animator->trick_foot * 0.18f;
+ }
+ else if( animator->trick_type == k_trick_type_treflip ){
+ kf_foot_l->co[0] += animator->trick_foot * 0.2f;
+ kf_foot_r->co[0] -= animator->trick_foot * 0.15f;
+ kf_foot_l->co[1] -= animator->trick_foot * 0.18f;
+ kf_foot_r->co[1] -= animator->trick_foot * 0.18f;
+ }