Getting ready to commit Rambetter-math-fix-experiments branch changes to

trunk, as pertaining to q3map2.  Some last-minute changes:

- EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES, EXPERIMENTAL_SNAP_NORMAL_FIX,
and EXPERIMENTAL_SNAP_PLANE_FIX all set to 0 to make sure stuff in trunk 
uses old "broken but stable" code, at least initially until there is further
testing done and/or some decision is made about which code to use.

- Fixing small typo in comment in PlaneEqual() in map.c.

- In comment to BaseWindingForPlane() function, describing why the old
function is broken as far as accuracy goes.  This used to be a TODO.

- VectorIsOnAxialPlane() function comment fixed	in mathlib.c.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/Rambetter-math-fix-experiments@415 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
rambetter 2011-01-10 05:38:30 +00:00
parent d10c0e21e3
commit 0306f2c5b9
4 changed files with 13 additions and 6 deletions

View File

@ -55,7 +55,7 @@ qboolean VectorIsOnAxis(vec3_t v)
/*
================
VectorIsOnAxis
VectorIsOnAxialPlane
================
*/
qboolean VectorIsOnAxialPlane(vec3_t v)

View File

@ -371,7 +371,14 @@ winding_accu_t *BaseWindingForPlaneAccu(vec3_t normal, vec_t dist)
BaseWindingForPlane
Original BaseWindingForPlane() function that has serious accuracy problems. Here is why.
TODO: Explain why.
The base winding is computed as a rectangle with very large coordinates. These coordinates
are in the range 2^17 or 2^18. "Epsilon" (meaning the distance between two adjacent numbers)
at these magnitudes in 32 bit floating point world is about 0.02. So for example, if things
go badly (by bad luck), then the whole plane could be shifted by 0.02 units (its distance could
be off by that much). Then if we were to compute the winding of this plane and another of
the brush's planes met this winding at a very acute angle, that error could multiply to around
0.1 or more when computing the final vertex coordinates of the winding. 0.1 is a very large
error, and can lead to all sorts of disappearing triangle problems.
=================
*/
winding_t *BaseWindingForPlane(vec3_t normal, vec_t dist)

View File

@ -69,7 +69,7 @@ qboolean PlaneEqual( plane_t *p, vec3_t normal, vec_t dist )
de = distanceEpsilon;
/* compare */
// We check equality of each component since the we're using '<', not '<='
// We check equality of each component since we're using '<', not '<='
// (the epsilons may be zero). We want to use '<' intead of '<=' to be
// consistent with the true meaning of "epsilon", and also because other
// parts of the code uses this inequality.

View File

@ -123,9 +123,9 @@ constants
------------------------------------------------------------------------------- */
/* temporary hacks and tests (please keep off in SVN to prevent anyone's legacy map from screwing up) */
#define EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES 1
#define EXPERIMENTAL_SNAP_NORMAL_FIX 1
#define EXPERIMENTAL_SNAP_PLANE_FIX 1
#define EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES 0
#define EXPERIMENTAL_SNAP_NORMAL_FIX 0
#define EXPERIMENTAL_SNAP_PLANE_FIX 0
/* general */
#define MAX_QPATH 64