From 3d84a147f0ae781a71f74d9d7ad0b07f9b1ccb43 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 14 Jun 2024 08:06:31 +0200 Subject: #1611 Regression in anti-flipping mechanism for mouselook camera --- indra/llmath/llquaternion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llmath/llquaternion.cpp') diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index ce0a88c26f..07e54daf87 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -58,7 +58,7 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat) LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec) { - F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); + F32 mag = vec.length(); if (mag > FP_MAG_THRESHOLD) { angle *= 0.5; @@ -77,7 +77,7 @@ LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec) LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec) { - F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); + F32 mag = vec.length(); if (mag > FP_MAG_THRESHOLD) { angle *= 0.5; -- cgit v1.2.3 From 4c6afbbb75076e9fd34ee5707a02195c4e2f7223 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 17 Apr 2025 19:50:30 +0200 Subject: Restore llmath improvements from archived develop branch: * Make eligible functions constexpr * Use constants for vector indices where applicable * Reformat to match actual coding conventions --- indra/llmath/llquaternion.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llmath/llquaternion.cpp') diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index aefb82b2f0..1ab3a73d79 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -30,7 +30,6 @@ #include "llquaternion.h" -//#include "vmath.h" #include "v3math.h" #include "v3dmath.h" #include "v4math.h" -- cgit v1.2.3