]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
also fix the unhashed case
authorRudolf Polzer <divVerent@xonotic.org>
Fri, 19 Nov 2010 05:43:29 +0000 (06:43 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Fri, 19 Nov 2010 05:43:29 +0000 (06:43 +0100)
tools/quake3/q3map2/map.c

index 9c15895c3df6ebd11cd6815fb14b1f7182939d9a..d61f51be26e60237469ee828c37579ba0dc28bad 100644 (file)
@@ -284,7 +284,22 @@ int FindFloatPlane( vec3_t innormal, vec_t dist, int numPoints, vec3_t *points )
        SnapPlane( normal, &dist, centerofweight );
        for( i = 0, p = mapplanes; i < nummapplanes; i++, p++ )
        {
-               if( PlaneEqual( p, normal, dist ) )
+               if( !PlaneEqual( p, normal, dist ) )
+                       continue;
+
+               /* ydnar: uncomment the following line for old-style plane finding */
+               //%     return i;
+                       
+               /* ydnar: test supplied points against this plane */
+               for( j = 0; j < numPoints; j++ )
+               {
+                       d = DotProduct( points[ j ], p->normal ) - p->dist;
+                       if( fabs( d ) > distanceEpsilon )
+                               break;
+               }
+               
+               /* found a matching plane */
+               if( j >= numPoints )
                        return i;
        }