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/mapsweptplayerhull.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/mapsweptplayerhull.h')
| -rw-r--r-- | hammer/mapsweptplayerhull.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/hammer/mapsweptplayerhull.h b/hammer/mapsweptplayerhull.h new file mode 100644 index 0000000..5c389dc --- /dev/null +++ b/hammer/mapsweptplayerhull.h @@ -0,0 +1,107 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef MAPSWEPTPLAYERHULL_H +#define MAPSWEPTPLAYERHULL_H +#ifdef _WIN32 +#pragma once +#endif + +#include "MapClass.h" +#include "MapPointHandle.h" +#include "ToolInterface.h" +#include "MapEntity.h" + + +class CHelperInfo; +class CRender2D; +class CRender3D; +class CToolSweptPlayerHull; +class CMapPlayerHullHandle; + + +class CMapSweptPlayerHull : public CMapHelper +{ + friend CToolSweptPlayerHull; + +public: + + DECLARE_MAPCLASS(CMapSweptPlayerHull, CMapHelper) + + // + // Factory for building from a list of string parameters. + // + static CMapClass *Create(CHelperInfo *pInfo, CMapEntity *pParent); + + // + // Construction/destruction: + // + CMapSweptPlayerHull(); + ~CMapSweptPlayerHull(); + + void GetEndPoint(Vector &vecPos, int nPointIndex); + void UpdateEndPoint(Vector &vecPos, int nPointIndex); + + // + // CMapClass implementation. + // + void CalcBounds(BOOL bFullUpdate = FALSE); + + virtual CMapClass *Copy(bool bUpdateDependencies); + virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies); + + virtual void Render2D(CRender2D *pRender); + + virtual int SerializeRMF(std::fstream &File, BOOL bRMF); + virtual int SerializeMAP(std::fstream &File, BOOL bRMF); + + // Overridden to chain down to our endpoints, which are not children. + void SetOrigin(Vector &vecOrigin); + + // Overridden to chain down to our endpoints, which are not children. + virtual SelectionState_t SetSelectionState(SelectionState_t eSelectionState); + + // Overridden because axis helpers don't take the color of their parent entity. + virtual void SetRenderColor(unsigned char red, unsigned char green, unsigned char blue); + virtual void SetRenderColor(color32 rgbColor); + + virtual bool HitTest2D(CMapView2D *pView, const Vector2D &point, HitInfo_t &HitData); + virtual CBaseTool *GetToolObject(int nHitData, bool bAttachObject ); + + virtual bool IsVisualElement(void) { return true; } + virtual bool IsClutter(void) { return false; } + + virtual const char* GetDescription() { return("Swept player hull helper"); } + + virtual void OnAddToWorld(CMapWorld *pWorld); + virtual void OnParentKeyChanged(const char *key, const char *value); + + virtual void PostloadWorld(CMapWorld *pWorld); + + virtual void Render3D(CRender3D *pRender); + +protected: + + SelectionState_t SetSelectionState(SelectionState_t eSelectionState, int nHandle); + + void UpdateParentKey(void); + + // Overriden to transform our endpoints, which are not children. + virtual void DoTransform(const VMatrix &matrix); + + void Initialize(void); + + CMapPlayerHullHandle *m_Point[2]; // The two endpoints of the axis. +}; + + +inline bool IsSweptHullClass(CMapEntity *pEntity) +{ + return (pEntity->GetChildOfType((CMapSweptPlayerHull *)NULL) != NULL); +} + + +#endif // MAPSWEPTPLAYERHULL_H |