v2f steer = { player->input_js1h->axis.value,
player->input_js1v->axis.value };
v2_normalize_clamp( steer );
-
+ skate_apply_air_model( player );
#if 0
float maxspin = k_steer_air * k_rb_delta * k_spin_boost;
v3_muladds( dest->root_co, player->rb.to_world[1], -0.1f, dest->root_co );
float substep = vg_clampf( vg.accumulator / VG_TIMESTEP_FIXED, 0.0f, 1.0f );
-#if 0
- v4f qresy, qresx, qresidual;
- m3x3f mtx_residual;
- q_axis_angle( qresy, player->rb.to_world[1], s->state.steery_s*substep );
- q_axis_angle( qresx, player->rb.to_world[0], s->state.steerx_s*substep );
-
- q_mul( qresy, qresx, qresidual );
- q_normalize( qresidual );
- q_mul( dest->root_q, qresidual, dest->root_q );
- q_normalize( dest->root_q );
-#endif
v4f qflip;
if( (s->state.activity == k_skate_activity_air) &&
(fabsf(s->state.flip_rate) > 0.01f) )
{
- float t = s->state.flip_time + s->state.flip_rate*substep*k_rb_delta,
- angle = vg_clampf( t, -1.0f, 1.0f ) * VG_TAUf,
+ float t = s->state.flip_time;
+ sign = vg_signf( t );
+
+ t = 1.0f - vg_minf( 1.0f, fabsf( t * 1.1f ) );
+ t = sign * (1.0f-t*t);
+
+ float angle = vg_clampf( t, -1.0f, 1.0f ) * VG_TAUf,
distm = s->land_dist * fabsf(s->state.flip_rate) * 3.0f,
blend = vg_clampf( 1.0f-distm, 0.0f, 1.0f );