diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/public/tier2/camerautils.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/public/tier2/camerautils.h')
| -rw-r--r-- | sp/src/public/tier2/camerautils.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sp/src/public/tier2/camerautils.h b/sp/src/public/tier2/camerautils.h new file mode 100644 index 00000000..0cf26f14 --- /dev/null +++ b/sp/src/public/tier2/camerautils.h @@ -0,0 +1,57 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: A set of utilities to deal with camera transforms
+//
+//===========================================================================//
+
+#ifndef CAMERAUTILS_H
+#define CAMERAUTILS_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier2/tier2.h"
+#include "Color.h"
+
+//-----------------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------------
+class Vector;
+class QAngle;
+class IMaterial;
+struct matrix3x4_t;
+class VMatrix;
+
+
+//-----------------------------------------------------------------------------
+// Camera state
+// TODO: Maybe this should be a base class of CViewSetup?
+//-----------------------------------------------------------------------------
+struct Camera_t
+{
+ Vector m_origin;
+ QAngle m_angles;
+ float m_flFOV;
+ float m_flZNear;
+ float m_flZFar;
+};
+
+
+//-----------------------------------------------------------------------------
+// accessors for generated matrices
+//-----------------------------------------------------------------------------
+void ComputeViewMatrix( VMatrix *pWorldToCamera, const Camera_t& camera );
+void ComputeViewMatrix( matrix3x4_t *pWorldToCamera, const Camera_t& camera );
+void ComputeProjectionMatrix( VMatrix *pCameraToProjection, const Camera_t& camera, int width, int height );
+
+
+//-----------------------------------------------------------------------------
+// Computes the screen space position given a screen size
+//-----------------------------------------------------------------------------
+void ComputeScreenSpacePosition( Vector2D *pScreenPosition, const Vector &vecWorldPosition,
+ const Camera_t &camera, int width, int height );
+
+
+#endif // CAMERAUTILS_H
+
|