Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
RecastMesh
CRecastBuilder.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2024 Skylicht Technology CO., LTD
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
8
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
9
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10
subject to the following conditions:
11
12
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20
This file is part of the "Skylicht Engine".
21
https://github.com/skylicht-lab/skylicht-engine
22
!#
23
*/
24
25
#pragma once
26
27
#include "CRecastMesh.h"
28
#include "ObstacleAvoidance/CObstacleAvoidance.h"
29
#include "RenderMesh/CMesh.h"
30
31
namespace
Skylicht
32
{
33
namespace
Graph
34
{
35
struct
SBuilderConfig
36
{
37
float
CellSize;
38
float
CellHeight;
39
float
AgentHeight;
40
float
AgentRadius;
41
float
AgentMaxClimb;
42
float
AgentMaxSlope;
43
float
RegionMinSize;
44
float
RegionMergeSize;
45
float
EdgeMaxLen;
46
float
EdgeMaxError;
47
int
VertsPerPoly;
48
float
DetailSampleDist;
49
float
DetailSampleMaxError;
50
51
SBuilderConfig()
52
{
53
CellSize = 0.3f;
54
CellHeight = 0.2f;
55
AgentHeight = 2.0f;
56
AgentRadius = 0.6f;
57
AgentMaxClimb = 0.9f;
58
AgentMaxSlope = 45.0f;
59
RegionMinSize = 8;
60
RegionMergeSize = 20;
61
EdgeMaxLen = 12.0f;
62
EdgeMaxError = 1.3f;
63
VertsPerPoly = 6;
64
DetailSampleDist = 6.0f;
65
DetailSampleMaxError = 1.0f;
66
}
67
};
68
69
class
CRecastBuilder
70
{
71
protected
:
72
SBuilderConfig
m_config;
73
74
public
:
75
CRecastBuilder();
76
77
virtual
~CRecastBuilder();
78
79
bool
build(
CRecastMesh
* mesh,
CMesh
* output,
CObstacleAvoidance
* obstacle);
80
81
bool
load(
CEntityPrefab
* prefab,
const
core::matrix4
& transform,
CMesh
* output,
CObstacleAvoidance
* obstacle);
82
83
inline
const
SBuilderConfig
& getConfig()
84
{
85
return
m_config;
86
}
87
88
inline
void
setConfig(
const
SBuilderConfig
& config)
89
{
90
m_config = config;
91
}
92
93
protected
:
94
95
void
addMesh(
CMesh
* inputMesh,
const
core::matrix4
& transform,
CMesh
* output);
96
97
void
loadObstacle(
CMesh
* navMesh,
CObstacleAvoidance
* obstacle);
98
};
99
}
100
}
Skylicht::CEntityPrefab
This object class is created to store data in an array of multiple CEntities.
Definition
CEntityPrefab.h:38
Skylicht::CMesh
Definition
CMesh.h:75
Skylicht::Graph::CObstacleAvoidance
Definition
CObstacleAvoidance.h:38
Skylicht::Graph::CRecastMesh
Definition
CRecastMesh.h:35
Skylicht::Graph
Component that manages the navigation lifecycle, including NavMesh generation and pathfinding.
Definition
CGraphComponent.h:41
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
irr::core::matrix4
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition
matrix4.h:2241
Skylicht::Graph::SBuilderConfig
Definition
CRecastBuilder.h:36
Generated by
1.17.0