Sample_SoloMesh.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
  3. //
  4. // This software is provided 'as-is', without any express or implied
  5. // warranty. In no event will the authors be held liable for any damages
  6. // arising from the use of this software.
  7. // Permission is granted to anyone to use this software for any purpose,
  8. // including commercial applications, and to alter it and redistribute it
  9. // freely, subject to the following restrictions:
  10. // 1. The origin of this software must not be misrepresented; you must not
  11. // claim that you wrote the original software. If you use this software
  12. // in a product, an acknowledgment in the product documentation would be
  13. // appreciated but is not required.
  14. // 2. Altered source versions must be plainly marked as such, and must not be
  15. // misrepresented as being the original software.
  16. // 3. This notice may not be removed or altered from any source distribution.
  17. //
  18. #ifndef RECASTSAMPLESOLOMESH_H
  19. #define RECASTSAMPLESOLOMESH_H
  20. #include "Sample.h"
  21. #include "DetourNavMesh.h"
  22. #include "Recast.h"
  23. class Sample_SoloMesh : public Sample
  24. {
  25. protected:
  26. bool m_keepInterResults;
  27. float m_totalBuildTimeMs;
  28. unsigned char* m_triareas;
  29. rcHeightfield* m_solid;
  30. rcCompactHeightfield* m_chf;
  31. rcContourSet* m_cset;
  32. rcPolyMesh* m_pmesh;
  33. rcConfig m_cfg;
  34. rcPolyMeshDetail* m_dmesh;
  35. enum DrawMode
  36. {
  37. DRAWMODE_NAVMESH,
  38. DRAWMODE_NAVMESH_TRANS,
  39. DRAWMODE_NAVMESH_BVTREE,
  40. DRAWMODE_NAVMESH_NODES,
  41. DRAWMODE_NAVMESH_INVIS,
  42. DRAWMODE_MESH,
  43. DRAWMODE_VOXELS,
  44. DRAWMODE_VOXELS_WALKABLE,
  45. DRAWMODE_COMPACT,
  46. DRAWMODE_COMPACT_DISTANCE,
  47. DRAWMODE_COMPACT_REGIONS,
  48. DRAWMODE_REGION_CONNECTIONS,
  49. DRAWMODE_RAW_CONTOURS,
  50. DRAWMODE_BOTH_CONTOURS,
  51. DRAWMODE_CONTOURS,
  52. DRAWMODE_POLYMESH,
  53. DRAWMODE_POLYMESH_DETAIL,
  54. MAX_DRAWMODE
  55. };
  56. DrawMode m_drawMode;
  57. void cleanup();
  58. public:
  59. Sample_SoloMesh();
  60. virtual ~Sample_SoloMesh();
  61. virtual void handleSettings();
  62. virtual void handleTools();
  63. virtual void handleDebugMode();
  64. virtual void handleRender();
  65. virtual void handleRenderOverlay(double* proj, double* model, int* view);
  66. virtual void handleMeshChanged(class InputGeom* geom);
  67. virtual bool handleBuild();
  68. private:
  69. // Explicitly disabled copy constructor and copy assignment operator.
  70. Sample_SoloMesh(const Sample_SoloMesh&);
  71. Sample_SoloMesh& operator=(const Sample_SoloMesh&);
  72. };
  73. #endif // RECASTSAMPLESOLOMESHSIMPLE_H