]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/facebsp.c
audit all uses of ClipWindingEpsilon and choose the strict variant or not, and explai...
[xonotic/netradiant.git] / tools / quake3 / q3map2 / facebsp.c
index 9291f5649fc8dc63decd9e77f6e7293b2d60f815..2e4ffffea7e6b875ef8ea580cd0f70410732fdeb 100644 (file)
@@ -244,7 +244,9 @@ void BuildFaceTree_r( node_t *node, face_t *list )
        winding_t       *frontWinding, *backWinding;
        int                     i;
        int                     splitPlaneNum, compileFlags;
+#if 0
        qboolean isstruct = qfalse;
+#endif
        
        
        /* count faces left */
@@ -282,8 +284,10 @@ void BuildFaceTree_r( node_t *node, face_t *list )
                        continue;
                }
 
+#if 0
                if(!(split->compileFlags & C_DETAIL))
                        isstruct = 1;
+#endif
                
                /* determine which side the face falls on */
                side = WindingOnPlaneSide( split->w, plane->normal, plane->dist );
@@ -291,8 +295,8 @@ void BuildFaceTree_r( node_t *node, face_t *list )
                /* switch on side */
                if( side == SIDE_CROSS )
                {
-                       ClipWindingEpsilon( split->w, plane->normal, plane->dist, CLIP_EPSILON * 2,
-                               &frontWinding, &backWinding );
+                       ClipWindingEpsilonStrict( split->w, plane->normal, plane->dist, CLIP_EPSILON * 2,
+                               &frontWinding, &backWinding ); /* strict; if no winding is left, we have a "virtually identical" plane and don't want to split by it */
                        if( frontWinding ) {
                                newFace = AllocBspFace();
                                newFace->w = frontWinding;
@@ -336,6 +340,11 @@ void BuildFaceTree_r( node_t *node, face_t *list )
                        node->children[1]->maxs[i] = plane->dist;
                        break;
                }
+               if ( plane->normal[i] == -1 ) {
+                       node->children[0]->maxs[i] = -plane->dist;
+                       node->children[1]->mins[i] = -plane->dist;
+                       break;
+               }
        }
 
 #if 0