aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/map_utils.cpp
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/map_utils.cpp
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/map_utils.cpp')
-rw-r--r--mp/src/public/map_utils.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/mp/src/public/map_utils.cpp b/mp/src/public/map_utils.cpp
new file mode 100644
index 00000000..aecad5a1
--- /dev/null
+++ b/mp/src/public/map_utils.cpp
@@ -0,0 +1,48 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "mathlib/vector.h"
+#include "bspfile.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+void SetupLightNormalFromProps( const QAngle &angles, float angle, float pitch, Vector &output )
+{
+ if (angle == ANGLE_UP)
+ {
+ output[0] = output[1] = 0;
+ output[2] = 1;
+ }
+ else if (angle == ANGLE_DOWN)
+ {
+ output[0] = output[1] = 0;
+ output[2] = -1;
+ }
+ else
+ {
+ // if we don't have a specific "angle" use the "angles" YAW
+ if ( !angle )
+ {
+ angle = angles[YAW];
+ }
+
+ output[2] = 0;
+ output[0] = (float)cos (angle/180*M_PI);
+ output[1] = (float)sin (angle/180*M_PI);
+ }
+
+ if ( !pitch )
+ {
+ // if we don't have a specific "pitch" use the "angles" PITCH
+ pitch = angles[PITCH];
+ }
+
+ output[2] = (float)sin(pitch/180*M_PI);
+ output[0] *= (float)cos(pitch/180*M_PI);
+ output[1] *= (float)cos(pitch/180*M_PI);
+}
+