+ /*
+ * Preprocess collision points, and create a surface picture.
+ * we want contacts that are within our 'capsule's internal line to be
+ * clamped so that they face the line and do not oppose, to stop the
+ * player hanging up on stuff
+ */
+ for( int i=0; i<len; i++ )
+ {
+ v3f dfront, dback;
+ v3_sub( manifold[i].co, rbf->co, dfront );
+ v3_sub( manifold[i].co, rbb->co, dback );
+
+ if( (v3_dot( dfront, phys->rb.forward ) < -0.02f) &&
+ (v3_dot( dback, phys->rb.forward ) > 0.02f))
+ {
+ float p = v3_dot( manifold[i].n, phys->rb.forward );
+ v3_muladds( manifold[i].n, phys->rb.forward, -p, manifold[i].n );
+ v3_normalize( manifold[i].n );
+ }
+ }
+