PathfindSectorBuilder.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : LevelEdit *
  23. * *
  24. * $Archive:: /Commando/Code/wwphys/PathfindSectorBuilder.h $Revision:: 2 $*
  25. * *
  26. *---------------------------------------------------------------------------------------------*
  27. * Functions: *
  28. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  29. #if defined(_MSC_VER)
  30. #pragma once
  31. #endif
  32. #ifndef _PATHFIND_SECTOR_BUILDER_H
  33. #define _PATHFIND_SECTOR_BUILDER_H
  34. #include "vector3.h"
  35. #include "matrix3d.h"
  36. #include "vector.h"
  37. #include "physcontrol.h"
  38. #include "pathfindsector.h"
  39. #include "pathfindbodybox.h"
  40. #include "gridcull.h"
  41. // Forward declarations
  42. class Phys3Class;
  43. class SimDirInfoClass;
  44. //////////////////////////////////////////////////////////////////////////
  45. //
  46. // Typedefs
  47. //
  48. //////////////////////////////////////////////////////////////////////////
  49. typedef DynamicVectorClass<PathfindSectorClass *> SECTOR_LIST;
  50. typedef TypedGridCullSystemClass<BodyBoxCullObj> BODY_BOX_CULLING_SYSTEM;
  51. //////////////////////////////////////////////////////////////////////////
  52. //
  53. // PathfindSectorBuilderClass
  54. //
  55. //////////////////////////////////////////////////////////////////////////
  56. class PathfindSectorBuilderClass
  57. {
  58. public:
  59. ////////////////////////////////////////////////////////////////////
  60. // Public constructors/destructors
  61. ////////////////////////////////////////////////////////////////////
  62. PathfindSectorBuilderClass (void);
  63. ~PathfindSectorBuilderClass (void);
  64. ////////////////////////////////////////////////////////////////////
  65. // Public methods
  66. ////////////////////////////////////////////////////////////////////
  67. void Generate_Sectors (const Vector3 &start_pos);
  68. protected:
  69. ////////////////////////////////////////////////////////////////////
  70. // Protected methods
  71. ////////////////////////////////////////////////////////////////////
  72. void Do_Physics_Sim (const Vector3 &start_pos, PATHFIND_DIR direction);
  73. void Floodfill (const Vector3 &start_pos);
  74. BodyBoxCullObj * Get_Sector_Occupant (const Vector3 &pos);
  75. BodyBoxCullObj * Mark_Sector (const Vector3 &pos);
  76. void Mark_Sector (BodyBoxCullObj *body_box);
  77. void Compress_Sectors (void);
  78. void Free_Sectors (void);
  79. void Import_Raw_Data (void);
  80. private:
  81. ////////////////////////////////////////////////////////////////////
  82. // Private member data
  83. ////////////////////////////////////////////////////////////////////
  84. BodyBoxCullObj * m_CurrentSector;
  85. Phys3Class * m_PhysicsSim;
  86. PhysControllerClass m_Controller;
  87. Vector3 m_SimBoundingBox;
  88. int m_RecurseLevel;
  89. int m_RepartitionCount;
  90. bool m_bCancel;
  91. SECTOR_LIST m_SectorList;
  92. BODY_BOX_LIST m_FloodFillProcessList;
  93. BODY_BOX_CULLING_SYSTEM m_BodyBoxCullingSystem;
  94. SimDirInfoClass * m_DirInfo;
  95. };
  96. #endif //_PATHFIND_SECTOR_BUILDER_H