diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llmath/v3math.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-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.cpp | 31 |
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 | ||
201 | LLVector3::LLVector3(const LLSD& sd) | ||
202 | { | ||
203 | setValue(sd); | ||
204 | } | ||
205 | |||
206 | LLSD 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 | |||
215 | void 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 | |||
222 | const LLVector3& LLVector3::operator=(const LLSD& sd) | ||
223 | { | ||
224 | setValue(sd); | ||
225 | return *this; | ||
226 | } | ||
227 | |||
201 | const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) | 228 | const 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]; |