diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/public/map_utils.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/public/map_utils.cpp')
| -rw-r--r-- | sp/src/public/map_utils.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/sp/src/public/map_utils.cpp b/sp/src/public/map_utils.cpp index aecad5a1..a0022b5d 100644 --- a/sp/src/public/map_utils.cpp +++ b/sp/src/public/map_utils.cpp @@ -1,48 +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);
-}
-
+//========= 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); +} + |