diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-02-15 22:53:54 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-02-16 12:06:13 +0200 |
commit | fa35eeecd7854b92e52f7bac2dc31bfc07ce012b (patch) | |
tree | fc03188f58113e2f8bcd3742bbe45058b801e940 /indra/llui/llvirtualtrackball.cpp | |
parent | 7b6c7c249645a0d3e9626c793b29348e9a549582 (diff) |
SL-14725 Add elevation and azimuth to local lighting
Diffstat (limited to 'indra/llui/llvirtualtrackball.cpp')
-rw-r--r-- | indra/llui/llvirtualtrackball.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 15847a7282..728e86af08 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -352,7 +352,6 @@ LLQuaternion LLVirtualTrackball::getRotation() const void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) { // LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?) - const LLVector3 VectorZero(10000.0f, 0.0f, 0.0f); LLVector3 point = VectorZero * quat; if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY])) @@ -371,19 +370,7 @@ void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &a azimuth += F_PI * 2; } - if (abs(point.mV[VY]) > abs(point.mV[VX]) && !is_approx_zero(point.mV[VY])) // to avoid precision drop - { - elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VY])); - } - else if (!is_approx_zero(point.mV[VX])) - { - elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VX])); - } - else - { - // both VX and VY are near zero, VZ should be high - elevation = point.mV[VZ] > 0 ? F_PI_BY_TWO : -F_PI_BY_TWO; - } + elevation = asin(point.mV[VZ]); // because VectorZero is '1' } // static |