-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWaypointManager.h
53 lines (35 loc) · 1.36 KB
/
WaypointManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
struct ID3D11Device;
#include <d3d11_1.h> // this has the appropriate directx structures / objects
#include <DirectXCollision.h> // this is the dx collision class helper
using namespace DirectX; // this means you don't need to put DirectX:: in front of objects like XMVECTOR and so on.
#include <vector>
using namespace std;
class Waypoint;
#include "Vector2D.h"
#define WAYPOINT_RESOLUTION 20
typedef vector<Waypoint*> vecWaypoints;
typedef vector <BoundingBox> vecBoundingBox;
class WaypointManager
{
public:
WaypointManager() { m_numCheckpoints = 0; };
~WaypointManager();
HRESULT createWaypoints(ID3D11Device* pd3dDevice);
void destroyWaypoints();
Waypoint* getWaypoint(const unsigned int index);
size_t getWaypointCount() { return m_waypoints.size(); }
// get the points which make a building on the map
Waypoint* getQuadpoint(const unsigned int index);
size_t getQuadpointCount() { return m_quadpoints.size(); }
vecWaypoints getNeighbouringWaypoints(Waypoint* waypoint);
Waypoint* getNearestWaypoint(Vector2D position);
protected: // methods
// given two waypoints, if a line were to be drawn between them, would that cross a building?
bool doWaypointsCrossBuilding(Waypoint* wp1, Waypoint* wp2);
protected: // properties
vecWaypoints m_waypoints;
vecWaypoints m_quadpoints;
int m_numCheckpoints;
vecBoundingBox m_boundingBoxes;
};