summaryrefslogtreecommitdiff
path: root/indra/llmath/v3math.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-05-05 12:17:58 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-05-05 12:17:58 +0100
commite2b51b8884d1003a3312276611b8a8c34123bc36 (patch)
tree2a62d60e216e172685670230e544103444e28c4c /indra/llmath/v3math.cpp
parente2e329b2e22dbab52d12ff309fb78533cb52c8e9 (diff)
parent7bb6532e93b7536a9a11cf19db10ba0cda1d99c3 (diff)
merge from viewer-public
Diffstat (limited to 'indra/llmath/v3math.cpp')
-rw-r--r--indra/llmath/v3math.cpp22
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 )