summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-09-26 11:32:57 -0700
committerGraham Linden <graham@lindenlab.com>2013-09-26 11:32:57 -0700
commite285d515d5b94acce280edf586a16272931749d9 (patch)
treee1b271cae6523b8d3c1ead38423be947cdd994aa
parent4709ca96975e24e49eba00760dd840a5b026fcb9 (diff)
NORSPEC-281 bring back a classic normal generation fix from runitai's personal collection
-rwxr-xr-xindra/llmath/llvolume.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 2b865b4a8e..f74c934b21 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -166,7 +166,8 @@ void calc_tangent_from_triangle(
F32 rd = s1*t2-s2*t1;
- float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero
+ float r = ((rd*rd) > FLT_EPSILON) ? (1.0f / rd)
+ : ((rd > 0.0f) ? 1024.f : -1024.f); //some made up large ratio for division by zero
llassert(llfinite(r));
llassert(!llisnan(r));
@@ -6789,7 +6790,8 @@ void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVe
F32 rd = s1*t2-s2*t1;
- float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero
+ float r = ((rd*rd) > FLT_EPSILON) ? (1.0f / rd)
+ : ((rd > 0.0f) ? 1024.f : -1024.f); //some made up large ratio for division by zero
llassert(llfinite(r));
llassert(!llisnan(r));