aboutsummaryrefslogtreecommitdiff
path: root/mp/src/mathlib/vmatrix.cpp
diff options
context:
space:
mode:
authorNarendra Umate <[email protected]>2013-12-08 01:27:41 -0800
committerNarendra Umate <[email protected]>2013-12-08 01:27:41 -0800
commit4fa56874ba1557274c10077bf8386ece4c61dbd6 (patch)
treee2d336604e960b548e996d2e7dcfc5a1e1401b9e /mp/src/mathlib/vmatrix.cpp
parentAdded DS_Store to .gitignore. (diff)
parentMake libSDL2.so/dylib into symlinks. (diff)
downloadsource-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.tar.xz
source-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.zip
Merge remote-tracking branch 'upstream/master'
Reverted .gitattributes xcode_ccache_wrapper change. Fixed line endings for .gitignore and .gitattributes.
Diffstat (limited to 'mp/src/mathlib/vmatrix.cpp')
-rw-r--r--mp/src/mathlib/vmatrix.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/mp/src/mathlib/vmatrix.cpp b/mp/src/mathlib/vmatrix.cpp
index 1cd316f3..e99fae2a 100644
--- a/mp/src/mathlib/vmatrix.cpp
+++ b/mp/src/mathlib/vmatrix.cpp
@@ -507,7 +507,7 @@ bool VMatrix::IsRotationMatrix() const
FloatMakePositive( v2.Dot(v3) ) < 0.01f;
}
-void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles )
+static void SetupMatrixAnglesInternal( vec_t m[4][4], const QAngle & vAngles )
{
float sr, sp, sy, cr, cp, cy;
@@ -528,6 +528,11 @@ void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles
m[0][3] = 0.f;
m[1][3] = 0.f;
m[2][3] = 0.f;
+}
+
+void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles )
+{
+ SetupMatrixAnglesInternal( m, vAngles );
// Add translation
m[0][3] = origin.x;
@@ -540,6 +545,21 @@ void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles
}
+void VMatrix::SetupMatrixAngles( const QAngle &vAngles )
+{
+ SetupMatrixAnglesInternal( m, vAngles );
+
+ // Zero everything else
+ m[0][3] = 0.0f;
+ m[1][3] = 0.0f;
+ m[2][3] = 0.0f;
+ m[3][0] = 0.0f;
+ m[3][1] = 0.0f;
+ m[3][2] = 0.0f;
+ m[3][3] = 1.0f;
+}
+
+
//-----------------------------------------------------------------------------
// Sets matrix to identity
//-----------------------------------------------------------------------------