Work around a precision bug that would cause colinear wall vectors to only be "almost" colinear, causing the cross product to be wrongly validated and resulting in bogus normal vectors for some surfaces.

git-svn-id: https://svn.eduke32.com/eduke32@1234 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2009-03-08 21:07:40 +00:00
parent ad1091b2df
commit 7d7a705af9

View file

@ -2152,7 +2152,7 @@ static void polymer_buffertoplane(GLfloat* buffer, GLushort* indices, in
vec1[0] = plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]; vec1[0] = plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2];
i+= 3; i+= 3;
} }
while ((i < indicecount) && (vec1[0] == 0)); while ((i < indicecount) && (vec1[0] < 5000)); // hack to work around a precision issue with slopes
vec1[0] = sqrt(vec1[0]); vec1[0] = sqrt(vec1[0]);
plane[0] /= vec1[0]; plane[0] /= vec1[0];