aboutsummaryrefslogtreecommitdiff
path: root/sp/src/mathlib
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-12-03 08:54:16 -0800
committerJoe Ludwig <[email protected]>2013-12-03 08:54:16 -0800
commitbeaae8ac45a2f322a792404092d4482065bef7ef (patch)
tree747f35193ba235f0f0b070c05b53468a54559c8e /sp/src/mathlib
parentMake .xcconfigs text files too. (diff)
downloadsource-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.tar.xz
source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.zip
Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013 * VR Mode: . Switches from headtrack.dll to sourcevr.dll . Improved readability of the UI in VR . Removed the IPD calibration tool. TF2 will now obey the Oculus configuration file. Use the Oculus calibration tool in your SDK or install and run "OpenVR" under Tools in Steam to calibrate your IPD. . Added dropdown to enable VR mode in the Video options. Removed the -vr command line option. . Added the ability to switch in and out of VR mode without quitting the game . By default VR mode will run full screen. To switch back to a borderless window set the vr_force_windowed convar. . Added support for VR mode on Linux * Many assorted bug fixes and other changes from Team Fortress in various shared files
Diffstat (limited to 'sp/src/mathlib')
-rw-r--r--sp/src/mathlib/mathlib_base.cpp4
-rw-r--r--sp/src/mathlib/vmatrix.cpp22
2 files changed, 23 insertions, 3 deletions
diff --git a/sp/src/mathlib/mathlib_base.cpp b/sp/src/mathlib/mathlib_base.cpp
index a403ccfa..15c51963 100644
--- a/sp/src/mathlib/mathlib_base.cpp
+++ b/sp/src/mathlib/mathlib_base.cpp
@@ -4244,7 +4244,7 @@ FPExceptionDisabler::FPExceptionDisabler()
// Retrieve the current state of the exception flags. This
// must be done before changing them. _MCW_EM is a bit
// mask representing all available exception masks.
- _controlfp_s(&mOldValues, _MCW_EM, _MCW_EM);
+ _controlfp_s(&mOldValues, 0, 0);
// Set all of the exception flags, which suppresses FP
// exceptions on the x87 and SSE units.
_controlfp_s(0, _MCW_EM, _MCW_EM);
@@ -4269,7 +4269,7 @@ FPExceptionEnabler::FPExceptionEnabler(unsigned int enableBits /*= _EM_OVERFLOW
// Retrieve the current state of the exception flags. This
// must be done before changing them. _MCW_EM is a bit
// mask representing all available exception masks.
- _controlfp_s(&mOldValues, _MCW_EM, _MCW_EM);
+ _controlfp_s(&mOldValues, 0, 0);
// Make sure no non-exception flags have been specified,
// to avoid accidental changing of rounding modes, etc.
diff --git a/sp/src/mathlib/vmatrix.cpp b/sp/src/mathlib/vmatrix.cpp
index 1cd316f3..e99fae2a 100644
--- a/sp/src/mathlib/vmatrix.cpp
+++ b/sp/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
//-----------------------------------------------------------------------------