Skip to content
Snippets Groups Projects
Commit f27ef7c3 authored by Andrew Meadows's avatar Andrew Meadows
Browse files

Removed the #ifndef NO_RTTI hack.

Moved the LLSD related methods of LLVector3 to NOT be inline, as per MarkL's suggestion.
parent bd48685d
No related branches found
No related tags found
No related merge requests found
...@@ -179,6 +179,33 @@ LLVector3::LLVector3(const LLVector4 &vec) ...@@ -179,6 +179,33 @@ LLVector3::LLVector3(const LLVector4 &vec)
mV[VZ] = (F32)vec.mV[VZ]; mV[VZ] = (F32)vec.mV[VZ];
} }
LLVector3::LLVector3(const LLSD& sd)
{
setValue(sd);
}
LLSD LLVector3::getValue() const
{
LLSD ret;
ret[0] = mV[0];
ret[1] = mV[1];
ret[2] = mV[2];
return ret;
}
void LLVector3::setValue(const LLSD& sd)
{
mV[0] = (F32) sd[0].asReal();
mV[1] = (F32) sd[1].asReal();
mV[2] = (F32) sd[2].asReal();
}
const LLVector3& LLVector3::operator=(const LLSD& sd)
{
setValue(sd);
return *this;
}
const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot)
{ {
const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ]; const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ];
......
...@@ -12,11 +12,7 @@ ...@@ -12,11 +12,7 @@
#include "llerror.h" #include "llerror.h"
#include "llmath.h" #include "llmath.h"
#ifndef NO_RTTI #include "llsd.h"
// LLSD includes LLString which is incompatible with some other
// stuff (Havok) that requires -fno-rtti
# include "llsd.h"
#endif
class LLVector4; class LLVector4;
class LLMatrix3; class LLMatrix3;
class LLVector3d; class LLVector3d;
...@@ -45,36 +41,13 @@ class LLVector3 ...@@ -45,36 +41,13 @@ class LLVector3
inline explicit LLVector3(const F32 *vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) inline explicit LLVector3(const F32 *vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2])
explicit LLVector3(const LLVector3d &vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) explicit LLVector3(const LLVector3d &vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2])
explicit LLVector3(const LLVector4 &vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2]) explicit LLVector3(const LLVector4 &vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2])
#ifndef NO_RTTI LLVector3(const LLSD& sd);
// LLSD includes LLString which is incompatible with some other
// stuff (Havok) that requires -fno-rtti LLSD getValue() const;
LLVector3(const LLSD& sd)
{ void setValue(const LLSD& sd);
setValue(sd);
} const LLVector3& operator=(const LLSD& sd);
LLSD getValue() const
{
LLSD ret;
ret[0] = mV[0];
ret[1] = mV[1];
ret[2] = mV[2];
return ret;
}
void setValue(const LLSD& sd)
{
mV[0] = (F32) sd[0].asReal();
mV[1] = (F32) sd[1].asReal();
mV[2] = (F32) sd[2].asReal();
}
const LLVector3& operator=(const LLSD& sd)
{
setValue(sd);
return *this;
}
#endif
inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite
BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment