bpt.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 : WWPhys *
  23. * *
  24. * $Archive:: /Commando/Code/wwphys/bpt.h $*
  25. * *
  26. * Author:: Greg_h *
  27. * *
  28. * $Modtime:: 9/09/99 11:29a $*
  29. * *
  30. * $Revision:: 12 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #if 0 //OBSOLETE
  39. #ifdef PORT140
  40. #ifndef BPT_H
  41. #define BPT_H
  42. #include "always.h"
  43. #include "lineseg.h"
  44. #include "aabox.h"
  45. #include "obbox.h"
  46. #include "physcoltest.h"
  47. #include "rendobj.h"
  48. class srScene;
  49. class BptImpClass;
  50. class MeshClass;
  51. class CameraClass;
  52. class ChunkLoadClass;
  53. class ChunkSaveClass;
  54. /*
  55. ** BptClass - Mesh with an auxiliary binary partition tree.
  56. ** The bpt is traversed in collision detection queries and to
  57. ** build the APT for the mesh each frame.
  58. */
  59. class BptClass : public Render3DObjClass
  60. {
  61. public:
  62. BptClass(void);
  63. BptClass(const BptClass & src) { assert(0); }
  64. BptClass & operator = (const BptClass &) { assert(0); return *this; }
  65. virtual ~BptClass(void);
  66. /*
  67. ** Release all assets in use, called by destructor and the load function
  68. */
  69. void Free(void);
  70. /*
  71. ** Required clone function for all render objects.
  72. ** Currently not implemented.
  73. */
  74. virtual RenderObjClass * Clone(void) const { return new BptClass(*this); }
  75. /*
  76. ** Set Mesh, re-builds the bsp data for the given mesh, also generates
  77. ** a new mesh due to splitting required by the partitioning process
  78. */
  79. void Build(MeshClass * mesh);
  80. /*
  81. ** File IO
  82. */
  83. int Load(ChunkLoadClass & cload);
  84. int Save(ChunkSaveClass & csave);
  85. /*
  86. ** Function to update the rendering object - this will be called every
  87. ** frame that the object is in view.
  88. */
  89. virtual void Render( srScene * scene, const CameraClass &camera );
  90. /*
  91. ** Collision Detection Support
  92. */
  93. bool Cast_Ray(PhysRayCollisionTestClass & ray) const;
  94. bool Cast_AABox(PhysAABoxCollisionTestClass & aaboxtest) const;
  95. bool Cast_OBBox(PhysOBBoxCollisionTestClass & obboxtest) const;
  96. // MeshClass * Get_Mesh(void);
  97. protected:
  98. void Update_Cached_Bounding_Volumes(void) const;
  99. BptImpClass * BptImp;
  100. };
  101. #endif
  102. #endif //PORT140
  103. #endif