Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef MAPSWEPTPLAYERHULL_H
  7. #define MAPSWEPTPLAYERHULL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "MapClass.h"
  12. #include "MapPointHandle.h"
  13. #include "ToolInterface.h"
  14. #include "MapEntity.h"
  15. class CHelperInfo;
  16. class CRender2D;
  17. class CRender3D;
  18. class CToolSweptPlayerHull;
  19. class CMapPlayerHullHandle;
  20. class CMapSweptPlayerHull : public CMapHelper
  21. {
  22. friend CToolSweptPlayerHull;
  23. public:
  24. DECLARE_MAPCLASS(CMapSweptPlayerHull, CMapHelper)
  25. //
  26. // Factory for building from a list of string parameters.
  27. //
  28. static CMapClass *Create(CHelperInfo *pInfo, CMapEntity *pParent);
  29. //
  30. // Construction/destruction:
  31. //
  32. CMapSweptPlayerHull();
  33. ~CMapSweptPlayerHull();
  34. void GetEndPoint(Vector &vecPos, int nPointIndex);
  35. void UpdateEndPoint(Vector &vecPos, int nPointIndex);
  36. //
  37. // CMapClass implementation.
  38. //
  39. void CalcBounds(BOOL bFullUpdate = FALSE);
  40. virtual CMapClass *Copy(bool bUpdateDependencies);
  41. virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);
  42. virtual void Render2D(CRender2D *pRender);
  43. virtual int SerializeRMF(std::fstream &File, BOOL bRMF);
  44. virtual int SerializeMAP(std::fstream &File, BOOL bRMF);
  45. // Overridden to chain down to our endpoints, which are not children.
  46. void SetOrigin(Vector &vecOrigin);
  47. // Overridden to chain down to our endpoints, which are not children.
  48. virtual SelectionState_t SetSelectionState(SelectionState_t eSelectionState);
  49. // Overridden because axis helpers don't take the color of their parent entity.
  50. virtual void SetRenderColor(unsigned char red, unsigned char green, unsigned char blue);
  51. virtual void SetRenderColor(color32 rgbColor);
  52. virtual bool HitTest2D(CMapView2D *pView, const Vector2D &point, HitInfo_t &HitData);
  53. virtual CBaseTool *GetToolObject(int nHitData, bool bAttachObject );
  54. virtual bool IsVisualElement(void) { return true; }
  55. virtual bool IsClutter(void) const { return false; }
  56. virtual const char* GetDescription() { return("Swept player hull helper"); }
  57. virtual void OnAddToWorld(CMapWorld *pWorld);
  58. virtual void OnParentKeyChanged(const char *key, const char *value);
  59. virtual void PostloadWorld(CMapWorld *pWorld);
  60. virtual void Render3D(CRender3D *pRender);
  61. protected:
  62. SelectionState_t SetSelectionState(SelectionState_t eSelectionState, int nHandle);
  63. void UpdateParentKey(void);
  64. // Overriden to transform our endpoints, which are not children.
  65. virtual void DoTransform(const VMatrix &matrix);
  66. void Initialize(void);
  67. CMapPlayerHullHandle *m_Point[2]; // The two endpoints of the axis.
  68. };
  69. inline bool IsSweptHullClass(CMapEntity *pEntity)
  70. {
  71. return (pEntity->GetChildOfType((CMapSweptPlayerHull *)NULL) != NULL);
  72. }
  73. #endif // MAPSWEPTPLAYERHULL_H