Recast Navigation
Navigation-mesh Toolset for Games
Loading...
Searching...
No Matches
TestCase.h
Go to the documentation of this file.
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
19#pragma once
20
21#include "DetourNavMesh.h"
22
23#include <cstdint>
24#include <string>
25#include <vector>
26
28{
29 enum class TestType : uint8_t
30 {
31 PATHFIND,
32 RAYCAST
33 };
34
35 struct Test
36 {
37 TestCase::TestType type{};
38 float spos[3]{};
39 float epos[3]{};
40 float nspos[3]{};
41 float nepos[3]{};
42 float radius = 0;
43 unsigned short includeFlags = 0;
44 unsigned short excludeFlags = 0;
45 bool expand = false;
46
47 std::vector<float> straight {};
48 std::vector<dtPolyRef*> polys {};
49
50 int findNearestPolyTime = 0;
51 int findPathTime = 0;
52 int findStraightPathTime = 0;
53 };
54
55 std::vector<Test> tests;
56
57 void resetTimes();
58
59public:
60 bool load(const std::string& filePath);
61
62 std::string sampleName;
63 std::string geomFileName;
64
65 void doTests(class dtNavMesh* navmesh, class dtNavMeshQuery* navquery);
66
67 void render();
68 bool renderOverlay();
69};
Definition TestCase.h:28
std::string geomFileName
Definition TestCase.h:63
void doTests(class dtNavMesh *navmesh, class dtNavMeshQuery *navquery)
Definition TestCase.cpp:175
std::string sampleName
Definition TestCase.h:62
void render()
Definition TestCase.cpp:315
bool renderOverlay()
Definition TestCase.cpp:382
bool load(const std::string &filePath)
Definition TestCase.cpp:85
Provides the ability to perform pathfinding related queries against a navigation mesh.
Definition DetourNavMeshQuery.h:166
A navigation mesh based on tiles of convex polygons.
Definition DetourNavMesh.h:336