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
TurretBarrel Class Reference

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

#include <TurretBarrel.h>

Inheritance diagram for TurretBarrel:
Inheritance graph
Collaboration diagram for TurretBarrel:
Collaboration graph

Public Member Functions

 TurretBarrel (Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale, std::shared_ptr< Ogre::SceneNode > turretNode, Ogre::Vector3 spawn)
 
 ~TurretBarrel ()
 
void setTarget (Ogre::Vector3 target)
 
void setUpActor (OgreApplication *application)
 
void updateActor (float dt)
 
void updateProjectiles (float dt, OgreApplication *application, std::shared_ptr< Helicopter > helicopter)
 
- 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 rotateTurretBarrel ()
 
Ogre::Vector3 workOutLaunchVector ()
 

Private Attributes

std::shared_ptr< Ogre::SceneNode > turretNode
 
Ogre::Real timeSinceLastProjectile
 
std::vector< std::shared_ptr
< Projectile > > 
projectile
 
Ogre::Real magnitude
 
Ogre::Vector3 target
 
Ogre::Vector3 lastTarget
 
Ogre::Vector3 spawn
 

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 TurretBarrel object that inherits GameActor.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

TurretBarrel::TurretBarrel ( Ogre::Vector3  position,
Ogre::Vector3  orientation,
Ogre::Real  scale,
std::shared_ptr< Ogre::SceneNode >  turretNode,
Ogre::Vector3  spawn 
)

Constructs the TurretBarrel object.

Parameters
Ogre::Vector3The position of the TurretBarrel.
Ogre::Vector3The orientation of the TurretBarrel.
Ogre::RealThe scale of the TurretBarrel.
std::shared_ptr<Ogre::SceneNode>A shared pointer to the Turret node.
Ogre::Vector3The world position of the projectile spawn.
TurretBarrel::~TurretBarrel ( )

Destructs the TurretBarrel object.

Member Function Documentation

void TurretBarrel::rotateTurretBarrel ( )
private

Rotates the TurretBarrel.

Here is the call graph for this function:

Here is the caller graph for this function:

void TurretBarrel::setTarget ( Ogre::Vector3  target)

Setter # Sets the target of the TurretBarrel.

Parameters
Ogre::Vector3The new target of the TurretBarrel.
void TurretBarrel::setUpActor ( OgreApplication application)
virtual

Sets up the actor for the TurretBarrel.

Parameters
OgreApplication* A pointer to the application.

Implements GameActor.

Here is the call graph for this function:

void TurretBarrel::updateActor ( float  dt)
virtual

Updates the TurretBarrel actor.

Parameters
floatThe delta time.

Implements GameActor.

Here is the call graph for this function:

void TurretBarrel::updateProjectiles ( float  dt,
OgreApplication application,
std::shared_ptr< Helicopter helicopter 
)

Updates the Projectiles.

Parameters
floatThe delta time.
OgreApplication* A pointer to the application.

Here is the call graph for this function:

Ogre::Vector3 TurretBarrel::workOutLaunchVector ( )
private

Work out the launch vector of the projectile.

Returns
Ogre::Vector3 The launch vector of the projectile.

Here is the caller graph for this function:

Member Data Documentation

Ogre::Vector3 TurretBarrel::lastTarget
private

The last target vector of the Projectile

Ogre::Real TurretBarrel::magnitude
private

Projectile magnitude

std::vector<std::shared_ptr<Projectile> > TurretBarrel::projectile
private

A vector of Projectiles.

Ogre::Vector3 TurretBarrel::spawn
private

The world position of the Projectile spawn

Ogre::Vector3 TurretBarrel::target
private

The target vector of the Projectile

Ogre::Real TurretBarrel::timeSinceLastProjectile
private

The amount of time it has been since the last projectile was fired.

std::shared_ptr<Ogre::SceneNode> TurretBarrel::turretNode
private

A pointer to the Turret node.


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