X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_physics.h;h=85f3744be2a274f7f585a0ad3343466c90888c39;hb=6d98c1e42c1617a8a426f9f0c0df99b75725b486;hp=e396e0031d3771cb937a5955b73c5f13bbed2de3;hpb=3d8eaabcfd3b87fb52127eaa1241673e8d197bea;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_physics.h b/player_physics.h index e396e00..85f3744 100644 --- a/player_physics.h +++ b/player_physics.h @@ -551,11 +551,27 @@ VG_STATIC void player_physics(void) rb_debug( rbb, 0xffffff00 ); rb_ct manifold[64]; - int len = 0; + int len_f = 0, + len_b = 0; + + len_f = rb_sphere_scene( rbf, &world.rb_geo, manifold ); + rb_manifold_filter_coplanar( manifold, len_f, 0.05f ); + rb_manifold_filter_pairs( manifold, len_f, 0.05f ); + if( len_f > 1 ) + rb_manifold_filter_backface( manifold, len_f ); + len_f = rb_manifold_apply_filtered( manifold, len_f ); + + rb_ct *man_b = &manifold[len_f]; + len_b = rb_sphere_scene( rbb, &world.rb_geo, man_b ); + rb_manifold_filter_coplanar( man_b, len_b, 0.05f ); + rb_manifold_filter_pairs( man_b, len_b, 0.05f ); + if( len_b > 1 ) + rb_manifold_filter_backface( man_b, len_b ); + len_b = rb_manifold_apply_filtered( man_b, len_b ); - len += rb_sphere_scene( rbf, &world.rb_geo, manifold+len ); - len += rb_sphere_scene( rbb, &world.rb_geo, manifold+len ); + int len = len_f+len_b; +#if 0 /* * Preprocess collision points, and create a surface picture. * we want contacts that are within our 'capsule's internal line to be @@ -576,6 +592,7 @@ VG_STATIC void player_physics(void) v3_normalize( manifold[i].n ); } } +#endif rb_presolve_contacts( manifold, len ); v3f surface_avg = {0.0f, 0.0f, 0.0f};