| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef TESTCASE_H |
| 20 |
#define TESTCASE_H |
| 21 |
|
| 22 |
#include <string> |
| 23 |
#include "DetourNavMesh.h" |
| 24 |
|
| 25 |
class TestCase |
| 26 |
{ |
| 27 |
enum TestType |
| 28 |
{ |
| 29 |
TEST_PATHFIND, |
| 30 |
TEST_RAYCAST |
| 31 |
}; |
| 32 |
|
| 33 |
struct Test |
| 34 |
{ |
| 35 |
Test() : |
| 36 |
type(), |
| 37 |
spos(), |
| 38 |
epos(), |
| 39 |
nspos(), |
| 40 |
nepos(), |
| 41 |
radius(0), |
| 42 |
includeFlags(0), |
| 43 |
excludeFlags(0), |
| 44 |
expand(false), |
| 45 |
straight(0), |
| 46 |
nstraight(0), |
| 47 |
polys(0), |
| 48 |
npolys(0), |
| 49 |
findNearestPolyTime(0), |
| 50 |
findPathTime(0), |
| 51 |
findStraightPathTime(0), |
| 52 |
next(0) |
| 53 |
{ |
| 54 |
} |
| 55 |
|
| 56 |
~Test() |
| 57 |
{ |
| 58 |
delete [] straight; |
| 59 |
delete [] polys; |
| 60 |
} |
| 61 |
|
| 62 |
TestType type; |
| 63 |
float spos[3]; |
| 64 |
float epos[3]; |
| 65 |
float nspos[3]; |
| 66 |
float nepos[3]; |
| 67 |
float radius; |
| 68 |
unsigned short includeFlags; |
| 69 |
unsigned short excludeFlags; |
| 70 |
bool expand; |
| 71 |
|
| 72 |
float* straight; |
| 73 |
int nstraight; |
| 74 |
dtPolyRef* polys; |
| 75 |
int npolys; |
| 76 |
|
| 77 |
int findNearestPolyTime; |
| 78 |
int findPathTime; |
| 79 |
int findStraightPathTime; |
| 80 |
|
| 81 |
Test* next; |
| 82 |
private: |
| 83 |
|
| 84 |
Test(const Test&); |
| 85 |
Test& operator=(const Test&); |
| 86 |
}; |
| 87 |
|
| 88 |
std::string m_sampleName; |
| 89 |
std::string m_geomFileName; |
| 90 |
Test* m_tests; |
| 91 |
|
| 92 |
void resetTimes(); |
| 93 |
|
| 94 |
public: |
| 95 |
TestCase(); |
| 96 |
~TestCase(); |
| 97 |
|
| 98 |
bool load(const std::string& filePath); |
| 99 |
|
| 100 |
const std::string& getSampleName() const { return m_sampleName; } |
| 101 |
const std::string& getGeomFileName() const { return m_geomFileName; } |
| 102 |
|
| 103 |
void doTests(class dtNavMesh* navmesh, class dtNavMeshQuery* navquery); |
| 104 |
|
| 105 |
void handleRender(); |
| 106 |
bool handleRenderOverlay(double* proj, double* model, int* view); |
| 107 |
|
| 108 |
private: |
| 109 |
|
| 110 |
TestCase(const TestCase&); |
| 111 |
TestCase& operator=(const TestCase&); |
| 112 |
}; |
| 113 |
|
| 114 |
#endif |