NoJobEngine 2.0.7
Loading...
Searching...
No Matches
NavMeshPathfinder.h
Go to the documentation of this file.
1
6#pragma once
7
9
10#include <vector>
11
12#include <glm/glm.hpp>
13
14namespace NoJob
15{
16 struct NavPath
17 {
18 std::vector<NavPolygonID> Polygons;
19
20 bool IsValid() const
21 {
22 return !Polygons.empty();
23 }
24
25 void Clear()
26 {
27 Polygons.clear();
28 }
29 };
30
32 {
33 public:
34 static NavPath FindPath(
35 const NavMesh& navMesh,
36 NavPolygonID startPolygon,
37 NavPolygonID goalPolygon);
38
39 private:
40 static float Heuristic(
41 const NavMesh& navMesh,
42 NavPolygonID from,
43 NavPolygonID to);
44
45 static float CalculateTransitionCost(
46 const NavMesh& navMesh,
47 NavPolygonID from,
48 NavPolygonID to,
49 const NavEdge& edge);
50
51 static NavPath ReconstructPath(
52 NavPolygonID startPolygon,
53 NavPolygonID goalPolygon,
54 const std::vector<NavPolygonID>& cameFrom);
55 };
56}
NavMesh declarations for the Navigation subsystem.
static NavPath FindPath(const NavMesh &navMesh, NavPolygonID startPolygon, NavPolygonID goalPolygon)
uint32_t NavPolygonID
Definition NavMesh.h:18
bool IsValid() const
std::vector< NavPolygonID > Polygons