summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorEli Linden <eli@lindenlab.com>2010-04-15 14:13:00 -0700
committerEli Linden <eli@lindenlab.com>2010-04-15 14:13:00 -0700
commit4fe28de53a7467809f791790bf889d36c93eaa0b (patch)
treee7220f530f1ce817ff092360dd87d83c82794ca8 /indra/llmath
parent5b64be097f319d7d2f20e0b1fd803a3644544dc3 (diff)
parentfed0e3376f24d3fbd036633a1d6916bef38a2d54 (diff)
Merge
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/v2math.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h
index 9fef8851cc..65f3714313 100644
--- a/indra/llmath/v2math.h
+++ b/indra/llmath/v2math.h
@@ -70,6 +70,8 @@ class LLVector2
void setVec(const LLVector2 &vec); // deprecated
void setVec(const F32 *vec); // deprecated
+ inline bool isFinite() const; // checks to see if all values of LLVector2 are finite
+
F32 length() const; // Returns magnitude of LLVector2
F32 lengthSquared() const; // Returns magnitude squared of LLVector2
F32 normalize(); // Normalizes and returns the magnitude of LLVector2
@@ -215,6 +217,7 @@ inline void LLVector2::setVec(const F32 *vec)
mV[VY] = vec[VY];
}
+
// LLVector2 Magnitude and Normalization Functions
inline F32 LLVector2::length(void) const
@@ -247,6 +250,12 @@ inline F32 LLVector2::normalize(void)
return (mag);
}
+// checker
+inline bool LLVector2::isFinite() const
+{
+ return (llfinite(mV[VX]) && llfinite(mV[VY]));
+}
+
// deprecated
inline F32 LLVector2::magVec(void) const
{