summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llmath.h2
-rw-r--r--indra/llmath/v2math.h4
-rw-r--r--indra/llmath/v3math.h10
-rw-r--r--indra/llmath/v4math.h4
4 files changed, 9 insertions, 11 deletions
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index fa315291a3..f5e9cdc7e4 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -75,7 +75,7 @@ constexpr F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
constexpr F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
constexpr F32 F_APPROXIMATELY_ZERO = 0.00001f;
constexpr F32 F_LN10 = 2.3025850929940456840179914546844f;
-constexpr F32 OO_LN10 = 0.43429448190325182765112891891661;
+constexpr F32 OO_LN10 = 0.43429448190325182765112891891661f;
constexpr F32 F_LN2 = 0.69314718056f;
constexpr F32 OO_LN2 = 1.4426950408889634073599246810019f;
diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h
index b06739f122..6f2136139a 100644
--- a/indra/llmath/v2math.h
+++ b/indra/llmath/v2math.h
@@ -212,7 +212,7 @@ inline void LLVector2::setVec(const F32 *vec)
inline F32 LLVector2::length() const
{
- return (F32) sqrt(lengthSquared());
+ return sqrt(lengthSquared());
}
inline F32 LLVector2::lengthSquared() const
@@ -304,7 +304,7 @@ inline LLVector2 operator-(const LLVector2& a, const LLVector2& b)
inline F32 operator*(const LLVector2& a, const LLVector2& b)
{
- return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY]);
+ return a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY];
}
inline LLVector2 operator%(const LLVector2& a, const LLVector2& b)
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index bcd8f311a8..c51c3bd316 100644
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -233,7 +233,7 @@ inline void LLVector3::set(F32 x, F32 y, F32 z)
inline void LLVector3::set(const LLVector3& vec)
{
- set(vec.mV[0], vec.mV[1], vec.mV[2]);
+ set(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
}
inline void LLVector3::set(const F32* vec)
@@ -285,10 +285,10 @@ inline F32 LLVector3::normVec()
inline F32 LLVector3::length() const
{
- return (F32) sqrt(lengthSquared());
+ return sqrt(lengthSquared());
}
-inline F32 LLVector3::lengthSquared(void) const
+inline F32 LLVector3::lengthSquared() const
{
return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
}
@@ -412,9 +412,7 @@ inline const LLVector3& operator*=(LLVector3& a, const LLVector3& b)
inline const LLVector3& operator/=(LLVector3& a, F32 k)
{
- a.mV[VX] /= k;
- a.mV[VY] /= k;
- a.mV[VZ] /= k;
+ a *= 1.f / k;
return a;
}
diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h
index b906ae24fd..4f36dc6533 100644
--- a/indra/llmath/v4math.h
+++ b/indra/llmath/v4math.h
@@ -298,7 +298,7 @@ inline void LLVector4::setVec(const F32* vec)
inline F32 LLVector4::length() const
{
- return (F32) sqrt(lengthSquared());
+ return sqrt(lengthSquared());
}
inline F32 LLVector4::lengthSquared() const
@@ -436,7 +436,7 @@ inline LLVector4 lerp(const LLVector4& a, const LLVector4& b, F32 u)
inline F32 LLVector4::normalize()
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{