Tramway SDK
path.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_FRAMEWORK_PATH_H
5#define TRAM_SDK_FRAMEWORK_PATH_H
6
7#include <framework/graph.h>
8
9#include <framework/uid.h>
10
11namespace tram {
12
17
20};
21
24};
25
26class PathFollower;
27
28class Path : public Graph {
29public:
31
32 void LoadFromDisk();
33
34 void Draw();
35
36 static Path* Find(name_t name);
37protected:
38 ~Path() = delete;
39
40 friend class PathFollower;
41
43 std::vector<PathEdgeInfo> edge_infos;
44};
45
47public:
48 PathFollower(Path* path, vec3 initial_pos, PathType type);
49
50 void Advance(float);
51
52 void Project(vec3);
53
54 void TurnLeft();
55 void TurnRight();
56 void TurnStraight();
57
60
61 void SetOrientation(vec3);
62
63 float progress;
64 uint32_t prev;
65 uint32_t next;
69};
70
71}
72
73#endif // TRAM_SDK_FRAMEWORK_PATH_H
Definition: graph.h:22
Definition: path.h:46
void Advance(float)
Definition: path.cpp:101
void TurnRight()
Definition: path.cpp:192
PathFollower(Path *path, vec3 initial_pos, PathType type)
Definition: path.cpp:90
uint32_t next
Definition: path.h:65
vec3 GetPosition()
Definition: path.cpp:179
PathType direction
Definition: path.h:67
vec3 GetTangent()
Definition: path.cpp:185
void SetOrientation(vec3)
Definition: path.cpp:169
uint32_t prev
Definition: path.h:64
PathType type
Definition: path.h:66
void Project(vec3)
Definition: path.cpp:147
float progress
Definition: path.h:63
void TurnStraight()
Definition: path.cpp:195
Path * path
Definition: path.h:68
Definition: path.h:28
void LoadFromDisk()
Definition: path.cpp:33
~Path()=delete
std::vector< PathEdgeInfo > edge_infos
Definition: path.h:43
name_t name
Definition: path.h:42
Path(name_t name)
Definition: path.h:30
void Draw()
Definition: path.cpp:81
static Path * Find(name_t name)
Definition: path.cpp:22
Definition: api.h:9
glm::vec3 vec3
Definition: math.h:12
PathType
Definition: path.h:13
@ PATH_RIGHT
Definition: path.h:16
@ PATH_STRAIGHT
Definition: path.h:14
@ PATH_CURVE
Definition: path.h:19
@ PATH_LEFT
Definition: path.h:15
@ PATH_LINEAR
Definition: path.h:18
Definition: path.h:22
PathType type
Definition: path.h:23
Definition: uid.h:11