diff options
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 198fedcb03..9d16f1e654 100644 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp @@ -66,7 +66,14 @@ F32 angle_between(const LLVector2& a, const LLVector2& b) return angle; } -bool are_parallel(const LLVector2& a, const LLVector2& b, F32 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; |