even more collision filtering
[carveJwlIkooP6JGAAIwe30JlM.git] / player_physics.h
index e396e0031d3771cb937a5955b73c5f13bbed2de3..85f3744be2a274f7f585a0ad3343466c90888c39 100644 (file)
@@ -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};