/* copy xyz */
VectorCopy( dv->xyz, points[ j ] );
+#if ! Q3MAP2_EXPERIMENTAL_MODEL_CLIPPING_FIX
+ // The code below is totally unneeded regardless of Q3MAP2_EXPERIMENTAL_MODEL_CLIPPING_FIX.
+ // backs is reinitialized further below. However, the extra code does not hurt anything.
VectorCopy( dv->xyz, backs[ j ] );
/* find nearest axial to normal and push back points opposite */
break;
}
}
+#endif
}
/* make plane for triangle */
/* find nearest axial to plane normal and push back points opposite */
for( k = 0; k < 3; k++ )
{
+#if Q3MAP2_EXPERIMENTAL_MODEL_CLIPPING_FIX
+ if( fabs( plane[ k ] ) >= fabs( plane[ (k + 1) % 3 ] ) &&
+ fabs( plane[ k ] ) >= fabs( plane[ (k + 2) % 3 ] ) )
+#else
+ // This code is broken for 45 degree angles where there
+ // is no clear winner.
if( fabs( plane[ k ] ) > fabs( plane[ (k + 1) % 3 ] ) &&
fabs( plane[ k ] ) > fabs( plane[ (k + 2) % 3 ] ) )
+#endif
{
backs[ j ][ k ] += plane[ k ] < 0.0f ? 64.0f : -64.0f;
break;
#define Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES 1
#define Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX 1
#define Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX 1
+#define Q3MAP2_EXPERIMENTAL_MODEL_CLIPPING_FIX 1
/* general */
#define MAX_QPATH 64