diff options
author | Andrew Meadows <andrew@lindenlab.com> | 2007-02-07 21:58:58 +0000 |
---|---|---|
committer | Andrew Meadows <andrew@lindenlab.com> | 2007-02-07 21:58:58 +0000 |
commit | f27ef7c31a5128f2fd97b3f4b503a9b040d674f7 (patch) | |
tree | 604176c45d6d54cd20fb86b64ebfdb3f6763403a /indra/llmath/v3math.cpp | |
parent | bd48685d3489e14e709673d79b4516fd980398d8 (diff) |
Removed the #ifndef NO_RTTI hack.
Moved the LLSD related methods of LLVector3 to NOT be inline, as per MarkL's suggestion.
Diffstat (limited to 'indra/llmath/v3math.cpp')
-rw-r--r-- | indra/llmath/v3math.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index f254f4112e..9e6084565e 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -179,6 +179,33 @@ LLVector3::LLVector3(const LLVector4 &vec) 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 F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ]; |