diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-06-14 08:06:31 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-06-15 00:18:49 +0200 |
commit | 3d84a147f0ae781a71f74d9d7ad0b07f9b1ccb43 (patch) | |
tree | 50a2d055fa043f35d9d8c348e3e5650d9dec5429 /indra/llmath/v2math.cpp | |
parent | 3fc8d4b232a60931849e674b48273eb07157b4e1 (diff) |
#1611 Regression in anti-flipping mechanism for mouselook camera
Diffstat (limited to 'indra/llmath/v2math.cpp')
-rw-r--r-- | indra/llmath/v2math.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp index ecbfe7378c..78d349f2f0 100644 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp @@ -67,7 +67,14 @@ F32 angle_between(const LLVector2& a, const LLVector2& b) return angle; } -BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) +F32 signed_angle_between(const LLVector2& a, const LLVector2& b) +{ + F32 angle = angle_between(a, b); + F32 rhombus_square = a[VX] * b[VY] - b[VX] * a[VY]; + return rhombus_square < 0 ? -angle : angle; +} + +BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon) { LLVector2 an = a; LLVector2 bn = b; |