X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=rigidbody.h;h=282643a1eb0b01f6672207ea6e894d40f4beae46;hb=5ecf9cca8b5b9bf876d7e7c7fde03d5b187bb42b;hp=29e8cea766b19e44abeb861740afa490cf90abd7;hpb=c2d67378dd5c82de50b8fbbbe222ec6be2da4eee;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/rigidbody.h b/rigidbody.h index 29e8cea..282643a 100644 --- a/rigidbody.h +++ b/rigidbody.h @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved + */ + /* * Resources: Box2D - Erin Catto * qu3e - Randy Gaul @@ -629,7 +633,6 @@ static void closest_on_triangle( v3f p, v3f tri[3], v3f dest ) v3_muladds( dest, ac, w, dest ); } -/* TODO */ static void closest_on_triangle_1( v3f p, v3f tri[3], v3f dest ) { v3f ab, ac, ap; @@ -1073,7 +1076,6 @@ static int rb_capsule_box( rigidbody *rba, rigidbody *rbb, rb_ct *buf ) v3_sub( c1, p1, d1 ); v3_sub( p1, p0, da ); - /* TODO: ? */ v3_normalize(d0); v3_normalize(d1); v3_normalize(da); @@ -1331,7 +1333,6 @@ static int rb_box_scene( rigidbody *rba, rigidbody *rbb, rb_ct *buf ) axis = 1; } - /* TODO: THIS IS WRONG DIRECTION */ float cz = -v3_dot( rba->forward, n ); if( fabsf(cz) > fabsf(best) ) { @@ -1477,7 +1478,7 @@ static int rb_collide( rigidbody *rba, rigidbody *rbb ) } /* - * TODO: Replace this with a more dedicated broad phase pass + * FUTURE: Replace this with a more dedicated broad phase pass */ if( box_overlap( rba->bbx_world, rbb->bbx_world ) ) { @@ -1738,7 +1739,6 @@ static void rb_limit_cure( rigidbody *ra, rigidbody *rb, v3f axis, float d ) static void rb_constraint_limits( rigidbody *ra, v3f lca, rigidbody *rb, v3f lcb, v3f limits[2] ) { - /* TODO: Code dupe remover */ v3f ax, ay, az, bx, by, bz; m3x3_mulv( ra->to_world, (v3f){1.0f,0.0f,0.0f}, ax ); m3x3_mulv( ra->to_world, (v3f){0.0f,1.0f,0.0f}, ay ); @@ -1866,10 +1866,10 @@ static void rb_effect_simple_bouyency( rigidbody *ra, v4f plane, float depth = v3_dot( plane, ra->co ) - plane[3], lambda = vg_clampf( -depth, 0.0f, 1.0f ) * amt; - v3_muladds( ra->v, plane, lambda * ktimestep, ra->v ); + v3_muladds( ra->v, plane, lambda * VG_TIMESTEP_FIXED, ra->v ); if( depth < 0.0f ) - v3_muls( ra->v, 1.0f-(drag*ktimestep), ra->v ); + v3_muls( ra->v, 1.0f-(drag*VG_TIMESTEP_FIXED), ra->v ); } /*