::zerowing-base=428
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 12 Jan 2011 12:58:55 +0000 (13:58 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 12 Jan 2011 12:58:55 +0000 (13:58 +0100)
17 files changed:
libs/mathlib.h
libs/mathlib/mathlib.c
regression_tests/q3map2/decal_misalignment/README.txt [new file with mode: 0644]
regression_tests/q3map2/decal_misalignment/maps/decal_misalignment.map [new file with mode: 0644]
regression_tests/q3map2/decal_misalignment/scripts/radiant_regression_tests.shader [new file with mode: 0644]
regression_tests/q3map2/disappearing_sliver3/NOTES.txt
regression_tests/q3map2/model_clipping_45_degrees/README.txt [new file with mode: 0644]
regression_tests/q3map2/model_clipping_45_degrees/maps/model_clipping_45_degrees.map [new file with mode: 0644]
regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_45.ase [new file with mode: 0644]
regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_shallow.ase [new file with mode: 0644]
regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_steep.ase [new file with mode: 0644]
regression_tests/q3map2/model_clipping_45_degrees/scripts/radiant_regression_tests.shader [new file with mode: 0644]
regression_tests/q3map2/piercing_triangle/README.txt [new file with mode: 0644]
regression_tests/q3map2/piercing_triangle/maps/piercing_triangle.map [new file with mode: 0644]
tools/quake3/q3map2/brush.c
tools/quake3/q3map2/map.c
tools/quake3/q3map2/q3map2.h

index 62edd11..382933d 100644 (file)
@@ -98,6 +98,9 @@ vec_t VectorLength(const vec3_t v);
 void VectorMA( const vec3_t va, vec_t scale, const vec3_t vb, vec3_t vc );
 
 void _CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
+// I need this define in order to test some of the regression tests from time to time.
+// This define affect the precision of VectorNormalize() function only.
+#define MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX 1
 vec_t VectorNormalize (const vec3_t in, vec3_t out);
 vec_t ColorNormalize( const vec3_t in, vec3_t out );
 void VectorInverse (vec3_t v);
index 1286ec3..2b005dc 100644 (file)
@@ -78,6 +78,54 @@ qboolean VectorIsOnAxialPlane(vec3_t v)
        return qfalse;
 }
 
+/*
+================
+VectorIsOnAxis
+================
+*/
+qboolean VectorIsOnAxis(vec3_t v)
+{
+       int     i, zeroComponentCount;
+
+       zeroComponentCount = 0;
+       for (i = 0; i < 3; i++)
+       {
+               if (v[i] == 0.0)
+               {
+                       zeroComponentCount++;
+               }
+       }
+
+       if (zeroComponentCount > 1)
+       {
+               // The zero vector will be on axis.
+               return qtrue;
+       }
+
+       return qfalse;
+}
+
+/*
+================
+VectorIsOnAxialPlane
+================
+*/
+qboolean VectorIsOnAxialPlane(vec3_t v)
+{
+       int     i;
+
+       for (i = 0; i < 3; i++)
+       {
+               if (v[i] == 0.0)
+               {
+                       // The zero vector will be on axial plane.
+                       return qtrue;
+               }
+       }
+
+       return qfalse;
+}
+
 /*
 ================
 MakeNormalVectors
@@ -168,6 +216,8 @@ void _VectorCopy (vec3_t in, vec3_t out)
 
 vec_t VectorNormalize( const vec3_t in, vec3_t out ) {
 
+#if MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX
+
        // The sqrt() function takes double as an input and returns double as an
        // output according the the man pages on Debian and on FreeBSD.  Therefore,
        // I don't see a reason why using a double outright (instead of using the
@@ -191,6 +241,27 @@ vec_t VectorNormalize( const vec3_t in, vec3_t out ) {
        out[2] = (vec_t) (z / length);
 
        return (vec_t) length;
+
+#else
+
+       vec_t   length, ilength;
+
+       length = (vec_t)sqrt (in[0]*in[0] + in[1]*in[1] + in[2]*in[2]);
+       if (length == 0)
+       {
+               VectorClear (out);
+               return 0;
+       }
+
+       ilength = 1.0f/length;
+       out[0] = in[0]*ilength;
+       out[1] = in[1]*ilength;
+       out[2] = in[2]*ilength;
+
+       return length;
+
+#endif
+
 }
 
 vec_t ColorNormalize( const vec3_t in, vec3_t out ) {
@@ -643,6 +714,156 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
 }
 
 
+////////////////////////////////////////////////////////////////////////////////
+// Below is double-precision math stuff.  This was initially needed by the new
+// "base winding" code in q3map2 brush processing in order to fix the famous
+// "disappearing triangles" issue.  These definitions can be used wherever extra
+// precision is needed.
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+=================
+VectorLengthAccu
+=================
+*/
+vec_accu_t VectorLengthAccu(const vec3_accu_t v)
+{
+       return (vec_accu_t) sqrt((v[0] * v[0]) + (v[1] * v[1]) + (v[2] * v[2]));
+}
+
+/*
+=================
+DotProductAccu
+=================
+*/
+vec_accu_t DotProductAccu(const vec3_accu_t a, const vec3_accu_t b)
+{
+       return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);
+}
+
+/*
+=================
+VectorSubtractAccu
+=================
+*/
+void VectorSubtractAccu(const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out)
+{
+       out[0] = a[0] - b[0];
+       out[1] = a[1] - b[1];
+       out[2] = a[2] - b[2];
+}
+
+/*
+=================
+VectorAddAccu
+=================
+*/
+void VectorAddAccu(const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out)
+{
+       out[0] = a[0] + b[0];
+       out[1] = a[1] + b[1];
+       out[2] = a[2] + b[2];
+}
+
+/*
+=================
+VectorCopyAccu
+=================
+*/
+void VectorCopyAccu(const vec3_accu_t in, vec3_accu_t out)
+{
+       out[0] = in[0];
+       out[1] = in[1];
+       out[2] = in[2];
+}
+
+/*
+=================
+VectorScaleAccu
+=================
+*/
+void VectorScaleAccu(const vec3_accu_t in, vec_accu_t scaleFactor, vec3_accu_t out)
+{
+       out[0] = in[0] * scaleFactor;
+       out[1] = in[1] * scaleFactor;
+       out[2] = in[2] * scaleFactor;
+}
+
+/*
+=================
+CrossProductAccu
+=================
+*/
+void CrossProductAccu(const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out)
+{
+       out[0] = (a[1] * b[2]) - (a[2] * b[1]);
+       out[1] = (a[2] * b[0]) - (a[0] * b[2]);
+       out[2] = (a[0] * b[1]) - (a[1] * b[0]);
+}
+
+/*
+=================
+Q_rintAccu
+=================
+*/
+vec_accu_t Q_rintAccu(vec_accu_t val)
+{
+       return (vec_accu_t) floor(val + 0.5);
+}
+
+/*
+=================
+VectorCopyAccuToRegular
+=================
+*/
+void VectorCopyAccuToRegular(const vec3_accu_t in, vec3_t out)
+{
+       out[0] = (vec_t) in[0];
+       out[1] = (vec_t) in[1];
+       out[2] = (vec_t) in[2];
+}
+
+/*
+=================
+VectorCopyRegularToAccu
+=================
+*/
+void VectorCopyRegularToAccu(const vec3_t in, vec3_accu_t out)
+{
+       out[0] = (vec_accu_t) in[0];
+       out[1] = (vec_accu_t) in[1];
+       out[2] = (vec_accu_t) in[2];
+}
+
+/*
+=================
+VectorNormalizeAccu
+=================
+*/
+vec_accu_t VectorNormalizeAccu(const vec3_accu_t in, vec3_accu_t out)
+{
+       // The sqrt() function takes double as an input and returns double as an
+       // output according the the man pages on Debian and on FreeBSD.  Therefore,
+       // I don't see a reason why using a double outright (instead of using the
+       // vec_accu_t alias for example) could possibly be frowned upon.
+
+       vec_accu_t      length;
+
+       length = (vec_accu_t) sqrt((in[0] * in[0]) + (in[1] * in[1]) + (in[2] * in[2]));
+       if (length == 0)
+       {
+               VectorClear(out);
+               return 0;
+       }
+
+       out[0] = in[0] / length;
+       out[1] = in[1] / length;
+       out[2] = in[2] / length;
+
+       return length;
+}
+
+
 ////////////////////////////////////////////////////////////////////////////////
 // Below is double-precision math stuff.  This was initially needed by the new
 // "base winding" code in q3map2 brush processing in order to fix the famous
