diff --git a/qbsp/qbsp.c b/qbsp/qbsp.c
index 65b336c5..09c567a1 100644
--- a/qbsp/qbsp.c
+++ b/qbsp/qbsp.c
@@ -383,6 +383,7 @@ PrintOptions(void)
" -wadpath
Search this directory for wad files\n"
" -oldrottex Use old rotate_ brush texturing aligned at (0 0 0)\n"
" -maxnodesize [n]Triggers simpler BSP Splitting when node exceeds size (default 1024, 0 to disable)\n"
+ " -epsilon [n] Customize ON_EPSILON (default 0.0001)\n"
" sourcefile .MAP file to process\n"
" destfile .BSP file to output\n");
@@ -455,6 +456,7 @@ ParseOptions(char *szOptions)
options.fixRotateObjTexture = true;
options.fOldaxis = true;
options.maxNodeSize = 1024;
+ options.on_epsilon = 0.0001;
szEnd = szOptions + strlen(szOptions);
szTok = GetTok(szOptions, szEnd);
@@ -537,6 +539,12 @@ ParseOptions(char *szOptions)
Error("Invalid argument to option %s", szTok);
options.maxNodeSize= atoi(szTok2);
szTok = szTok2;
+ } else if (!strcasecmp(szTok, "epsilon")) {
+ szTok2 = GetTok(szTok + strlen(szTok) + 1, szEnd);
+ if (!szTok2)
+ Error("Invalid argument to option %s", szTok);
+ options.on_epsilon= atof(szTok2);
+ szTok = szTok2;
} else if (!strcasecmp(szTok, "?") || !strcasecmp(szTok, "help"))
PrintOptions();
else
diff --git a/qbsp/qbsp.h b/qbsp/qbsp.h
index 4ed687ff..137f325c 100644
--- a/qbsp/qbsp.h
+++ b/qbsp/qbsp.h
@@ -118,7 +118,7 @@
#define ZERO_EPSILON 0.0001
#define DISTEPSILON 0.0001
#define POINT_EPSILON 0.0001
-#define ON_EPSILON 0.0001
+#define ON_EPSILON options.on_epsilon
#define EQUAL_EPSILON 0.0001
#define T_EPSILON 0.0002
#define CONTINUOUS_EPSILON 0.0005
@@ -455,6 +455,7 @@ typedef struct options_s {
char szMapName[512];
char szBSPName[512];
char wadPath[512];
+ vec_t on_epsilon;
} options_t;
extern options_t options;