Browse Source

Fixed a floating point rounding error preventing faces from being found for some world-space points. Fixes lighting bugs in a few areas.

master
Nico de Poel 3 years ago
parent
commit
b43dff99a2
  1. 1
      bsp.h

1
bsp.h

@ -371,6 +371,7 @@ typedef struct World
} }
double dot = p0.dotProduct(p1) / (m0 * m1); double dot = p0.dotProduct(p1) / (m0 * m1);
if (dot < -1) dot = -1; if (dot > 1) dot = 1; // Floating point rounding errors, YAY!
angleSum += acos(dot); angleSum += acos(dot);
} }

Loading…
Cancel
Save