summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-03-07 11:24:48 -0800
committerRider Linden <rider@lindenlab.com>2018-03-07 11:24:48 -0800
commit4235231b5adbb7f064cab732f761dd359ef4b648 (patch)
tree2c7e30028813df01a104e80d89f26920c572ca44
parentc11c17ed7b5c614a6c8505088aa709ddd9f1f1a4 (diff)
Fix for calculating azimuth and angle
-rw-r--r--indra/llinventory/llsettingssky.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index cac363b510..7da3a336cc 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -917,12 +917,22 @@ namespace
LLVector3 body_al(0.f, body_vector[1], body_vector[2]);
if (fabs(body_az.normalize()) > 0.001)
+ {
azimuth = angle_between(DUE_EAST, body_az);
+ if (body_az[1] < 0.0f)
+ azimuth = F_TWO_PI - azimuth;
+ }
else
azimuth = 0.0f;
if (fabs(body_al.normalize()) > 0.001)
+ {
altitude = angle_between(DUE_EAST, body_al);
+ if (body_al[2] < 0.0f)
+ {
+ altitude = F_TWO_PI - altitude;
+ }
+ }
else
altitude = 0.0f;
}