VisSectorSampler.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/Tools/LevelEdit/VisSectorSampler.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 8/04/00 8:51a $*
  31. * *
  32. * $Revision:: 4 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #ifndef VISSECTORSAMPLER_H
  38. #define VISSECTORSAMPLER_H
  39. #include "always.h"
  40. #include "vector3.h"
  41. class RenderObjClass;
  42. class MeshBuilderClass;
  43. class SceneEditorClass;
  44. class VisGenProgressClass;
  45. class Matrix3D;
  46. /**
  47. ** VisSectorSamplerClass
  48. ** This class encapsulates the process of adaptively sampling a vis sector. It will generate
  49. ** an edge table of all of the "external" edges of the vis-sector meshes contained in the
  50. ** given model and then adaptively sample along them.
  51. */
  52. class VisSectorSamplerClass
  53. {
  54. public:
  55. VisSectorSamplerClass(SceneEditorClass * scene,VisGenProgressClass * Stats,float min_point_distance,int collision_group);
  56. ~VisSectorSamplerClass(void);
  57. void Process(RenderObjClass * model);
  58. protected:
  59. void Reset(int poly_count);
  60. int Collect_Polygons(RenderObjClass * model);
  61. void Sample_Edges(void);
  62. void Sample_Edge(const Vector3 & p0,const Vector3 & p1);
  63. int Sample_Point(const Vector3 & point);
  64. int Sample_Vertical_Segment(const Vector3 & p0,const Vector3 & p1);
  65. int Update_Vis(const Vector3 & point);
  66. bool Check_Ceiling (const Vector3 &position, float *ceiling_dist);
  67. bool Is_Object_Invalid_Roof(RenderObjClass *render_obj);
  68. bool Do_View_Planes_Pass (const Matrix3D &vis_transform);
  69. SceneEditorClass * Scene;
  70. MeshBuilderClass * MeshBuilder;
  71. VisGenProgressClass * Stats;
  72. float MinSampleDistance;
  73. int CollisionGroup;
  74. float EdgeSkipAccum;
  75. };
  76. #endif //VISSECTORSAMPLER_H