From c04ceedbc3e462098eceaa233cd26f6bed79b773 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 19 Sep 2017 15:50:30 -0700 Subject: Baseline for settings changes --- indra/llmath/llquaternion.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llmath/llquaternion.cpp') diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index 47374c287f..dcef2b345e 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -103,6 +103,10 @@ LLQuaternion::LLQuaternion(const LLVector3 &x_axis, *this = mat.quaternion(); normalize(); } +LLQuaternion::LLQuaternion(const LLSD &sd) +{ + setValue(sd); +} // Quatizations void LLQuaternion::quantize16(F32 lower, F32 upper) -- cgit v1.2.3 From 99b82d944937ce321f64aa91fb18ab2aedd3992a Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Sun, 18 Feb 2018 15:52:23 +0000 Subject: Atmospherics WIP libatmosphere integrated in indra/llrender/llatmosphere.cpp Still working on runtime shaders to use libatmosphere precomputed atmospherics textures --- indra/llmath/llquaternion.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/llmath/llquaternion.cpp') diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index dcef2b345e..a8d9eba2a0 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -864,6 +864,26 @@ void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const } } +const LLQuaternion& LLQuaternion::setFromAzimuthAndAltitude(F32 azimuthRadians, F32 altitudeRadians) +{ + // euler angle inputs are complements of azimuth/altitude which are measured from zenith + F32 pitch = llclamp(F_PI_BY_TWO - altitudeRadians, 0.0f, F_PI_BY_TWO); + F32 yaw = llclamp(F_PI_BY_TWO - azimuthRadians, 0.0f, F_PI_BY_TWO); + setEulerAngles(0.0f, pitch, yaw); + return *this; +} + +void LLQuaternion::getAzimuthAndAltitude(F32 &azimuthRadians, F32 &altitudeRadians) +{ + F32 rick_roll; + F32 pitch; + F32 yaw; + getEulerAngles(&rick_roll, &pitch, &yaw); + // make these measured from zenith + altitudeRadians = llclamp(F_PI_BY_TWO - pitch, 0.0f, F_PI_BY_TWO); + azimuthRadians = llclamp(F_PI_BY_TWO - yaw, 0.0f, F_PI_BY_TWO); +} + // quaternion does not need to be normalized void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const { -- cgit v1.2.3 From 64302d3000b69b31e72eb6a3bd8a981c80cb88de Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 00:18:36 +0100 Subject: Modify use of sky settings, reduce complexity, and name funcs to indicate coord systems in use. Fix class2 softenLightF shader. --- indra/llmath/llquaternion.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llmath/llquaternion.cpp') diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index a7ff707bb8..a8d9eba2a0 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -38,8 +38,6 @@ #include "m3math.h" #include "llquantize.h" -#pragma optimize("", off) - // WARNING: Don't use this for global const definitions! using this // at the top of a *.cpp file might not give you what you think. const LLQuaternion LLQuaternion::DEFAULT; -- cgit v1.2.3 From 898c9f44218353b3bf71b78ffce02662b4927625 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Mar 2019 13:21:48 -0700 Subject: Mods to make merge with viewer-release have less whitespace-only change and fix diffs between EEP and VR. --- indra/llmath/llquaternion.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llmath/llquaternion.cpp') diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index a8d9eba2a0..57a976b57a 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -103,6 +103,7 @@ LLQuaternion::LLQuaternion(const LLVector3 &x_axis, *this = mat.quaternion(); normalize(); } + LLQuaternion::LLQuaternion(const LLSD &sd) { setValue(sd); -- cgit v1.2.3