recastnavigation_v1.6.0/RecastDemo/Include/Sample_StatMeshTiled.h
Mikko Mononen 6fc3d5c58e Detour/Recast/Demo: Removed GCC reorder warnings (enabled -Wreorder under xcode).
Recast: RecastTimer should compile with null implementation under Linux now.
2009-07-15 12:51:05 +00:00

92 lines
2.0 KiB
C++

#ifndef RECASTSAMPLESTATMESHTILED_H
#define RECASTSAMPLESTATMESHTILED_H
#include "Sample_StatMesh.h"
#include "DetourStatNavMesh.h"
#include "Recast.h"
#include "RecastLog.h"
#include "ChunkyTriMesh.h"
class Sample_StatMeshTiled : public Sample_StatMesh
{
protected:
struct Tile
{
inline Tile() : chf(0), solid(0), cset(0), buildTime(0) {}
inline ~Tile() { delete chf; delete cset; delete solid; }
rcCompactHeightfield* chf;
rcHeightfield* solid;
rcContourSet* cset;
int buildTime;
};
struct TileSet
{
inline TileSet() : width(0), height(0), tiles(0) {}
inline ~TileSet() { delete [] tiles; }
int width, height;
float bmin[3], bmax[3];
float cs, ch;
Tile* tiles;
};
bool m_measurePerTileTimings;
bool m_keepInterResults;
float m_tileSize;
rcBuildTimes m_buildTimes;
rcChunkyTriMesh* m_chunkyMesh;
rcPolyMesh* m_polyMesh;
rcConfig m_cfg;
TileSet* m_tileSet;
static const int MAX_STAT_BUCKETS = 1000;
int m_statPolysPerTile[MAX_STAT_BUCKETS];
int m_statPolysPerTileSamples;
int m_statTimePerTile[MAX_STAT_BUCKETS];
int m_statTimePerTileSamples;
enum DrawMode
{
DRAWMODE_NAVMESH,
DRAWMODE_NAVMESH_TRANS,
DRAWMODE_NAVMESH_BVTREE,
DRAWMODE_NAVMESH_INVIS,
DRAWMODE_MESH,
DRAWMODE_VOXELS,
DRAWMODE_VOXELS_WALKABLE,
DRAWMODE_COMPACT,
DRAWMODE_COMPACT_DISTANCE,
DRAWMODE_COMPACT_REGIONS,
DRAWMODE_REGION_CONNECTIONS,
DRAWMODE_RAW_CONTOURS,
DRAWMODE_BOTH_CONTOURS,
DRAWMODE_CONTOURS,
DRAWMODE_POLYMESH,
MAX_DRAWMODE
};
DrawMode m_drawMode;
void cleanup();
public:
Sample_StatMeshTiled();
virtual ~Sample_StatMeshTiled();
virtual void handleSettings();
virtual void handleDebugMode();
virtual void handleRender();
virtual void handleRenderOverlay(double* proj, double* model, int* view);
virtual void handleMeshChanged(const float* verts, int nverts,
const int* tris, const float* trinorms, int ntris,
const float* bmin, const float* bmax);
virtual bool handleBuild();
};
#endif // RECASTSAMPLESTATMESHTILED_H