From 7d7a705af9c144f3239a302670572f0eb817b136 Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 8 Mar 2009 21:07:40 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/src/polymer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index d12a41383..7fd46f879 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -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]; 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]); plane[0] /= vec1[0];