]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - collision.c
added snd_soundradius cvar (default 1000 as before) to allow games (Nexuiz for instan...
[xonotic/darkplaces.git] / collision.c
index ca95a54b1487eb45f916811bc0c095c3f13b4cf8..120809642e03ec90c96e75db75b27401c8107114 100644 (file)
@@ -4,7 +4,8 @@
 
 #define COLLISION_SNAPSCALE (32.0f)
 #define COLLISION_SNAP (1.0f / COLLISION_SNAPSCALE)
-#define COLLISION_PLANE_DIST_EPSILON (1.0f / 32.0f)
+#define COLLISION_SNAP2 (2.0f / COLLISION_SNAPSCALE)
+#define COLLISION_PLANE_DIST_EPSILON (2.0f / COLLISION_SNAPSCALE)
 
 cvar_t collision_impactnudge = {0, "collision_impactnudge", "0.03125", "how much to back off from the impact"};
 cvar_t collision_startnudge = {0, "collision_startnudge", "0", "how much to bias collision trace start"};
@@ -188,6 +189,8 @@ colbrushf_t *Collision_NewBrushFromPlanes(mempool_t *mempool, int numoriginalpla
                // clip it by all other planes
                for (k = 0;k < numoriginalplanes && pnumpoints && pnumpoints <= pmaxpoints;k++)
                {
+                       // skip the plane this polygon
+                       // (nothing happens if it is processed, this is just an optimization)
                        if (k != j)
                        {
                                // we want to keep the inside of the brush plane so we flip
@@ -237,7 +240,7 @@ colbrushf_t *Collision_NewBrushFromPlanes(mempool_t *mempool, int numoriginalpla
                {
                        // check if there is already a matching point (no duplicates)
                        for (m = 0;m < numpointsbuf;m++)
-                               if (VectorDistance2(&p[w][k*3], pointsbuf[m].v) < COLLISION_SNAP)
+                               if (VectorDistance2(&p[w][k*3], pointsbuf[m].v) < COLLISION_SNAP2)
                                        break;
 
                        // if there is no match, add a new one