diff --git a/regression_tests/q3map2/decal_misalignment/README.txt b/regression_tests/q3map2/decal_misalignment/README.txt
new file mode 100644 (file)
index 0000000..f9aa3d6
--- /dev/null
@@ -0,0 +1,16 @@
+DESCRIPTION OF PROBLEM:
+=======================
+
+The info_null in the map for the decal is not 100% below the center of the
+decal itself, because to be totally below it would have to lie on half-units.
+So, the info_null lies almost directly below the center of the decal.  In
+this particular case, all kinds of bad things happen to the decal.  For one,
+during compiling we get warnings like this:
+
+  Bad texture matrix! (B) (50.512253, -49.515625) != (50.484375, -49.515625)
+  Bad texture matrix! (C) (48.723190, -49.522587) != (48.695312, -49.515625)
+  Bad texture matrix! (B) (48.723186, -49.522587) != (48.695312, -49.515625)
+
+If you look at where the decal (it's just a blue translucent tile texture)
+meets the far wall, it's clearly not aligned correctly.  The tile on the decal
+and the tile on the wall should align perfectly, and it's quite a bit off.
diff --git a/regression_tests/q3map2/decal_misalignment/maps/decal_misalignment.map b/regression_tests/q3map2/decal_misalignment/maps/decal_misalignment.map
new file mode 100644 (file)
index 0000000..b764bf2
--- /dev/null
@@ -0,0 +1,89 @@
+{
+"classname" "worldspawn"
+{
+( 6472 6336 -960 ) ( 6288 6336 -960 ) ( 6288 6320 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6264 6320 -576 ) ( 6264 6336 -576 ) ( 6448 6336 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6280 6328 -832 ) ( 6464 6328 -832 ) ( 6464 6328 -848 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6320 -832 ) ( 6464 6336 -832 ) ( 6464 6336 -848 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6336 -832 ) ( 6280 6336 -832 ) ( 6280 6336 -848 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 6144 6336 -832 ) ( 6144 6320 -832 ) ( 6144 6320 -848 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( 6552 6520 -960 ) ( 6464 6520 -960 ) ( 6464 6336 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6336 -576 ) ( 6464 6520 -576 ) ( 6552 6520 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6336 -576 ) ( 6552 6336 -576 ) ( 6552 6336 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6472 6344 -576 ) ( 6472 6528 -576 ) ( 6472 6528 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6528 7360 -576 ) ( 6440 7360 -576 ) ( 6440 7360 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6520 -576 ) ( 6464 6336 -576 ) ( 6464 6336 -960 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+}
+{
+( 6464 7424 -960 ) ( 6144 7424 -960 ) ( 6144 7360 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 7360 -576 ) ( 6144 7424 -576 ) ( 6464 7424 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 7360 -576 ) ( 6464 7360 -576 ) ( 6464 7360 -960 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 6464 7360 -576 ) ( 6464 7424 -576 ) ( 6464 7424 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 7368 -576 ) ( 6144 7368 -576 ) ( 6144 7368 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 7424 -576 ) ( 6144 7360 -576 ) ( 6144 7360 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( 6144 7360 -960 ) ( 5880 7360 -960 ) ( 5880 6808 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 5880 6808 -576 ) ( 5880 7360 -576 ) ( 6144 7360 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 5864 6336 -576 ) ( 6128 6336 -576 ) ( 6128 6336 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 6808 -576 ) ( 6144 7360 -576 ) ( 6144 7360 -960 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 6144 7360 -576 ) ( 5880 7360 -576 ) ( 5880 7360 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6136 7384 -576 ) ( 6136 6832 -576 ) ( 6136 6832 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( 6456 7360 -968 ) ( 6136 7360 -968 ) ( 6136 6336 -968 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 6336 -960 ) ( 6144 7360 -960 ) ( 6464 7360 -960 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 6144 6336 -960 ) ( 6464 6336 -960 ) ( 6464 6336 -1008 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6336 -960 ) ( 6464 7360 -960 ) ( 6464 7360 -1008 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 7360 -960 ) ( 6144 7360 -960 ) ( 6144 7360 -1008 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 7360 -960 ) ( 6144 6336 -960 ) ( 6144 6336 -1008 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( 6464 7360 -576 ) ( 6152 7360 -576 ) ( 6152 6336 -576 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 6176 6336 -568 ) ( 6176 7360 -568 ) ( 6488 7360 -568 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6152 6336 -472 ) ( 6464 6336 -472 ) ( 6464 6336 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 6336 -472 ) ( 6464 7360 -472 ) ( 6464 7360 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6464 7360 -472 ) ( 6152 7360 -472 ) ( 6152 7360 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 6144 7360 -472 ) ( 6144 6336 -472 ) ( 6144 6336 -576 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( 6200 7360 -896 ) ( 6200 6336 -896 ) ( 6592 6336 -896 ) radiant_regression_tests/glass 0 0 0 0.500000 0.500000 134217728 257 0
+( 6360 6336 -832 ) ( 6360 7256 -832 ) ( 6464 7256 -832 ) radiant_regression_tests/glass 0 0 0 0.500000 0.500000 134217728 257 0
+( 6208 6337 -832 ) ( 6400 6337 -832 ) ( 6400 6337 -896 ) radiant_regression_tests/glass 0 0 0 0.500000 0.500000 134217728 257 0
+( 6463 6336 -816 ) ( 6463 7360 -816 ) ( 6463 7360 -880 ) radiant_regression_tests/glass 0 0 0 0.500000 0.500000 134217728 257 0
+( 6232 7264 -896 ) ( 6232 7264 -832 ) ( 6232 6337 -896 ) radiant_regression_tests/glass 0 0 0 0.500000 0.500000 134217728 257 0
+( 6232 7256 -832 ) ( 6232 7256 -896 ) ( 6463 7256 -832 ) radiant_regression_tests/glass 0 0 0 0.500000 0.500000 134217728 257 0
+}
+}
+{
+"target" "checker"
+"classname" "_decal"
+{
+patchDef2
+{
+radiant_regression_tests/tile_trans
+( 3 3 0 0 0 )
+(
+( ( 6462 7255 -832 50.484375 -56.679688 ) ( 6462 6796.500000 -832 50.484375 -53.097656 ) ( 6462 6338 -832 50.484375 -49.515625 ) )
+( ( 6347.500000 7255 -832 49.589844 -56.679688 ) ( 6347.500000 6796.500000 -832 49.589844 -53.097656 ) ( 6347.500000 6338 -832 49.589844 -49.515625 ) )
+( ( 6233 7255 -832 48.695312 -56.679688 ) ( 6233 6796.500000 -832 48.695312 -53.097656 ) ( 6233 6338 -832 48.695312 -49.515625 ) )
+)
+}
+}
+}
+{
+"targetname" "checker"
+"origin" "6347 6796 -840"
+"classname" "info_null"
+}
+{
+"origin" "6288 6704 -712"
+"classname" "info_player_deathmatch"
+}
+{
+"light" "2000"
+"origin" "6304 6792 -704"
+"classname" "light"
+}
diff --git a/regression_tests/q3map2/decal_misalignment/scripts/radiant_regression_tests.shader b/regression_tests/q3map2/decal_misalignment/scripts/radiant_regression_tests.shader
new file mode 100644 (file)
index 0000000..af31c07
--- /dev/null
@@ -0,0 +1,29 @@
+textures/radiant_regression_tests/tile_trans
+{
+    qer_trans 0.9
+    q3map_bounceScale 0.0
+    surfaceparm trans
+    cull disable
+    polygonOffset
+    {
+        map textures/radiant_regression_tests/tile_trans.tga
+        blendFunc blend
+        alphaGen const 1
+    }
+}
+
+textures/radiant_regression_tests/glass
+{
+    qer_editorImage textures/radiant_regression_tests/qer_glass.tga
+    qer_trans 0.6
+    q3map_bounceScale 0.0
+    surfaceparm nolightmap
+    surfaceparm detail
+    surfaceparm trans
+    cull disable
+    {
+        map textures/radiant_regression_tests/glass.tga
+        blendFunc add
+        tcGen environment
+    }
+}
index aebd534..70bb752 100644 (file)
@@ -34,3 +34,39 @@ After clipping side 0 against side 1 should have
 **** (-262144, -33762.8) -> (262144, 63722)
 ************
 
+Random notes for Rambetter, don't expect to understand this:
+============================================================
+
+Brush 0 is the problem.
+
+Side 0 is the problem (under surf tri).
+Side 1 is the +y 4-face.
+Side 2 is the -x 4-face.
+Side 3 is the -y 4-face.
+side 4 is the +z tri.
+
+(6144, 16122) -> (6784, 16241)
+x "climb" of side 1 is 6784 - 6144 = 640.
+y "climb" of side 1 is 16241 - 16122 = 119.
+
+x/y "climb rate" of side 1 is 640 / 119 = 5.378151261.
+
+After clipping side 0 against side 1, we get
+************
+**** (-262144, -33762.8125) -> (262144, 63722)
+************
+The slope of that is (262144 + 262144) / (63722 + 33762.8125) = 5.378150571. 
+
+(-262144, y) -> (6784, 16241)
+So (6784 + 262144) / (16241 - y) = 640 / 119
+So y = 16241 - ((119 * (6784 + 262144)) / 640) = -33762.8
+
+(6144, 16122) -> (262144, y)
+So (262144 - 6144) / (y - 16122) = 640 / 119
+So y = 16122 + ((119 * (262144 - 6144)) / 640) = 63722
+
+After clipping side 0 against side 1 should have
+************
+**** (-262144, -33762.8) -> (262144, 63722)
+************
+
diff --git a/regression_tests/q3map2/model_clipping_45_degrees/README.txt b/regression_tests/q3map2/model_clipping_45_degrees/README.txt
new file mode 100644 (file)
index 0000000..c3c2f88
--- /dev/null
@@ -0,0 +1,7 @@
+DESCRIPTION OF PROBLEM:
+=======================
+
+There are 3 model wedges in the map that are auto-clipped.  The middle wedge
+with the 45 degree slope is the problem.  The slope face does not become solid;
+therefore, there is a nonsolid "hole" on the wedge part.  The other two wedges
+are fine.  45 degrees seems to be a problem for model clipping.
diff --git a/regression_tests/q3map2/model_clipping_45_degrees/maps/model_clipping_45_degrees.map b/regression_tests/q3map2/model_clipping_45_degrees/maps/model_clipping_45_degrees.map
new file mode 100644 (file)
index 0000000..f358dba
--- /dev/null
@@ -0,0 +1,81 @@
+{
+"classname" "worldspawn"
+{
+( 392 512 -8 ) ( 0 512 -8 ) ( 0 448 -8 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 0 448 0 ) ( 0 512 0 ) ( 392 512 0 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 104 -192 0 ) ( 496 -192 0 ) ( 496 -192 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 448 0 ) ( 384 512 0 ) ( 384 512 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 400 640 0 ) ( 8 640 0 ) ( 8 640 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 528 0 ) ( -128 464 0 ) ( -128 464 -16 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -128 688 320 ) ( -128 640 320 ) ( -128 640 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 648 320 ) ( -128 648 320 ) ( -128 648 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 640 320 ) ( 384 688 320 ) ( 384 688 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 640 320 ) ( 384 640 320 ) ( 384 640 0 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( -128 640 320 ) ( -128 688 320 ) ( 384 688 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 688 0 ) ( -128 688 0 ) ( -128 640 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -128 -184 328 ) ( -128 -240 328 ) ( -128 -240 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 -192 328 ) ( -128 -192 328 ) ( -128 -192 0 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 384 -240 328 ) ( 384 -184 328 ) ( 384 -184 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 -200 320 ) ( 384 -200 320 ) ( 384 -200 -8 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 -240 320 ) ( -128 -184 320 ) ( 384 -184 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 -184 0 ) ( -128 -184 0 ) ( -128 -240 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -128 248 392 ) ( -128 -192 392 ) ( -128 -192 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 640 408 ) ( -128 640 408 ) ( -128 640 336 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 -192 392 ) ( 384 248 392 ) ( 384 248 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 -192 392 ) ( 384 -192 392 ) ( 384 -192 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 -176 328 ) ( -128 264 328 ) ( 384 264 328 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 248 320 ) ( -128 248 320 ) ( -128 -192 320 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+}
+{
+( 384 640 320 ) ( 384 -192 320 ) ( 384 -192 0 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( 432 640 320 ) ( 384 640 320 ) ( 384 640 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 392 -192 320 ) ( 392 640 320 ) ( 392 640 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 -192 320 ) ( 432 -192 320 ) ( 432 -192 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 384 -192 320 ) ( 384 640 320 ) ( 432 640 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 432 640 0 ) ( 384 640 0 ) ( 384 -192 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -136 640 328 ) ( -136 -192 328 ) ( -136 -192 8 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 640 312 ) ( -224 640 312 ) ( -224 640 -8 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 -192 312 ) ( -128 640 312 ) ( -128 640 -8 ) radiant_regression_tests/bigtile 0 0 0 0.500000 0.500000 0 0 0
+( -224 -192 312 ) ( -128 -192 312 ) ( -128 -192 -8 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -224 -192 320 ) ( -224 640 320 ) ( -128 640 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -128 640 0 ) ( -224 640 0 ) ( -224 -192 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+}
+{
+"model" "models/mapobjects/wedges/wedge_shallow.ase"
+"origin" "0 -96 0"
+"classname" "misc_model"
+}
+{
+"model" "models/mapobjects/wedges/wedge_45.ase"
+"origin" "0 160 0"
+"classname" "misc_model"
+}
+{
+"model" "models/mapobjects/wedges/wedge_steep.ase"
+"origin" "0 416 0"
+"classname" "misc_model"
+}
+{
+"classname" "light"
+"origin" "192 384 160"
+"light" "800"
+}
+{
+"light" "800"
+"origin" "192 64 160"
+"classname" "light"
+}
+{
+"classname" "info_player_deathmatch"
+"origin" "256 208 128"
+"angle" "225"
+}
diff --git a/regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_45.ase b/regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_45.ase
new file mode 100644 (file)
index 0000000..dfb0d41
--- /dev/null
@@ -0,0 +1,368 @@
+*3DSMAX_ASCIIEXPORT    200\r
+*COMMENT       "Generated by Q3Map2 (ydnar) -convert -format ase"\r
+*SCENE {\r
+       *SCENE_FILENAME "wedge_45.bsp"\r
+       *SCENE_FIRSTFRAME       0\r
+       *SCENE_LASTFRAME        100\r
+       *SCENE_FRAMESPEED       30\r
+       *SCENE_TICKSPERFRAME    160\r
+       *SCENE_BACKGROUND_STATIC        0.0000  0.0000  0.0000\r
+       *SCENE_AMBIENT_STATIC   0.0000  0.0000  0.0000\r
+}\r
+*MATERIAL_LIST {\r
+       *MATERIAL_COUNT 2\r
+       *MATERIAL       0       {\r
+               *MATERIAL_NAME  "textures/radiant_regression_tests/tile_model"\r
+               *MATERIAL_CLASS "Standard"\r
+               *MATERIAL_DIFFUSE       1.000000        1.000000        0.833333\r
+               *MATERIAL_SHADING Phong\r
+               *MAP_DIFFUSE    {\r
+                       *MAP_NAME       "textures/radiant_regression_tests/tile_model"\r
+                       *MAP_CLASS      "Bitmap"\r
+                       *MAP_SUBNO      1\r
+                       *MAP_AMOUNT     1.0\r
+                       *MAP_TYPE       Screen\r
+                       *BITMAP "..\textures\radiant_regression_tests\tile_model.tga"\r
+                       *BITMAP_FILTER  Pyramidal\r
+               }\r
+       }\r
+       *MATERIAL       1       {\r
+               *MATERIAL_NAME  "noshader"\r
+               *MATERIAL_CLASS "Standard"\r
+               *MATERIAL_DIFFUSE       1.000000        1.000000        1.000000\r
+               *MATERIAL_SHADING Phong\r
+               *MAP_DIFFUSE    {\r
+                       *MAP_NAME       "noshader"\r
+                       *MAP_CLASS      "Bitmap"\r
+                       *MAP_SUBNO      1\r
+                       *MAP_AMOUNT     1.0\r
+                       *MAP_TYPE       Screen\r
+                       *BITMAP "..\noshader.tga"\r
+                       *BITMAP_FILTER  Pyramidal\r
+               }\r
+       }\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf0"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf0"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       128.000000      0.000000        0.000000\r
+                       *MESH_VERTEX    1       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    2       128.000000      128.000000      0.000000\r
+                       *MESH_VERTEX    3       64.000000       128.000000      64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.707107        0.000000        0.707107\r
+                       *MESH_FACENORMAL        1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      0       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      2       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      3       0.707107        0.000000        0.707107\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       1.000000        -1.000000       1.000000\r
+                       *MESH_TVERT     1       -1.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       1.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       -1.000000       3.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf1"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf1"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        128.000000      64.000000\r
+                       *MESH_VERTEX    1       0.000000        128.000000      0.000000\r
+                       *MESH_VERTEX    2       64.000000       128.000000      64.000000\r
+                       *MESH_VERTEX    3       128.000000      128.000000      0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.707107        0.000000        0.707107\r
+                       *MESH_FACENORMAL        1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      0       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        1.000000        0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       2.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       0.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       2.000000        0.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf2"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf2"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        64.000000\r
+                       *MESH_VERTEX    2       64.000000       128.000000      64.000000\r
+                       *MESH_VERTEX    3       0.000000        128.000000      64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.707107        0.000000        0.707107\r
+                       *MESH_FACENORMAL        1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      0       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        0.000000        1.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       1.000000        -1.000000       1.000000\r
+                       *MESH_TVERT     1       -1.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       1.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       -1.000000       3.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf3"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf3"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        0.000000        64.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       0.000000        128.000000      64.000000\r
+                       *MESH_VERTEX    3       0.000000        128.000000      0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.707107        0.000000        0.707107\r
+                       *MESH_FACENORMAL        1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      0       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      1       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      2       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      3       -1.000000       0.000000        0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       2.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       2.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       2.000000        0.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf4"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf4"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       128.000000      0.000000        0.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    3       0.000000        0.000000        64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.707107        0.000000        0.707107\r
+                       *MESH_FACENORMAL        1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      0       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        -1.000000       0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       2.000000        0.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       0.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       -2.000000       2.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf5"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf5"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        128.000000      0.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       128.000000      128.000000      0.000000\r
+                       *MESH_VERTEX    3       128.000000      0.000000        0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.707107        0.000000        0.707107\r
+                       *MESH_FACENORMAL        1       0.707107        0.000000        0.707107\r
+                       *MESH_VERTEXNORMAL      0       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        0.000000        -1.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       3.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       2.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       2.000000        -1.000000       1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
diff --git a/regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_shallow.ase b/regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_shallow.ase
new file mode 100644 (file)
index 0000000..4e23fd4
--- /dev/null
@@ -0,0 +1,368 @@
+*3DSMAX_ASCIIEXPORT    200\r
+*COMMENT       "Generated by Q3Map2 (ydnar) -convert -format ase"\r
+*SCENE {\r
+       *SCENE_FILENAME "wedge_shallow.bsp"\r
+       *SCENE_FIRSTFRAME       0\r
+       *SCENE_LASTFRAME        100\r
+       *SCENE_FRAMESPEED       30\r
+       *SCENE_TICKSPERFRAME    160\r
+       *SCENE_BACKGROUND_STATIC        0.0000  0.0000  0.0000\r
+       *SCENE_AMBIENT_STATIC   0.0000  0.0000  0.0000\r
+}\r
+*MATERIAL_LIST {\r
+       *MATERIAL_COUNT 2\r
+       *MATERIAL       0       {\r
+               *MATERIAL_NAME  "textures/radiant_regression_tests/tile_model"\r
+               *MATERIAL_CLASS "Standard"\r
+               *MATERIAL_DIFFUSE       1.000000        1.000000        0.833333\r
+               *MATERIAL_SHADING Phong\r
+               *MAP_DIFFUSE    {\r
+                       *MAP_NAME       "textures/radiant_regression_tests/tile_model"\r
+                       *MAP_CLASS      "Bitmap"\r
+                       *MAP_SUBNO      1\r
+                       *MAP_AMOUNT     1.0\r
+                       *MAP_TYPE       Screen\r
+                       *BITMAP "..\textures\radiant_regression_tests\tile_model.tga"\r
+                       *BITMAP_FILTER  Pyramidal\r
+               }\r
+       }\r
+       *MATERIAL       1       {\r
+               *MATERIAL_NAME  "noshader"\r
+               *MATERIAL_CLASS "Standard"\r
+               *MATERIAL_DIFFUSE       1.000000        1.000000        1.000000\r
+               *MATERIAL_SHADING Phong\r
+               *MAP_DIFFUSE    {\r
+                       *MAP_NAME       "noshader"\r
+                       *MAP_CLASS      "Bitmap"\r
+                       *MAP_SUBNO      1\r
+                       *MAP_AMOUNT     1.0\r
+                       *MAP_TYPE       Screen\r
+                       *BITMAP "..\noshader.tga"\r
+                       *BITMAP_FILTER  Pyramidal\r
+               }\r
+       }\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf0"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf0"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       160.000000      0.000000        0.000000\r
+                       *MESH_VERTEX    1       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    2       160.000000      128.000000      0.000000\r
+                       *MESH_VERTEX    3       64.000000       128.000000      64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.554700        0.000000        0.832050\r
+                       *MESH_FACENORMAL        1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      0       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      2       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      3       0.554700        0.000000        0.832050\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       2.000000        -1.000000       1.000000\r
+                       *MESH_TVERT     1       -1.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       2.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       -1.000000       3.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf1"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf1"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        128.000000      64.000000\r
+                       *MESH_VERTEX    1       0.000000        128.000000      0.000000\r
+                       *MESH_VERTEX    2       64.000000       128.000000      64.000000\r
+                       *MESH_VERTEX    3       160.000000      128.000000      0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.554700        0.000000        0.832050\r
+                       *MESH_FACENORMAL        1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      0       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        1.000000        0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       2.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       0.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       3.000000        0.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf2"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf2"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        64.000000\r
+                       *MESH_VERTEX    2       64.000000       128.000000      64.000000\r
+                       *MESH_VERTEX    3       0.000000        128.000000      64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.554700        0.000000        0.832050\r
+                       *MESH_FACENORMAL        1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      0       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        0.000000        1.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       1.000000        -1.000000       1.000000\r
+                       *MESH_TVERT     1       -1.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       1.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       -1.000000       3.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf3"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf3"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        0.000000        64.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       0.000000        128.000000      64.000000\r
+                       *MESH_VERTEX    3       0.000000        128.000000      0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.554700        0.000000        0.832050\r
+                       *MESH_FACENORMAL        1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      0       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      1       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      2       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      3       -1.000000       0.000000        0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       2.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       2.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       2.000000        0.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf4"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf4"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       160.000000      0.000000        0.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    3       0.000000        0.000000        64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.554700        0.000000        0.832050\r
+                       *MESH_FACENORMAL        1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      0       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        -1.000000       0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       3.000000        0.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       0.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       -2.000000       2.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf5"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf5"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        128.000000      0.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       160.000000      128.000000      0.000000\r
+                       *MESH_VERTEX    3       160.000000      0.000000        0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.554700        0.000000        0.832050\r
+                       *MESH_FACENORMAL        1       0.554700        0.000000        0.832050\r
+                       *MESH_VERTEXNORMAL      0       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        0.000000        -1.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       3.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       3.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       3.000000        -1.000000       1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
diff --git a/regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_steep.ase b/regression_tests/q3map2/model_clipping_45_degrees/models/mapobjects/wedges/wedge_steep.ase
new file mode 100644 (file)
index 0000000..0e8727e
--- /dev/null
@@ -0,0 +1,368 @@
+*3DSMAX_ASCIIEXPORT    200\r
+*COMMENT       "Generated by Q3Map2 (ydnar) -convert -format ase"\r
+*SCENE {\r
+       *SCENE_FILENAME "wedge_steep.bsp"\r
+       *SCENE_FIRSTFRAME       0\r
+       *SCENE_LASTFRAME        100\r
+       *SCENE_FRAMESPEED       30\r
+       *SCENE_TICKSPERFRAME    160\r
+       *SCENE_BACKGROUND_STATIC        0.0000  0.0000  0.0000\r
+       *SCENE_AMBIENT_STATIC   0.0000  0.0000  0.0000\r
+}\r
+*MATERIAL_LIST {\r
+       *MATERIAL_COUNT 2\r
+       *MATERIAL       0       {\r
+               *MATERIAL_NAME  "textures/radiant_regression_tests/tile_model"\r
+               *MATERIAL_CLASS "Standard"\r
+               *MATERIAL_DIFFUSE       1.000000        1.000000        0.833333\r
+               *MATERIAL_SHADING Phong\r
+               *MAP_DIFFUSE    {\r
+                       *MAP_NAME       "textures/radiant_regression_tests/tile_model"\r
+                       *MAP_CLASS      "Bitmap"\r
+                       *MAP_SUBNO      1\r
+                       *MAP_AMOUNT     1.0\r
+                       *MAP_TYPE       Screen\r
+                       *BITMAP "..\textures\radiant_regression_tests\tile_model.tga"\r
+                       *BITMAP_FILTER  Pyramidal\r
+               }\r
+       }\r
+       *MATERIAL       1       {\r
+               *MATERIAL_NAME  "noshader"\r
+               *MATERIAL_CLASS "Standard"\r
+               *MATERIAL_DIFFUSE       1.000000        1.000000        1.000000\r
+               *MATERIAL_SHADING Phong\r
+               *MAP_DIFFUSE    {\r
+                       *MAP_NAME       "noshader"\r
+                       *MAP_CLASS      "Bitmap"\r
+                       *MAP_SUBNO      1\r
+                       *MAP_AMOUNT     1.0\r
+                       *MAP_TYPE       Screen\r
+                       *BITMAP "..\noshader.tga"\r
+                       *BITMAP_FILTER  Pyramidal\r
+               }\r
+       }\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf0"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf0"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       112.000000      0.000000        0.000000\r
+                       *MESH_VERTEX    1       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    2       112.000000      128.000000      0.000000\r
+                       *MESH_VERTEX    3       64.000000       128.000000      64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.800000        0.000000        0.600000\r
+                       *MESH_FACENORMAL        1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      0       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      2       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      3       0.800000        0.000000        0.600000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       2.000000        1.000000\r
+                       *MESH_TVERT     2       2.000000        0.000000        1.000000\r
+                       *MESH_TVERT     3       2.000000        2.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf1"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf1"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        128.000000      64.000000\r
+                       *MESH_VERTEX    1       0.000000        128.000000      0.000000\r
+                       *MESH_VERTEX    2       64.000000       128.000000      64.000000\r
+                       *MESH_VERTEX    3       112.000000      128.000000      0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.800000        0.000000        0.600000\r
+                       *MESH_FACENORMAL        1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      0       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        1.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        1.000000        0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -1.000000       2.000000        1.000000\r
+                       *MESH_TVERT     1       -1.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       1.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       2.500000        0.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf2"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf2"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        64.000000\r
+                       *MESH_VERTEX    2       64.000000       128.000000      64.000000\r
+                       *MESH_VERTEX    3       0.000000        128.000000      64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.800000        0.000000        0.600000\r
+                       *MESH_FACENORMAL        1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      0       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        0.000000        1.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        0.000000        1.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       1.000000        -1.000000       1.000000\r
+                       *MESH_TVERT     1       -1.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       1.000000        3.000000        1.000000\r
+                       *MESH_TVERT     3       -1.000000       3.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf3"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf3"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        0.000000        64.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       0.000000        128.000000      64.000000\r
+                       *MESH_VERTEX    3       0.000000        128.000000      0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.800000        0.000000        0.600000\r
+                       *MESH_FACENORMAL        1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      0       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      1       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      2       -1.000000       0.000000        0.000000\r
+                       *MESH_VERTEXNORMAL      3       -1.000000       0.000000        0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -2.000000       2.000000        1.000000\r
+                       *MESH_TVERT     1       -2.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       2.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       2.000000        0.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf4"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf4"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       112.000000      0.000000        0.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       64.000000       0.000000        64.000000\r
+                       *MESH_VERTEX    3       0.000000        0.000000        64.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.800000        0.000000        0.600000\r
+                       *MESH_FACENORMAL        1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      0       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        -1.000000       0.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        -1.000000       0.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       2.500000        0.000000        1.000000\r
+                       *MESH_TVERT     1       -1.000000       0.000000        1.000000\r
+                       *MESH_TVERT     2       1.000000        2.000000        1.000000\r
+                       *MESH_TVERT     3       -1.000000       2.000000        1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
+*GEOMOBJECT    {\r
+       *NODE_NAME      "mat0model0surf5"\r
+       *NODE_TM        {\r
+               *NODE_NAME      "mat0model0surf5"\r
+               *INHERIT_POS    0       0       0\r
+               *INHERIT_ROT    0       0       0\r
+               *INHERIT_SCL    0       0       0\r
+               *TM_ROW0        1.0     0       0\r
+               *TM_ROW1        0       1.0     0\r
+               *TM_ROW2        0       0       1.0\r
+               *TM_ROW3        0       0       0\r
+               *TM_POS 0.000000        0.000000        0.000000\r
+       }\r
+       *MESH   {\r
+               *TIMEVALUE      0\r
+               *MESH_NUMVERTEX 4\r
+               *MESH_NUMFACES  2\r
+               *COMMENT        "SURFACETYPE    MST_PLANAR"\r
+               *MESH_VERTEX_LIST       {\r
+                       *MESH_VERTEX    0       0.000000        128.000000      0.000000\r
+                       *MESH_VERTEX    1       0.000000        0.000000        0.000000\r
+                       *MESH_VERTEX    2       112.000000      128.000000      0.000000\r
+                       *MESH_VERTEX    3       112.000000      0.000000        0.000000\r
+               }\r
+               *MESH_NORMALS   {\r
+                       *MESH_FACENORMAL        0       0.800000        0.000000        0.600000\r
+                       *MESH_FACENORMAL        1       0.800000        0.000000        0.600000\r
+                       *MESH_VERTEXNORMAL      0       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      1       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      2       0.000000        0.000000        -1.000000\r
+                       *MESH_VERTEXNORMAL      3       0.000000        0.000000        -1.000000\r
+               }\r
+               *MESH_FACE_LIST {\r
+                       *MESH_FACE      0       A:      0       B:      2       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+                       *MESH_FACE      1       A:      2       B:      3       C:      1       AB:     1       BC:     1       CA:     1       *MESH_SMOOTHING 0       *MESH_MTLID     0\r
+               }\r
+               *MESH_NUMTVERTEX        4\r
+               *MESH_TVERTLIST {\r
+                       *MESH_TVERT     0       -1.000000       3.000000        1.000000\r
+                       *MESH_TVERT     1       -1.000000       -1.000000       1.000000\r
+                       *MESH_TVERT     2       2.500000        3.000000        1.000000\r
+                       *MESH_TVERT     3       2.500000        -1.000000       1.000000\r
+               }\r
+               *MESH_NUMTVFACES        2\r
+               *MESH_TFACELIST {\r
+                       *MESH_TFACE     0       0       2       1\r
+                       *MESH_TFACE     1       2       3       1\r
+               }\r
+       }\r
+       *PROP_MOTIONBLUR        0\r
+       *PROP_CASTSHADOW        1\r
+       *PROP_RECVSHADOW        1\r
+       *MATERIAL_REF   0\r
+}\r
diff --git a/regression_tests/q3map2/model_clipping_45_degrees/scripts/radiant_regression_tests.shader b/regression_tests/q3map2/model_clipping_45_degrees/scripts/radiant_regression_tests.shader
new file mode 100644 (file)
index 0000000..a2c31ed
--- /dev/null
@@ -0,0 +1,12 @@
+textures/radiant_regression_tests/tile_model
+{
+    q3map_clipModel
+    q3map_forceMeta
+    {
+        map $lightmap
+    }
+    {
+        map textures/radiant_regression_tests/tile_model.tga
+        blendFunc filter
+    }
+}
diff --git a/regression_tests/q3map2/piercing_triangle/README.txt b/regression_tests/q3map2/piercing_triangle/README.txt
new file mode 100644 (file)
index 0000000..b09e2c3
--- /dev/null
@@ -0,0 +1,14 @@
+DESCRIPTION OF PROBLEM:
+=======================
+
+In the disappearing_triangle regression test I outlined a potential problem
+in the tjunction.c code, having to do with 2 points being too close together
+on a winding, and that winding becoming invalid (drawsurf disappearing).
+
+This example map is the same as disappearing_triangle.map, except that the
+floor is raised by 1 unit.  Therefore the floor intersects the sliver triangle.
+The resulting chopped sliver has a very short edge that is "degenerate" and
+causes that draw surf to go away due to problems in the tjunction.c code.
+
+This is speculation at this point.  I will provide more info after the bug has
+been fixed.
diff --git a/regression_tests/q3map2/piercing_triangle/maps/piercing_triangle.map b/regression_tests/q3map2/piercing_triangle/maps/piercing_triangle.map
new file mode 100644 (file)
index 0000000..8dc3552
--- /dev/null
@@ -0,0 +1,73 @@
+{
+"classname" "worldspawn"
+{
+( 134 -1015 0 ) ( 134 -4096 0 ) ( 67 -1022 0 ) common/caulk 0 0 0 0.500000 0.500000 134217728 4 0
+( 88 -892 -768 ) ( 88 -4096 -768 ) ( 134 -1015 0 ) common/caulk 0 0 0 0.500000 0.500000 134217728 4 0
+( 67 -1022 0 ) ( 88 -892 -768 ) ( 134 -1015 0 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 134217728 0 0
+( 67 -1022 0 ) ( 67 -4096 0 ) ( 88 -892 -768 ) common/caulk 0 0 0 0.500000 0.500000 134217728 4 0
+( -704 -1152 0 ) ( 4480 -1152 0 ) ( -704 -1152 -768 ) common/caulk 0 0 0 0.500000 0.500000 134217728 4 0
+}
+{
+( 512 -640 0 ) ( 512 -1160 0 ) ( 512 -1160 -768 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 0 0 0
+( 584 -640 0 ) ( 520 -640 0 ) ( 520 -640 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 520 -1160 0 ) ( 520 -640 0 ) ( 520 -640 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 528 -1152 0 ) ( 592 -1152 0 ) ( 592 -1152 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 528 -1160 320 ) ( 528 -640 320 ) ( 592 -640 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 583 -640 -768 ) ( 519 -640 -768 ) ( 519 -1160 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -512 -536 320 ) ( -512 -624 320 ) ( -512 -624 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 528 -632 320 ) ( -280 -632 320 ) ( -280 -632 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 512 -640 320 ) ( 512 -552 320 ) ( 512 -552 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -296 -640 320 ) ( 512 -640 320 ) ( 512 -640 -768 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 0 0 0
+( -296 -640 320 ) ( -296 -552 320 ) ( 512 -552 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 511 -552 -768 ) ( -297 -552 -768 ) ( -297 -640 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -520 -648 320 ) ( -520 -1152 320 ) ( -520 -1152 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -512 -640 320 ) ( -536 -640 320 ) ( -536 -640 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -512 -1152 320 ) ( -512 -648 320 ) ( -512 -648 -768 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 0 0 0
+( -536 -1152 320 ) ( -512 -1152 320 ) ( -512 -1152 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -536 -1152 320 ) ( -536 -648 320 ) ( -512 -648 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -512 -648 -768 ) ( -536 -648 -768 ) ( -536 -1152 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -512 -640 464 ) ( -512 -1152 464 ) ( -512 -1152 352 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 512 -640 440 ) ( 24 -640 440 ) ( 24 -640 328 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 512 -1152 440 ) ( 512 -640 440 ) ( 512 -640 328 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 24 -1152 440 ) ( 512 -1152 440 ) ( 512 -1152 328 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 48 -1152 328 ) ( 48 -640 328 ) ( 536 -640 328 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 512 -640 320 ) ( 24 -640 320 ) ( 24 -1152 320 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 0 0 0
+}
+{
+( -368 -640 -824 ) ( -856 -640 -824 ) ( -856 -640 -960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 512 -1152 -768 ) ( 512 -896 -768 ) ( 512 -896 -776 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -512 -896 -768 ) ( -512 -1152 -768 ) ( -512 -1152 -776 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -512 -1152 -768 ) ( -328 -1152 -768 ) ( -328 -1152 -776 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( -511 -1152 -767 ) ( -511 -896 -767 ) ( -327 -896 -767 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 0 0 0
+( -328 -896 -776 ) ( -512 -896 -776 ) ( -512 -1152 -776 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+{
+( -256 -1152 -768 ) ( -520 -1152 -768 ) ( -520 -1192 -768 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 176 -1568 320 ) ( 176 -1152 320 ) ( 1152 -1152 320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 208 -1160 320 ) ( 1184 -1160 320 ) ( 1184 -1160 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 512 -1576 320 ) ( 512 -1160 320 ) ( 512 -1160 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+( 1152 -1152 320 ) ( 176 -1152 320 ) ( 176 -1152 0 ) radiant_regression_tests/tile 0 0 0 0.500000 0.500000 0 0 0
+( -512 -1168 320 ) ( -512 -1584 320 ) ( -512 -1584 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
+}
+}
+{
+"classname" "light"
+"origin" "0 -768 -480"
+"light" "3000"
+}
+{
+"classname" "info_player_deathmatch"
+"origin" "0 -712 -640"
+"angle" "270"
+}
+{
+"light" "3000"
+"origin" "0 -832 160"
+"classname" "light"
+}
index 1275408..fd31f59 100644 (file)
@@ -321,6 +321,50 @@ void SnapWeldVectorAccu(vec3_accu_t a, vec3_accu_t b, vec3_accu_t out)
        }
 }
 
+/*
+==================
+SnapWeldVectorAccu
+
+Welds two vectors into a third, taking into account nearest-to-integer
+instead of averaging.
+==================
+*/
+void SnapWeldVectorAccu(vec3_accu_t a, vec3_accu_t b, vec3_accu_t out)
+{
+       // I'm just preserving what I think was the intended logic of the original
+       // SnapWeldVector().  I'm not actually sure where this function should even
+       // be used.  I'd like to know which kinds of problems this function addresses.
+
+       // TODO: I thought we're snapping all coordinates to nearest 1/8 unit?
+       // So what is natural about snapping to the nearest integer?  Maybe we should
+       // be snapping to the nearest 1/8 unit instead?
+
+       int             i;
+       vec_accu_t      ai, bi, ad, bd;
+       
+       if (a == NULL || b == NULL || out == NULL)
+               Error("SnapWeldVectorAccu: NULL argument");
+       
+       for (i = 0; i < 3; i++)
+       {
+               ai = Q_rintAccu(a[i]);
+               bi = Q_rintAccu(b[i]);
+               ad = fabs(ai - a[i]);
+               bd = fabs(bi - b[i]);
+       
+               if (ad < bd)
+               {
+                       if (ad < SNAP_EPSILON)  out[i] = ai;
+                       else                    out[i] = a[i];
+               }
+               else
+               {
+                       if (bd < SNAP_EPSILON)  out[i] = bi;
+                       else                    out[i] = b[i];
+               }
+       }
+}
+
 
 
 /*
@@ -458,7 +502,7 @@ returns false if the brush doesn't enclose a valid volume
 qboolean CreateBrushWindings( brush_t *brush )
 {
        int                     i, j;
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
        winding_accu_t  *w;
 #else
        winding_t       *w;
@@ -475,7 +519,7 @@ qboolean CreateBrushWindings( brush_t *brush )
                plane = &mapplanes[ side->planenum ];
                
                /* make huge winding */
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
                w = BaseWindingForPlaneAccu(plane->normal, plane->dist);
 #else
                w = BaseWindingForPlane( plane->normal, plane->dist );
@@ -491,14 +535,14 @@ qboolean CreateBrushWindings( brush_t *brush )
                        if( brush->sides[ j ].bevel )
                                continue;
                        plane = &mapplanes[ brush->sides[ j ].planenum ^ 1 ];
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
                        ChopWindingInPlaceAccu(&w, plane->normal, plane->dist, 0);
 #else
                        ChopWindingInPlace( &w, plane->normal, plane->dist, 0 ); // CLIP_EPSILON );
 #endif
                        
                        /* ydnar: fix broken windings that would generate trifans */
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
                        // I think it's better to FixWindingAccu() once after we chop with all planes
                        // so that error isn't multiplied.  There is nothing natural about welding
                        // the points unless they are the final endpoints.  ChopWindingInPlaceAccu()
@@ -509,7 +553,7 @@ qboolean CreateBrushWindings( brush_t *brush )
                }
                
                /* set side winding */
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
                if (w != NULL)
                {
                        FixWindingAccu(w);
index fcb6ac7..95bb3d1 100644 (file)
@@ -159,7 +159,7 @@ Returns qtrue if and only if the normal was adjusted.
 
 qboolean SnapNormal( vec3_t normal )
 {
-#if EXPERIMENTAL_SNAP_NORMAL_FIX
+#if Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX
        int             i;
        qboolean        adjusted = qfalse;
 
@@ -340,7 +340,7 @@ int FindFloatPlane( vec3_t innormal, vec_t dist, int numPoints, vec3_t *points )
        vec3_t normal;
 
        VectorCopy(innormal, normal);
-#if EXPERIMENTAL_SNAP_PLANE_FIX
+#if Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX
        SnapPlaneImproved(normal, &dist, numPoints, (const vec3_t *) points);
 #else
        SnapPlane( normal, &dist );
@@ -395,7 +395,7 @@ int FindFloatPlane( vec3_t innormal, vec_t dist, int numPoints, vec3_t *points )
        vec3_t normal;
        
        VectorCopy(innormal, normal);
-#if EXPERIMENTAL_SNAP_PLANE_FIX
+#if Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX
        SnapPlaneImproved(normal, &dist, numPoints, (const vec3_t *) points);
 #else
        SnapPlane( normal, &dist );
@@ -438,7 +438,7 @@ takes 3 points and finds the plane they lie in
 
 int MapPlaneFromPoints( vec3_t *p )
 {
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
        vec3_accu_t     paccu[3];
        vec3_accu_t     t1, t2, normalAccu;
        vec3_t          normal;
index bf30def..c398b9b 100644 (file)
@@ -124,9 +124,9 @@ constants
 
 /* temporary hacks and tests (please keep off in SVN to prevent anyone's legacy map from screwing up) */
 /* 2011-01-10 TTimo says we should turn these on in SVN, so turning on now */
-#define EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES  1
-#define EXPERIMENTAL_SNAP_NORMAL_FIX                   1
-#define EXPERIMENTAL_SNAP_PLANE_FIX                    1
+#define Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES  1
+#define Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX            1
+#define Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX             1
 
 /* general */
 #define MAX_QPATH                              64
@@ -2033,7 +2033,7 @@ Q_EXTERN qboolean           lightmapTriangleCheck Q_ASSIGN(qfalse);
 Q_EXTERN qboolean           lightmapExtraVisClusterNudge Q_ASSIGN(qfalse);
 Q_EXTERN qboolean           lightmapFill Q_ASSIGN(qfalse);
 
-#if EXPERIMENTAL_SNAP_NORMAL_FIX
+#if Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX
 // Increasing the normalEpsilon to compensate for new logic in SnapNormal(), where
 // this epsilon is now used to compare against 0 components instead of the 1 or -1
 // components.  Unfortunately, normalEpsilon is also used in PlaneEqual().  So changing
@@ -2044,7 +2044,7 @@ Q_EXTERN double                           normalEpsilon Q_ASSIGN(0.00005);
 Q_EXTERN double                                normalEpsilon Q_ASSIGN( 0.00001 );
 #endif
 
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
 // NOTE: This distanceEpsilon is too small if parts of the map are at maximum world
 // extents (in the range of plus or minus 2^16).  The smallest epsilon at values
 // close to 2^16 is about 0.007, which is greater than distanceEpsilon.  Therefore,