some audio things
[carveJwlIkooP6JGAAIwe30JlM.git] / player_skate.c
index 3b9c7642b3fa4664f013f45748fc8ff096484048..5350b2eff84e185e0b8845e78e0d40de0d9c0861 100644 (file)
@@ -851,7 +851,7 @@ VG_STATIC void skate_apply_jump_model( player_instance *player )
       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;
@@ -2253,8 +2253,6 @@ begin_collision:;
 VG_STATIC void player__skate_im_gui( player_instance *player )
 {
    struct player_skate *s = &player->_skate;
-
-   /* FIXME: Compression */
    player__debugtext( 1, "V:  %5.2f %5.2f %5.2f",player->rb.v[0],
                                                 player->rb.v[1],
                                                 player->rb.v[2] );
@@ -2583,24 +2581,18 @@ VG_STATIC void player__skate_animate( player_instance *player,
    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 );
 
@@ -2628,7 +2620,7 @@ VG_STATIC void player__skate_post_animate( player_instance *player )
 
    player->cam_velocity_influence = 1.0f;
 
-   v3f head = { 0.0f, 1.8f, 0.0f }; /* FIXME: Viewpoint entity */
+   v3f head = { 0.0f, 1.8f, 0.0f };
    m4x3_mulv( av->sk.final_mtx[ av->id_head ], head, s->state.head_position );
    m4x3_mulv( player->rb.to_local, s->state.head_position, 
                                    s->state.head_position );