NoJobEngine 2.0.7
Loading...
Searching...
No Matches
NavMeshFunnel.h
Go to the documentation of this file.
1
6#pragma once
7
10
11#include <vector>
12
13#include <glm/glm.hpp>
14
15namespace NoJob
16{
18 {
19 std::vector<glm::vec3> Points;
20
21 bool IsValid() const
22 {
23 return !Points.empty();
24 }
25
26 void Clear()
27 {
28 Points.clear();
29 }
30 };
31
33 {
34 public:
36 const NavMesh& navMesh,
37 const NavPath& corridor,
38 const glm::vec3& startPosition,
39 const glm::vec3& goalPosition);
40
41 private:
42 struct Portal
43 {
44 glm::vec3 Left{ 0.0f };
45 glm::vec3 Right{ 0.0f };
46 };
47
48 static bool BuildPortals(
49 const NavMesh& navMesh,
50 const NavPath& corridor,
51 const glm::vec3& startPosition,
52 const glm::vec3& goalPosition,
53 std::vector<Portal>& portals);
54
55 static bool FindSharedPortal(
56 const NavMesh& navMesh,
57 NavPolygonID fromPolygon,
58 NavPolygonID toPolygon,
59 Portal& portal);
60
61 static float SignedAreaXZ(
62 const glm::vec3& a,
63 const glm::vec3& b,
64 const glm::vec3& c);
65
66 static bool NearlyEqual(
67 const glm::vec3& a,
68 const glm::vec3& b);
69 };
70}
NavMesh declarations for the Navigation subsystem.
NavMeshPathfinder declarations for the Navigation subsystem.
static NavPointPath BuildPath(const NavMesh &navMesh, const NavPath &corridor, const glm::vec3 &startPosition, const glm::vec3 &goalPosition)
uint32_t NavPolygonID
Definition NavMesh.h:18
bool IsValid() const
std::vector< glm::vec3 > Points