-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
63 lines (48 loc) · 1.49 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
#pragma once
#define _PI 3.14159
#include "GameEntity.h"
#include "OGRE/OgreMath.h"
#include "OIS/OIS.h"
class Player : public GameEntity
{
public:
Player(Ogre::SceneManager*, Ogre::SceneNode*);
~Player();
void update(Ogre::Real& deltaTime);
void fireLaser(const Ogre::Real& deltaTime);
virtual void onCollide(GameEntity* otherEnt, Ogre::String tag);
Ogre::MovableObject* otherMovEnt;
Ogre::Vector3 aimLocation;
std::vector<GameEntity*> *otherEntities;
Ogre::SceneNode* getFPCameraNode();
Ogre::SceneNode* getTPCameraNode();
// Movement instructions
int YawDir;
int PitchDir;
int RollDir;
int LiftDir;
// Health
int hp;
private:
// Movement vectors
Ogre::Vector3 velocity;
Ogre::Real acceleration;
Ogre::Real rotAcceleration;
Ogre::Quaternion orientationQ;
// Movement binding values
Ogre::Radian maxPitch = Ogre::Radian(Ogre::Real(_PI / 8.0));
Ogre::Radian minPitch = Ogre::Radian(Ogre::Real(-_PI / 4.0));
Ogre::Radian maxRoll = Ogre::Radian(Ogre::Real(_PI / 2.1));
Ogre::Radian minRoll = Ogre::Radian(Ogre::Real(-_PI / 2.1));
Ogre::Real maxLift = Ogre::Real(10.0);
Ogre::Real minLift = Ogre::Real(-10.0);
// Scene nodes for sub-objects
Ogre::SceneNode* FPcameraNode;
Ogre::SceneNode* TPcameraNode;
enum CameraMode { FirstPerson, ThirdPerson, COUNT }; // This is bad design
CameraMode curCamMode;
Ogre::SceneNode* mainRotor;
Ogre::SceneNode* rearRotor;
Ogre::SceneNode* minigunNode;
Ogre::Real minigunRotation;
};