summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-08-01 17:09:25 -0400
committerOz Linden <oz@lindenlab.com>2011-08-01 17:09:25 -0400
commit9eb555bbe60e0f388593c489d6c473e4adcbd956 (patch)
tree8d7ce38c1c2b539d2ee058a64eedb54b48f7949b /indra/newview/llvosky.cpp
parent5f71e29d8a2a56fe560412698c40b5816e9f47e6 (diff)
parent5711fda52f3939f482358ad5265618fb56da5998 (diff)
merge changes for storm-1535
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r--indra/newview/llvosky.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 66ba6249d3..ef21e7373e 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -755,6 +755,11 @@ void LLVOSky::calcSkyColorWLVert(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLCo
// project the direction ray onto the sky dome.
F32 phi = acos(Pn[1]);
F32 sinA = sin(F_PI - phi);
+ if (fabsf(sinA) < 0.01f)
+ { //avoid division by zero
+ sinA = 0.01f;
+ }
+
F32 Plen = dome_radius * sin(F_PI + phi + asin(dome_offset_ratio * sinA)) / sinA;
Pn *= Plen;