better? grinds
[carveJwlIkooP6JGAAIwe30JlM.git] / player_walk.c
index 0a6a4856e9e40f6c525d65a17a4a5f0e5973acfa..d5f4aa0c28df9d57a1200ff762b6723f3f5c5bcb 100644 (file)
@@ -384,7 +384,7 @@ VG_STATIC void player__walk_update( player_instance *player )
          v3_add( surface_avg, ct->n, surface_avg );
       }
 
-      rb_prepare_contact( ct );
+      rb_prepare_contact( ct, k_rb_delta );
    }
 
    /* 
@@ -464,20 +464,7 @@ VG_STATIC void player__walk_update( player_instance *player )
     * Depenetrate
     */
    v3f dt;
-   v3_zero( dt );
-   for( int j=0; j<8; j++ )
-   {
-      for( int i=0; i<len; i++ )
-      {
-         struct contact *ct = &manifold[i];
-
-         float resolved_amt = v3_dot( ct->n, dt ),
-               remaining    = (ct->p-k_penetration_slop) - resolved_amt,
-               apply        = vg_maxf( remaining, 0.0f ) * 0.3f;
-
-         v3_muladds( dt, ct->n, apply, dt );
-      }
-   }
+   rb_depenetrate( manifold, len, dt );
    v3_add( dt, player->rb.co, player->rb.co );
 
    /* TODO: Stepping......
@@ -729,7 +716,7 @@ VG_STATIC void player__walk_animate( player_instance *player,
 
             v4_copy( dest->root_q, player->rb.q );
             v3_muladds( dest->root_co, player->rb.to_world[1], 
-                        -0.28f * dop_t, dest->root_co );
+                        -0.1f * dop_t, dest->root_co );
 
             skeleton_copy_pose( sk, dest->pose, player->holdout_pose );
             player->holdout_time = 1.0f;
@@ -739,7 +726,7 @@ VG_STATIC void player__walk_animate( player_instance *player,
       else
       {
          v3_muladds( dest->root_co, player->rb.to_world[1], 
-                     -0.28f * outro_t, dest->root_co );
+                     -0.1f * outro_t, dest->root_co );
 
          skeleton_copy_pose( sk, dest->pose, player->holdout_pose );
          player->holdout_time = 1.0f;