Jamie Slowgrove - OOT Assignment 1 - A Mission in Afghanistan
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Helicopter Class Reference

A class for a Helicopter object that inherits GameActor. More...

#include <Helicopter.h>

Inheritance diagram for Helicopter:
Inheritance graph
Collaboration diagram for Helicopter:
Collaboration graph

Public Member Functions

 Helicopter (Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale)
 
 ~Helicopter ()
 
void takeDamage ()
 
void resetHelicopter ()
 
int getHealth ()
 
Ogre::Vector3 getSpeed ()
 
void setSpeed (Ogre::Vector3 speed)
 
void setXSpeed (float xSpeed)
 
void setYSpeed (float ySpeed)
 
void setZSpeed (float zSpeed)
 
Ogre::Vector3 getLastRotation ()
 
void setUpActor (OgreApplication *application)
 
void handleInput (OIS::Keyboard *keyboard, OIS::Mouse *mouse)
 
void updateActor (float dt)
 
- Public Member Functions inherited from GameActor
 GameActor (Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale)
 
virtual ~GameActor ()
 
std::shared_ptr< Ogre::SceneNode > getActorNode ()
 
std::string getActorID ()
 
Ogre::Vector3 getPosition ()
 
void setPosition (Ogre::Vector3 position)
 
void setX (float x)
 
void setY (float y)
 
void setZ (float z)
 
Ogre::Vector3 getOrientation ()
 
void setOrientation (Ogre::Vector3 orientation)
 
void setXOrientation (float xOrientation)
 
void setYOrientation (float yOrientation)
 
void setZOrientation (float zOrientation)
 
Ogre::Real getScale ()
 
void setScale (Ogre::Real scale)
 
void changePosition (Ogre::Vector3 position)
 

Private Member Functions

void updateSpeed ()
 
void rotateHelicopter ()
 
void updateMoveSpeed ()
 

Private Attributes

std::shared_ptr< RotormainRotor
 
std::shared_ptr< RotorsideRotor
 
Ogre::Vector3 spawn
 
Ogre::Vector3 direction
 
Ogre::Vector3 speed
 
Ogre::Real maxSpeed
 
Ogre::Vector3 targetSpeedPercent
 
bool up
 
bool down
 
bool left
 
bool right
 
bool forwards
 
bool backwards
 
int mouseX
 
int mouseY
 
int health
 

Additional Inherited Members

- Protected Attributes inherited from GameActor
std::shared_ptr< Ogre::SceneNode > gameActorNode
 
Ogre::Vector3 position
 
Ogre::Vector3 orientation
 
Ogre::Real scale
 
unsigned int actorID
 
- Static Protected Attributes inherited from GameActor
static unsigned int actorIDGenerator = 0
 

Detailed Description

A class for a Helicopter object that inherits GameActor.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

Helicopter::Helicopter ( Ogre::Vector3  position,
Ogre::Vector3  orientation,
Ogre::Real  scale 
)

Constructs the Helicopter object.

Parameters
Ogre::Vector3The position of the Helicopter.
Ogre::Vector3The orientation of the Helicopter.
Ogre::RealThe scale of the Helicopter.
Helicopter::~Helicopter ( )

Destructs the Helicopter object.

Member Function Documentation

int Helicopter::getHealth ( )

Getter # Gets the health of the Helicopter.

Returns
int The health of the Helicopter.
Ogre::Vector3 Helicopter::getLastRotation ( )

Getter # Gets the last rotation of the Helicopter.

Returns
Ogre::Vector3 The last rotate of the Helicopter.
Ogre::Vector3 Helicopter::getSpeed ( )

Getter # Gets the speed of the Helicopter.

Returns
Ogre::Vector3 The speed of the Helicopter.
void Helicopter::handleInput ( OIS::Keyboard *  keyboard,
OIS::Mouse *  mouse 
)

Handles the user input.

Parameters
OIS::Keyboard*A pointer to the keyboard.
void Helicopter::resetHelicopter ( )

Resets the Helicopter to it's initial values.

Here is the call graph for this function:

void Helicopter::rotateHelicopter ( )
private

Rotates the helicopter using the user commands.

Here is the caller graph for this function:

void Helicopter::setSpeed ( Ogre::Vector3  speed)

Setter # Sets the speed of the Helicopter.

Parameters
Ogre::Vector3The new speed of the Helicopter.
void Helicopter::setUpActor ( OgreApplication application)
virtual

Sets up the actor for the Helicopter.

Parameters
OgreApplicationA pointer to the application.

Implements GameActor.

Here is the call graph for this function:

void Helicopter::setXSpeed ( float  xSpeed)

Setter # Sets the x speed of the Helicopter.

Parameters
floatThe new x speed of the Helicopter.
void Helicopter::setYSpeed ( float  ySpeed)

Setter # Sets the y speed of the Helicopter.

Parameters
floatThe new y speed of the Helicopter.
void Helicopter::setZSpeed ( float  zSpeed)

Setter # Sets the z speed of the Helicopter.

Parameters
floatThe new z speed of the Helicopter.
void Helicopter::takeDamage ( )

Decrease the health of the Helicopter by 1.

void Helicopter::updateActor ( float  dt)
virtual

Updates the Helicopter actor.

Parameters
floatThe delta time.

Implements GameActor.

Here is the call graph for this function:

void Helicopter::updateMoveSpeed ( )
private

Updates the move speed of the Helicopter.

Here is the caller graph for this function:

void Helicopter::updateSpeed ( )
private

Updates the speeds of the helicopter using the user commands.

Here is the caller graph for this function:

Member Data Documentation

bool Helicopter::backwards
private

A bool for if the Helicopter should move backwards

Ogre::Vector3 Helicopter::direction
private

The initial direction of the Helicopter.

bool Helicopter::down
private

A bool for if the Helicopter should move down

bool Helicopter::forwards
private

A bool for if the Helicopter should move forwards

int Helicopter::health
private

The health of the helicopter

bool Helicopter::left
private

A bool for if the Helicopter should move left

std::shared_ptr<Rotor> Helicopter::mainRotor
private

A pointer to the main rotor of the Helicopter.

Ogre::Real Helicopter::maxSpeed
private

The max speed of the Helicopter.

int Helicopter::mouseX
private

The x mouse position

int Helicopter::mouseY
private

The y mouse position

bool Helicopter::right
private

A bool for if the Helicopter should move right

std::shared_ptr<Rotor> Helicopter::sideRotor
private

A pointer to the side rotor of the Helicopter.

Ogre::Vector3 Helicopter::spawn
private

The spawn of the Helicopter.

Ogre::Vector3 Helicopter::speed
private

The speed of the Helicopter.

Ogre::Vector3 Helicopter::targetSpeedPercent
private

The percentage speed of the max speed that the Helicopter will target

bool Helicopter::up
private

A bool for if the Helicopter should move up


The documentation for this class was generated from the following files: