tone down triangle complainers
[carveJwlIkooP6JGAAIwe30JlM.git] / rigidbody.h
index 92419991f7b0e6f21c5659a63a2db9f5bfb9700c..1c1e8c8cd48f991ee642c65ab7023840b90ad29c 100644 (file)
@@ -852,7 +852,9 @@ VG_STATIC int rb_sphere__triangle( m4x3f mtxA, rb_sphere *b,
       v3_copy( tn, ct->n );
 
       if( v3_length2( ct->n ) <= 0.00001f ){
+#ifdef RIGIDBODY_CRY_ABOUT_EVERYTHING
          vg_error( "Zero area triangle!\n" );
+#endif
          return 0;
       }
 
@@ -960,6 +962,14 @@ VG_STATIC int rb_box__scene( m4x3f mtxA, boxf bbx,
       v3_sub( tri[1], tri[0], v0 );
       v3_sub( tri[2], tri[0], v1 );
       v3_cross( v0, v1, n );
+
+      if( v3_length2( n ) <= 0.00001f ){
+#ifdef RIGIDBODY_CRY_ABOUT_EVERYTHING
+         vg_error( "Zero area triangle!\n" );
+#endif
+         return 0;
+      }
+
       v3_normalize( n );
 
       /* find best feature */
@@ -1098,7 +1108,9 @@ VG_STATIC int rb_capsule__triangle( m4x3f mtxA, rb_capsule *c,
    v3_cross( v0, v1, n );
 
    if( v3_length2( n ) <= 0.00001f ){
+#ifdef RIGIDBODY_CRY_ABOUT_EVERYTHING
       vg_error( "Zero area triangle!\n" );
+#endif
       return 0;
    }