X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=rigidbody.h;h=324e5e1a45cf7eff25441714e276d664867b1491;hb=0a40a20806ec52fc13817fd78a43793de5e32ffa;hp=58b416eb072f982666a5f12ed6a4cc958b74aa90;hpb=964a1608fd269bda5fc632a618a861a527c6f868;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/rigidbody.h b/rigidbody.h index 58b416e..324e5e1 100644 --- a/rigidbody.h +++ b/rigidbody.h @@ -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; ico, ct->rba->co, ra );