aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath/v3math.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llmath/v3math.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/v3math.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/linden/indra/llmath/v3math.cpp b/linden/indra/llmath/v3math.cpp
index 39d3b70..a97b6d8 100644
--- a/linden/indra/llmath/v3math.cpp
+++ b/linden/indra/llmath/v3math.cpp
@@ -137,7 +137,7 @@ const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec)
137{ 137{
138 if ( !vec.isExactlyZero() && angle ) 138 if ( !vec.isExactlyZero() && angle )
139 { 139 {
140 *this = *this * LLMatrix3(angle, vec); 140 *this = *this * LLQuaternion(angle, vec);
141 } 141 }
142 return *this; 142 return *this;
143} 143}
@@ -147,7 +147,7 @@ const LLVector3& LLVector3::rotVec(F32 angle, F32 x, F32 y, F32 z)
147 LLVector3 vec(x, y, z); 147 LLVector3 vec(x, y, z);
148 if ( !vec.isExactlyZero() && angle ) 148 if ( !vec.isExactlyZero() && angle )
149 { 149 {
150 *this = *this * LLMatrix3(angle, vec); 150 *this = *this * LLQuaternion(angle, vec);
151 } 151 }
152 return *this; 152 return *this;
153} 153}
@@ -198,6 +198,33 @@ LLVector3::LLVector3(const LLVector4 &vec)
198 mV[VZ] = (F32)vec.mV[VZ]; 198 mV[VZ] = (F32)vec.mV[VZ];
199} 199}
200 200
201LLVector3::LLVector3(const LLSD& sd)
202{
203 setValue(sd);
204}
205
206LLSD LLVector3::getValue() const
207{
208 LLSD ret;
209 ret[0] = mV[0];
210 ret[1] = mV[1];
211 ret[2] = mV[2];
212 return ret;
213}
214
215void LLVector3::setValue(const LLSD& sd)
216{
217 mV[0] = (F32) sd[0].asReal();
218 mV[1] = (F32) sd[1].asReal();
219 mV[2] = (F32) sd[2].asReal();
220}
221
222const LLVector3& LLVector3::operator=(const LLSD& sd)
223{
224 setValue(sd);
225 return *this;
226}
227
201const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) 228const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot)
202{ 229{
203 const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ]; 230 const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ];