NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
NavMeshGenerator.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#include "
Engine/AI/Navigation/NavMesh.h
"
9
10
#include <cstdint>
11
#include <vector>
12
13
#include <glm/glm.hpp>
14
15
namespace
NoJob
16
{
17
struct
NavMeshGenerationSettings
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.
28
float
MergePlanarityTolerance
= 0.001f;
29
};
30
31
struct
NavMeshSourceGeometry
32
{
33
std::vector<glm::vec3>
Vertices
;
34
std::vector<uint32_t>
Indices
;
35
};
36
37
class
NavMeshGenerator
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.h
NavMesh declarations for the Navigation subsystem.
NoJob::NavMeshGenerator
Definition
NavMeshGenerator.h:38
NoJob::NavMeshGenerator::Generate
static NavMesh Generate(const NavMeshSourceGeometry &geometry, const NavMeshGenerationSettings &settings={})
Definition
NavMeshGenerator.cpp:13
NoJob::NavMesh
Definition
NavMesh.h:53
NoJob
Definition
BTActionNode.h:13
NoJob::NavMeshGenerationSettings
Definition
NavMeshGenerator.h:18
NoJob::NavMeshGenerationSettings::MaxSlopeAngle
float MaxSlopeAngle
Definition
NavMeshGenerator.h:19
NoJob::NavMeshGenerationSettings::MergePlanarityTolerance
float MergePlanarityTolerance
Definition
NavMeshGenerator.h:28
NoJob::NavMeshGenerationSettings::MergePolygons
bool MergePolygons
Definition
NavMeshGenerator.h:20
NoJob::NavMeshGenerationSettings::VertexWeldTolerance
float VertexWeldTolerance
Definition
NavMeshGenerator.h:24
NoJob::NavMeshSourceGeometry
Definition
NavMeshGenerator.h:32
NoJob::NavMeshSourceGeometry::Vertices
std::vector< glm::vec3 > Vertices
Definition
NavMeshGenerator.h:33
NoJob::NavMeshSourceGeometry::Indices
std::vector< uint32_t > Indices
Definition
NavMeshGenerator.h:34
NoJob::NavPolygon
Definition
NavMesh.h:43
Engine
AI
Navigation
NavMeshGenerator.h
Generated by
1.18.0