Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
ObstacleAvoidance
CObstacleAvoidance.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
namespace
Skylicht
28
{
29
namespace
Graph
30
{
31
struct
SObstacleCircle
32
{
33
core::vector3df Center;
34
float
Radius;
35
};
36
37
class
CObstacleAvoidance
38
{
39
protected
:
40
core::array<core::line3df> m_segments;
41
42
public
:
43
CObstacleAvoidance();
44
45
virtual
~CObstacleAvoidance();
46
47
void
addSegment(
const
core::vector3df& begin,
const
core::vector3df& end);
48
49
void
addSegments(
const
core::array<core::line3df>& segments);
50
51
void
clear();
52
53
void
copySegments(CObstacleAvoidance* toTarget,
const
core::aabbox3df& box);
54
55
inline
core::array<core::line3df>& getSegments()
56
{
57
return
m_segments;
58
}
59
60
inline
bool
empty()
61
{
62
return
m_segments.empty();
63
}
64
65
inline
bool
isLineHit(
const
core::line3df& line,
float
h,
float
& outT)
66
{
67
return
isLineHit(line.start, line.end, h, outT);
68
}
69
70
bool
isLineHit(
const
core::vector3df& a,
const
core::vector3df& b,
float
h,
float
& outT);
71
72
bool
isCircleHit(
const
core::vector3df& a,
float
radius,
float
h, core::array<core::line3df>& out,
float
& outR);
73
74
bool
isCircleHit(
const
core::vector3df& a,
float
radius,
float
h);
75
76
core::vector3df collide(
const
core::vector3df& position,
const
core::vector3df& vel,
float
radius = 0.0f,
float
stepHeight = 0.3f,
int
recursionDepth = 0);
77
};
78
}
79
}
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
Skylicht::Graph::SObstacleCircle
Definition
CObstacleAvoidance.h:32
Generated by
1.17.0