Jamie Slowgrove - OOT Assignment 1 - A Mission in Afghanistan
 All Classes Namespaces Files Functions Variables Macros
Helicopter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "stdafx.h"
4 #include <iostream>
5 #include <memory>
6 #include "OgreApplication.h"
7 #include "MyUtils.h"
8 #include "GameActor.h"
9 #include "Rotor.h"
10 
15 class Helicopter : public GameActor
16 {
17 private:
19  std::shared_ptr<Rotor> mainRotor;
21  std::shared_ptr<Rotor> sideRotor;
23  Ogre::Vector3 spawn;
25  Ogre::Vector3 direction;
27  Ogre::Vector3 speed;
29  Ogre::Real maxSpeed;
31  Ogre::Vector3 targetSpeedPercent;
33  bool up;
35  bool down;
37  bool left;
39  bool right;
41  bool forwards;
43  bool backwards;
45  int mouseX;
47  int mouseY;
49  int health;
50 
54  void updateSpeed();
55 
59  void rotateHelicopter();
60 
64  void updateMoveSpeed();
65 
66 public:
73  Helicopter(Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale);
74 
78  ~Helicopter();
79 
83  void takeDamage();
84 
88  void resetHelicopter();
89 
94  int getHealth();
95 
100  Ogre::Vector3 getSpeed();
101 
106  void setSpeed(Ogre::Vector3 speed);
107 
112  void setXSpeed(float xSpeed);
113 
118  void setYSpeed(float ySpeed);
119 
124  void setZSpeed(float zSpeed);
125 
130  Ogre::Vector3 getLastRotation();
131 
136  void setUpActor(OgreApplication* application);
137 
142  void handleInput(OIS::Keyboard* keyboard, OIS::Mouse* mouse);
143 
148  void updateActor(float dt);
149 };
std::shared_ptr< Rotor > sideRotor
Definition: Helicopter.h:21
int getHealth()
Definition: Helicopter.cpp:57
void setUpActor(OgreApplication *application)
Definition: Helicopter.cpp:111
bool forwards
Definition: Helicopter.h:41
Definition: OgreApplication.h:22
void updateActor(float dt)
Definition: Helicopter.cpp:215
Ogre::Real scale
Definition: GameActor.h:26
std::shared_ptr< Rotor > mainRotor
Definition: Helicopter.h:19
void handleInput(OIS::Keyboard *keyboard, OIS::Mouse *mouse)
Definition: Helicopter.cpp:149
Ogre::Vector3 getLastRotation()
A class for a Helicopter object that inherits GameActor.
Definition: Helicopter.h:15
void setZSpeed(float zSpeed)
Definition: Helicopter.cpp:102
bool up
Definition: Helicopter.h:33
Helicopter(Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale)
Definition: Helicopter.cpp:7
bool down
Definition: Helicopter.h:35
A class for a GameActor object.
Definition: GameActor.h:14
int mouseY
Definition: Helicopter.h:47
void updateSpeed()
Definition: Helicopter.cpp:251
Ogre::Vector3 getSpeed()
Definition: Helicopter.cpp:66
bool left
Definition: Helicopter.h:37
Ogre::Vector3 direction
Definition: Helicopter.h:25
void rotateHelicopter()
Definition: Helicopter.cpp:368
Ogre::Vector3 orientation
Definition: GameActor.h:24
void resetHelicopter()
Definition: Helicopter.cpp:46
void setXSpeed(float xSpeed)
Definition: Helicopter.cpp:84
Ogre::Vector3 position
Definition: GameActor.h:22
void setYSpeed(float ySpeed)
Definition: Helicopter.cpp:93
Ogre::Vector3 spawn
Definition: Helicopter.h:23
void takeDamage()
Definition: Helicopter.cpp:37
int health
Definition: Helicopter.h:49
int mouseX
Definition: Helicopter.h:45
Ogre::Vector3 targetSpeedPercent
Definition: Helicopter.h:31
~Helicopter()
Definition: Helicopter.cpp:30
void setSpeed(Ogre::Vector3 speed)
Definition: Helicopter.cpp:75
void updateMoveSpeed()
Definition: Helicopter.cpp:320
bool backwards
Definition: Helicopter.h:43
bool right
Definition: Helicopter.h:39
Ogre::Real maxSpeed
Definition: Helicopter.h:29
Ogre::Vector3 speed
Definition: Helicopter.h:27