NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
NavAgent.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#include "
Engine/AI/Navigation/NavMeshFunnel.h
"
9
10
#include <cstddef>
11
12
#include <glm/glm.hpp>
13
14
namespace
NoJob
15
{
16
class
NavigationSystem
;
17
18
class
NavAgent
19
{
20
public
:
21
bool
SetDestination
(
22
const
NavigationSystem
& navigationSystem,
23
const
glm::vec3& currentPosition,
24
const
glm::vec3& destination);
25
26
bool
RecalculatePath
(
27
const
NavigationSystem
& navigationSystem,
28
const
glm::vec3& currentPosition);
29
30
glm::vec3
Update
(
31
const
glm::vec3& currentPosition,
32
float
deltaTime);
33
34
void
Stop
();
35
36
bool
HasPath
()
const
37
{
38
return
m_Path.IsValid() &&
39
m_CurrentWaypoint <
40
m_Path.Points.size();
41
}
42
43
bool
HasReachedDestination
()
const
44
{
45
return
m_ReachedDestination;
46
}
47
48
const
glm::vec3&
GetDestination
()
const
49
{
50
return
m_Destination;
51
}
52
53
const
NavPointPath
&
GetPath
()
const
54
{
55
return
m_Path;
56
}
57
58
std::size_t
GetCurrentWaypointIndex
()
const
59
{
60
return
m_CurrentWaypoint;
61
}
62
63
float
&
Speed
()
64
{
65
return
m_Speed;
66
}
67
68
float
Speed
()
const
69
{
70
return
m_Speed;
71
}
72
73
float
&
StoppingDistance
()
74
{
75
return
m_StoppingDistance;
76
}
77
78
float
StoppingDistance
()
const
79
{
80
return
m_StoppingDistance;
81
}
82
83
private
:
84
NavPointPath
m_Path;
85
86
glm::vec3 m_Destination{ 0.0f };
87
88
std::size_t m_CurrentWaypoint = 0;
89
90
float
m_Speed = 3.5f;
91
float
m_StoppingDistance = 0.1f;
92
93
bool
m_ReachedDestination =
true
;
94
};
95
}
NavMeshFunnel.h
NavMeshFunnel declarations for the Navigation subsystem.
NoJob::NavAgent
Definition
NavAgent.h:19
NoJob::NavAgent::HasReachedDestination
bool HasReachedDestination() const
Definition
NavAgent.h:43
NoJob::NavAgent::Speed
float Speed() const
Definition
NavAgent.h:68
NoJob::NavAgent::StoppingDistance
float StoppingDistance() const
Definition
NavAgent.h:78
NoJob::NavAgent::Update
glm::vec3 Update(const glm::vec3 ¤tPosition, float deltaTime)
Definition
NavAgent.cpp:60
NoJob::NavAgent::Stop
void Stop()
Definition
NavAgent.cpp:138
NoJob::NavAgent::GetDestination
const glm::vec3 & GetDestination() const
Definition
NavAgent.h:48
NoJob::NavAgent::GetCurrentWaypointIndex
std::size_t GetCurrentWaypointIndex() const
Definition
NavAgent.h:58
NoJob::NavAgent::Speed
float & Speed()
Definition
NavAgent.h:63
NoJob::NavAgent::SetDestination
bool SetDestination(const NavigationSystem &navigationSystem, const glm::vec3 ¤tPosition, const glm::vec3 &destination)
Definition
NavAgent.cpp:10
NoJob::NavAgent::RecalculatePath
bool RecalculatePath(const NavigationSystem &navigationSystem, const glm::vec3 ¤tPosition)
Definition
NavAgent.cpp:37
NoJob::NavAgent::StoppingDistance
float & StoppingDistance()
Definition
NavAgent.h:73
NoJob::NavAgent::HasPath
bool HasPath() const
Definition
NavAgent.h:36
NoJob::NavAgent::GetPath
const NavPointPath & GetPath() const
Definition
NavAgent.h:53
NoJob::NavigationSystem
Definition
NavigationSystem.h:20
NoJob
Definition
BTActionNode.h:13
NoJob::NavPointPath
Definition
NavMeshFunnel.h:18
Engine
AI
Navigation
NavAgent.h
Generated by
1.18.0