diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/mapfrustum.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/mapfrustum.h')
| -rw-r--r-- | hammer/mapfrustum.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/hammer/mapfrustum.h b/hammer/mapfrustum.h new file mode 100644 index 0000000..e0555e1 --- /dev/null +++ b/hammer/mapfrustum.h @@ -0,0 +1,86 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef MAPFRUSTUM_H +#define MAPFRUSTUM_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "MapHelper.h" +#include "MapFace.h" +#include "fgdlib/WCKeyValues.h" + + +class CHelperInfo; +class CRender3D; + + +class CMapFrustum : public CMapHelper +{ +public: + + DECLARE_MAPCLASS(CMapFrustum,CMapHelper); + + // + // Factory for building from a list of string parameters. + // + static CMapClass *Create(CHelperInfo *pInfo, CMapEntity *pParent); + + // + // Construction/destruction: + // + CMapFrustum(void); + ~CMapFrustum(void); + + void BuildFrustumFaces(); + void CalcBounds(BOOL bFullUpdate = FALSE); + + virtual CMapClass *Copy(bool bUpdateDependencies); + virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies); + + void Render3D(CRender3D *pRender); + + int SerializeRMF(std::fstream &File, BOOL bRMF); + int SerializeMAP(std::fstream &File, BOOL bRMF); + + virtual void PostloadWorld(CMapWorld *pWorld); + + virtual bool IsVisualElement(void) { return(false); } // Only visible when parent entity is selected. + virtual bool IsClutter(void) { return true; } + virtual bool IsCulledByCordon(const Vector &vecMins, const Vector &vecMaxs) { return false; } // We don't hide unless our parent hides. + + const char* GetDescription() { return("Frustum helper"); } + + void OnParentKeyChanged( const char* key, const char* value ); + bool ShouldRenderLast(void) { return(true); } + void GetAngles(QAngle& fAngles); + + +private: + + CMapFace* CreateMapFace( const Vector &v1, const Vector &v2, const Vector &v3, const Vector &v4, float flAlpha ); + + +protected: + + CMapFaceList m_Faces; + + float m_flFOV; + float m_flNearPlane; + float m_flFarPlane; + float m_flPitchScale; + float m_fBrightness; + + QAngle m_Angles; + char m_szFOVKeyName[KEYVALUE_MAX_KEY_LENGTH]; + char m_szColorKeyName[KEYVALUE_MAX_KEY_LENGTH]; + char m_szNearPlaneKeyName[KEYVALUE_MAX_KEY_LENGTH]; + char m_szFarPlaneKeyName[KEYVALUE_MAX_KEY_LENGTH]; +}; + +#endif // MAPFRUSTUM_H |