X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=rigidbody.h;h=398791341b592459f3b1e922ebfdb46a2fcf88a5;hb=72c40f1bc7a732f6a628dbf8a4135ac0bf3efa4e;hp=dfacf36c63a3f02ee1b52e543651410988039b2d;hpb=7398f8a24aaba107bafb5ab5c55141b94e10027b;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/rigidbody.h b/rigidbody.h index dfacf36..3987913 100644 --- a/rigidbody.h +++ b/rigidbody.h @@ -1509,8 +1509,7 @@ VG_STATIC int rb_sphere__scene( m4x3f mtxA, rb_sphere *b, v3_sub( mtxA[3], (v3f){ r,r,r }, box[0] ); v3_add( mtxA[3], (v3f){ r,r,r }, box[1] ); - while( bh_next( s->bh_scene, &it, box, &idx ) ) - { + while( bh_next( s->bh_scene, &it, box, &idx ) ){ u32 *ptri = &sc->arrindices[ idx*3 ]; v3f tri[3]; @@ -1526,8 +1525,7 @@ VG_STATIC int rb_sphere__scene( m4x3f mtxA, rb_sphere *b, int contact = rb_sphere__triangle( mtxA, b, tri, &buf[count] ); count += contact; - if( count == 16 ) - { + if( count == 16 ){ vg_warn( "Exceeding sphere_vs_scene capacity. Geometry too dense!\n" ); return count; } @@ -1999,8 +1997,7 @@ VG_STATIC int rb_capsule__scene( m4x3f mtxA, rb_capsule *c, scene *sc = s->bh_scene->user; - while( bh_next( s->bh_scene, &it, bbx, &idx ) ) - { + while( bh_next( s->bh_scene, &it, bbx, &idx ) ){ u32 *ptri = &sc->arrindices[ idx*3 ]; v3f tri[3]; @@ -2012,8 +2009,7 @@ VG_STATIC int rb_capsule__scene( m4x3f mtxA, rb_capsule *c, int contact = rb_capsule__triangle( mtxA, c, tri, &buf[count] ); count += contact; - if( count >= 16 ) - { + if( count >= 16 ){ vg_warn("Exceeding capsule_vs_scene capacity. Geometry too dense!\n"); return count; } @@ -2208,8 +2204,7 @@ VG_STATIC void rb_depenetrate( rb_ct *manifold, int len, v3f dt ) */ VG_STATIC void rb_presolve_contacts( rb_ct *buffer, int len ) { - for( int i=0; inormal_mass += v3_dot( rbCn, rbCnI ); ct->normal_mass = 1.0f/ct->normal_mass; - for( int j=0; j<2; j++ ) - { + for( int j=0; j<2; j++ ){ v3f raCtI, rbCtI; v3_cross( ct->t[j], ra, raCt ); v3_cross( ct->t[j], rb, rbCt ); @@ -2282,8 +2276,7 @@ VG_STATIC void rb_linear_impulse( rigidbody *rb, v3f delta, v3f impulse ) */ VG_STATIC void rb_solve_contacts( rb_ct *buf, int len ) { - for( int i=0; irba, ct->rbb, ra, rb, rv ); /* Friction */ - for( int j=0; j<2; j++ ) - { + for( int j=0; j<2; j++ ){ float f = k_friction * ct->norm_impulse, vt = v3_dot( rv, ct->t[j] ), lambda = ct->tangent_mass[j] * -vt;