From 96a8dc8c3d63cf376c920c2ee2437ae2cb2ffeeb Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 7 Apr 2016 21:16:54 -0600 Subject: [PATCH] light: disable "Failed to calculate normal for vertex" warning because it was not really an error and causing spam qbsp T-Juncs generate lots of colinear vertices I think? --- light/light.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/light/light.cc b/light/light.cc index d07fd9f8..ea3b48c7 100644 --- a/light/light.cc +++ b/light/light.cc @@ -510,11 +510,16 @@ CalcualateVertexNormals(const bsp2_t *bsp) const int vertIndex = pair.first; vec_t *vertNormal = pair.second.v; if (0 == VectorNormalize(vertNormal)) { + // this happens when there are colinear vertices, which give zero-area triangles, + // so there is no contribution to the normal of the triangle in the middle of the + // line. Not really an error, just set it to use the face normal. +#if 0 logprint("Failed to calculate normal for vertex %d at (%f %f %f)\n", vertIndex, bsp->dvertexes[vertIndex].point[0], bsp->dvertexes[vertIndex].point[1], bsp->dvertexes[vertIndex].point[2]); +#endif VectorCopy(f_norm, vertNormal); } }