NoJobEngine 2.0.7
Loading...
Searching...
No Matches
NavMeshGenerator.h
Go to the documentation of this file.
1
6#pragma once
7
9
10#include <cstdint>
11#include <vector>
12
13#include <glm/glm.hpp>
14
15namespace NoJob
16{
18 {
19 float MaxSlopeAngle = 45.0f;
20 bool MergePolygons = true;
21
22 // Maximum world-space distance at which two source vertices
23 // are considered the same navigation vertex.
24 float VertexWeldTolerance = 0.001f;
25
26 // Maximum distance a vertex may have from the polygon plane
27 // for polygons to be merged.
29 };
30
32 {
33 std::vector<glm::vec3> Vertices;
34 std::vector<uint32_t> Indices;
35 };
36
38 {
39 public:
40 static NavMesh Generate(
41 const NavMeshSourceGeometry& geometry,
42 const NavMeshGenerationSettings& settings = {});
43
44 private:
45 static bool IsPolygonPlanar(
46 const NavMesh& navMesh,
47 const std::vector<NavVertexID>& vertices,
48 float tolerance);
49
50 static bool IsPolygonConvex(
51 const NavMesh& navMesh,
52 const std::vector<NavVertexID>& vertices);
53
54 static bool BuildMergedPolygon(
55 const NavPolygon& polygonA,
56 const NavPolygon& polygonB,
57 std::vector<NavVertexID>& mergedVertices);
58
59 static void MergeConvexPolygons(
60 NavMesh& navMesh,
61 float planarityTolerance);
62 };
63}
NavMesh declarations for the Navigation subsystem.
static NavMesh Generate(const NavMeshSourceGeometry &geometry, const NavMeshGenerationSettings &settings={})
std::vector< glm::vec3 > Vertices
std::vector< uint32_t > Indices