Team Fortress 2 Source Code as on 22/4/2020
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.

78 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //
  4. //=============================================================================
  5. #ifndef DISPSHORE_H
  6. #define DISPSHORE_H
  7. #pragma once
  8. #include "MapHelper.h"
  9. #include "MapFace.h"
  10. #include "MapOverlay.h"
  11. #include "MapOverlayTrans.h"
  12. class CHelperInfo;
  13. class CMapEntity;
  14. struct ShoreFaceData_t
  15. {
  16. CMapFace *m_pFaces[4]; // The hammer faces the points reside on.
  17. Vector m_vecPoints[4]; // The shore face points.
  18. Vector2D m_vecTexCoords[4]; // The shore texture coordinates.
  19. bool m_bAdjWinding;
  20. };
  21. struct ShoreSegment_t
  22. {
  23. Vector m_vecPoints[2]; // Shore segment points.
  24. Vector m_vecNormals[2]; // Shore segment normals.
  25. Vector2D m_vecTexCoords[4]; // Shore segment texture coordinates.
  26. EditDispHandle_t m_hDisp; // Displacement the shore segment was created from.
  27. float m_flWaterZ;
  28. ShoreFaceData_t m_WorldFace;
  29. ShoreFaceData_t m_WaterFace;
  30. // ?
  31. Vector m_vecCenter;
  32. unsigned int m_iStartPoint;
  33. bool m_bTouch;
  34. bool m_bCreated;
  35. };
  36. struct Shoreline_t
  37. {
  38. int m_nShorelineId;
  39. CUtlVector<ShoreSegment_t> m_aSegments; // List of shore segments making up the shore line.
  40. CUtlVector<int> m_aSortedSegments; // List of shore segments sorted (for connectivity).
  41. CUtlVector<CMapOverlay> m_aOverlays;
  42. float m_flLength; // Total length of the shore line.
  43. ShoreEntityData_t m_ShoreData;
  44. Shoreline_t();
  45. ~Shoreline_t();
  46. void AddSegment( Vector &vecPoint0, Vector &vecPoint1, Vector &vecNormal, float flWaterZ, CMapFace *pWaterFace, EditDispHandle_t hDisp );
  47. };
  48. class IDispShoreManager
  49. {
  50. public:
  51. virtual bool Init( void ) = 0;
  52. virtual void Shutdown( void ) = 0;
  53. // Shoreline management.
  54. virtual int GetShorelineCount( void ) = 0;
  55. virtual Shoreline_t *GetShoreline( int nShorelineId ) = 0;
  56. virtual void AddShoreline( int nShorelineId ) = 0;
  57. virtual void RemoveShoreline( int nShorelineId ) = 0;
  58. virtual void BuildShoreline( int nShorelineId, CUtlVector<CMapFace*> &aFaces, CUtlVector<CMapFace*> &aWaterFaces ) = 0;
  59. virtual void Draw( CRender3D *pRender ) = 0;
  60. virtual void DebugDraw( CRender3D *pRender ) = 0;
  61. };
  62. IDispShoreManager *GetShoreManager( void );
  63. #endif // DISPSHORE_H