]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
revert tolerances patch in RecursiveHullCheck, tolerances probably
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 2 Aug 2007 00:08:20 +0000 (00:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 2 Aug 2007 00:08:20 +0000 (00:08 +0000)
should be there but this wasn't working properly, so it is reverted

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7500 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index b5646ea0d8b4c3f369bd954b5fd5824491ac26ba..0a5ad8a786ba316e44e7a27ed4e9d5021f232f7e 100644 (file)
@@ -611,9 +611,23 @@ typedef struct RecursiveHullCheckTraceInfo_s
 }
 RecursiveHullCheckTraceInfo_t;
 
+typedef struct RecursiveHullCheckTraceInfo_s
+{
+       // the hull we're tracing through
+       const hull_t *hull;
+
+       // the trace structure to fill in
+       trace_t *trace;
+
+       // start, end, and end - start (in model space)
+       double start[3];
+       double end[3];
+       double dist[3];
+}
+RecursiveHullCheckTraceInfo_t;
+
 // 1/32 epsilon to keep floating point happy
 #define DIST_EPSILON (0.03125)
-#define DIST_EPSILON2 (0)
 
 #define HULLCHECKSTATE_EMPTY 0
 #define HULLCHECKSTATE_SOLID 1
@@ -696,21 +710,9 @@ loc0:
                t2 = DotProduct (plane->normal, p2) - plane->dist;
        }
 
-       // this has some tolerances so that it never intersects with a plane if
-       // one of the endpoints lies exactly on it
-       // the objective of this code is to allow points that are exactly on a
-       // plane to still give sane results (improving physics stability)
-       if (t2 < t1)
+       if (t1 < 0)
        {
-               if (t2 >= -DIST_EPSILON2)
-               {
-#if COLLISIONPARANOID >= 3
-                       Con_Print(">");
-#endif
-                       num = node->children[0];
-                       goto loc0;
-               }
-               if (t1 <= DIST_EPSILON2)
+               if (t2 < 0)
                {
 #if COLLISIONPARANOID >= 3
                        Con_Print("<");
@@ -718,11 +720,11 @@ loc0:
                        num = node->children[1];
                        goto loc0;
                }
-               side = 0;
+               side = 1;
        }
        else
        {
-               if (t1 >= -DIST_EPSILON2)
+               if (t2 >= 0)
                {
 #if COLLISIONPARANOID >= 3
                        Con_Print(">");
@@ -730,15 +732,7 @@ loc0:
                        num = node->children[0];
                        goto loc0;
                }
-               if (t2 <= DIST_EPSILON2)
-               {
-#if COLLISIONPARANOID >= 3
-                       Con_Print("<");
-#endif
-                       num = node->children[1];
-                       goto loc0;
-               }
-               side = 1;
+               side = 0;
        }
 
        // the line intersects, find intersection point