get fak
[carveJwlIkooP6JGAAIwe30JlM.git] / rigidbody.h
index 58b416eb072f982666a5f12ed6a4cc958b74aa90..324e5e1a45cf7eff25441714e276d664867b1491 100644 (file)
@@ -1993,14 +1993,12 @@ VG_STATIC rb_ct *rb_global_ct(void)
    return rb_contact_buffer + rb_contact_count;
 }
 
-VG_STATIC void rb_prepare_contact( rb_ct *ct )
+VG_STATIC void rb_prepare_contact( rb_ct *ct, float timestep )
 {
-   ct->bias = -0.2f * k_rb_rate * vg_minf( 0.0f, -ct->p+k_penetration_slop );
+   ct->bias = -0.2f * (timestep*3600.0f) 
+               * vg_minf( 0.0f, -ct->p+k_penetration_slop );
+   
    rb_tangent_basis( ct->n, ct->t[0], ct->t[1] );
-
-#if 0
-   ct->type = k_contact_type_default;
-#endif
    ct->norm_impulse = 0.0f;
    ct->tangent_impulse[0] = 0.0f;
    ct->tangent_impulse[1] = 0.0f;
@@ -2014,7 +2012,7 @@ VG_STATIC void rb_presolve_contacts( rb_ct *buffer, int len )
    for( int i=0; i<len; i++ )
    {
       rb_ct *ct = &buffer[i];
-      rb_prepare_contact( ct );
+      rb_prepare_contact( ct, k_rb_delta );
 
       v3f ra, rb, raCn, rbCn, raCt, rbCt;
       v3_sub( ct->co, ct->rba->co, ra );