forked from GokuMK/TSRE5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eng.h
117 lines (106 loc) · 2.81 KB
/
Eng.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* This file is part of TSRE5.
*
* TSRE5 - train sim game engine and MSTS/OR Editors.
* Copyright (C) 2016 Piotr Gadecki <[email protected]>
*
* Licensed under GNU General Public License 3.0 or later.
*
* See LICENSE.md or https://www.gnu.org/licenses/gpl.html
*/
#ifndef ENG_H
#define ENG_H
#include <QString>
#include <QVector>
#include <QHash>
class OglObj;
class GLUU;
class Ruch;
class SoundVariables;
class TrainNetworkEng;
class Eng {
public:
struct Coupling {
QString type;
float r0[2];
float velocity;
};
struct EngShape {
QString name;
float x = 0;
float y = 0;
float z = 0;
QHash<long long int, int> id;// = -2;
};
QVector<Coupling> coupling;
QString name;
QString path;
QString pathid;
QString orpathid;
QString orpath;
QVector<QString> filePaths;
EngShape shape;
QVector<EngShape> freightanimShape;
QString engName;
QString displayName;
QString searchKeywords;
QString engType;
QString typeHash;
QString type;
QString brakeSystemType;
int wagonTypeId = 0;
float mass;
float sizex;
float sizey;
float sizez;
float maxSpeed = 0;
float maxForce = 0;
float maxPower = 0;
float maxCurrent = 0;
QString souncCabFile;
int flip = flip;
int loaded = -1;
bool kierunek = false;
int ref = 0;
Eng();
Eng(Eng *o);
virtual ~Eng();
Eng(QString p, QString n);
Eng(QString src, QString p, QString n);
void load();
float getFullWidth();
QString getCouplingsName();
void select();
void unselect();
bool isSelected();
void drawBorder();
void drawBorder3d();
bool engFilter(QString q);
bool couplingFilter(QString q);
bool searchFilter(QString q);
void initOnTrack(float *tpos, int direction, QMap<int, int>* junctionDirections);
void getCameraPosition(float *out = NULL);
void renderOnTrack(GLUU* gluu, float* playerT, int selectionColor);
void move(float m);
float getCurrentElevation();
float getTotalDistanceDownPath();
void reload();
bool isBroken();
void updateSim(float deltaTime);
float getCurrentSpeed();
void render(int selectionColor = 0);
void render(int aktwx, int aktwz, int selectionColor);
float *getCurrentPositionOnTrack();
private:
bool selected = false;
OglObj *borderObj = NULL;
OglObj *borderObj3d = NULL;
OglObj *ruchPoint = NULL;
Ruch *ruch1 = NULL;
Ruch *ruch2 = NULL;
void addToFileList(QString val);
int camSoundSourceId = -1;
SoundVariables* soundVariables = NULL;
float currentSpeed = 0;
TrainNetworkEng* networkEng = NULL;
};
#endif /* ENG_H */