diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-05 12:17:58 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-05 12:17:58 +0100 |
commit | e2b51b8884d1003a3312276611b8a8c34123bc36 (patch) | |
tree | 2a62d60e216e172685670230e544103444e28c4c /indra/llmath/v3math.cpp | |
parent | e2e329b2e22dbab52d12ff309fb78533cb52c8e9 (diff) | |
parent | 7bb6532e93b7536a9a11cf19db10ba0cda1d99c3 (diff) |
merge from viewer-public
Diffstat (limited to 'indra/llmath/v3math.cpp')
-rw-r--r-- | indra/llmath/v3math.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index 63683ed496..82aad6550b 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -197,6 +197,28 @@ const LLVector3& LLVector3::rotVec(const LLQuaternion &q) return *this; } +const LLVector3& LLVector3::transVec(const LLMatrix4& mat) +{ + setVec( + mV[VX] * mat.mMatrix[VX][VX] + + mV[VY] * mat.mMatrix[VX][VY] + + mV[VZ] * mat.mMatrix[VX][VZ] + + mat.mMatrix[VX][VW], + + mV[VX] * mat.mMatrix[VY][VX] + + mV[VY] * mat.mMatrix[VY][VY] + + mV[VZ] * mat.mMatrix[VY][VZ] + + mat.mMatrix[VY][VW], + + mV[VX] * mat.mMatrix[VZ][VX] + + mV[VY] * mat.mMatrix[VZ][VY] + + mV[VZ] * mat.mMatrix[VZ][VZ] + + mat.mMatrix[VZ][VW]); + + return *this; +} + + const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec) { if ( !vec.isExactlyZero() && angle ) |