Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
WaypointGraph.cpp
Go to the documentation of this file.
1
2
4
6
7namespace Divide::Navigation {
8
9void WaypointGraph::addWaypoint(Waypoint* wp) {
10 if (_waypoints.find(wp->ID()) != std::end(_waypoints)) {
11 return;
12 }
13
14 insert(_waypoints, wp->ID(), wp);
16}
17
18void WaypointGraph::removeWaypoint(Waypoint* wp) {
19 if (_waypoints.find(wp->ID()) != std::end(_waypoints)) {
20 _waypoints.erase(wp->ID());
22 } else {
23 Console::printfn(LOCALE_STR("WARN_WAYPOINT_NOT_FOUND"), wp->ID(),
24 getID());
25 }
26}
27
28void WaypointGraph::updateGraph() {
32 for (auto& waypoint : _waypoints) {
33 _positions.push_back(waypoint.second->position());
34 _rotations.push_back(waypoint.second->orientation());
35 _times.push_back(waypoint.second->time());
36 }
37}
38
39} // namespace Divide::Navigation
#define LOCALE_STR(X)
Definition: Localization.h:91
vector< vec3< F32 > > _positions
Definition: WaypointGraph.h:62
vector< Quaternion< F32 > > _rotations
Definition: WaypointGraph.h:63
void insert(eastl::vector< T, A1 > &target, const eastl::vector< T, A2 > &source)
Definition: Vector.h:97
void efficient_clear(eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator > &fixed_vector)
Definition: Vector.h:52
static NO_INLINE void printfn(const char *format, T &&... args)
A point in space that AI units can navigate to.
Definition: Waypoint.h:42