-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
74 lines (61 loc) · 2 KB
/
Player.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
#pragma once
#include <string>
#include <vector>
#include <SFML\System.hpp>
#include <Bullet\btBulletDynamicsCommon.h>
#include <glm\vec3.hpp>
#include "Config\KeyBindingConfig.h"
#include "Data\UserPhysics.h"
#include "Managers\RegionManager.h"
#include "Managers\ModelManager.h"
#include "Utils\TypedCallback.h"
#include "Weapons\GravityWeapon.h"
#include "Weapons\PressureWeapon.h"
#include "Weapons\RockWeapon.h"
#include "Weapons\SunbeamWeapon.h"
#include "Weapons\WeaponBase.h"
#include "Physics.h"
#include "Camera.h"
class Player : public ICallback<UserPhysics::ObjectType>
{
// TODO configurable
const float SpeedLimit = 20.0f;
const float RoadSpeedLimit = 200.0f;
// Where the viewer is currently oriented on-screen.
Camera camera;
Model model;
// Used for view rotation.
glm::ivec2 lastMousePos;
enum MotionType
{
ON_FOOT,
MOTORCYCLE,
DRONES
};
MotionType motionType;
bool isOnGround;
int enemyKos;
int civilianKos;
int allyKos;
GravityWeapon gravityWeapon;
PressureWeapon pressureWeapon;
RockWeapon rockWeapon;
SunbeamWeapon sunbeamWeapon;
WeaponBase* selectedWeapon;
std::vector<std::string> inventory;
public:
Player(ModelManager* modelManager, Physics* physics);
bool LoadPlayerModel(ModelManager* modelManager);
void LoadPlayerPhysics(Physics* physics, glm::vec3 startingPosition, float mass);
void Update(float frameTime, int terrainTypeOn);
void Render(ModelManager* modelManager, const glm::mat4& projectionMatrix);
const glm::vec2 GetTerrainPosition() const;
const glm::vec3 GetPosition() const;
const glm::quat GetOrientation() const;
const glm::vec2 Get2DOrientation() const;
const glm::quat GetViewOrientation() const;
const glm::mat4 GetViewMatrix() const;
void UnloadPlayerPhysics(Physics* physics);
// Used for collision callbacks.
virtual void Callback(UserPhysics::ObjectType callingObject, void* callbackSpecificData) override;
};