-
Notifications
You must be signed in to change notification settings - Fork 0
/
vehicle.hpp
35 lines (30 loc) · 913 Bytes
/
vehicle.hpp
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
#ifndef VEHICLE_HPP_
#define VEHICLE_HPP_
#include "actiondata.hpp"
#include "model.hpp"
#include "borderlimits.hpp"
#include <unordered_map>
class Vehicle : public Model {
public:
float getSpeed();
float getRotationFactor(float deltaTime);
void update(float deltaTime);
void updateAction(Uint32 eventType, Action action);
void setBorderLimit(BorderLimits border, float location);
glm::vec3 getPosition();
glm::vec3 getForward();
private:
float m_speed{0.0f};
float m_rotationAngle{-90.0f};
float m_scaleFactor{0.55f};
const float m_baseSteeringAngle{50.0f};
const float m_maxSpeed{4.0f};
glm::vec3 m_forward{0.0f, 0.0f, -1.0f};
glm::vec3 m_position{0.0f, 0.0f, -0.5f};
std::unordered_map<BorderLimits, float> m_borderLimitsMap{};
ActionData m_actionData;
void updateDirection(float rotateFactor);
void updateSpeed(float deltaTime);
void updateOffLimits();
};
#endif