Jamie Slowgrove - OOT Assignment 1 - A Mission in Afghanistan
|
A class for a TurretBarrel object that inherits GameActor. More...
#include <TurretBarrel.h>
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 |
A class for a TurretBarrel object that inherits GameActor.
TurretBarrel::TurretBarrel | ( | Ogre::Vector3 | position, |
Ogre::Vector3 | orientation, | ||
Ogre::Real | scale, | ||
std::shared_ptr< Ogre::SceneNode > | turretNode, | ||
Ogre::Vector3 | spawn | ||
) |
Constructs the TurretBarrel object.
Ogre::Vector3 | The position of the TurretBarrel. |
Ogre::Vector3 | The orientation of the TurretBarrel. |
Ogre::Real | The scale of the TurretBarrel. |
std::shared_ptr<Ogre::SceneNode> | A shared pointer to the Turret node. |
Ogre::Vector3 | The world position of the projectile spawn. |
TurretBarrel::~TurretBarrel | ( | ) |
Destructs the TurretBarrel object.
|
private |
Rotates the TurretBarrel.
void TurretBarrel::setTarget | ( | Ogre::Vector3 | target | ) |
Setter # Sets the target of the TurretBarrel.
Ogre::Vector3 | The new target of the TurretBarrel. |
|
virtual |
Sets up the actor for the TurretBarrel.
OgreApplication | * A pointer to the application. |
Implements GameActor.
|
virtual |
Updates the TurretBarrel actor.
float | The delta time. |
Implements GameActor.
void TurretBarrel::updateProjectiles | ( | float | dt, |
OgreApplication * | application, | ||
std::shared_ptr< Helicopter > | helicopter | ||
) |
Updates the Projectiles.
float | The delta time. |
OgreApplication | * A pointer to the application. |
|
private |
Work out the launch vector of the projectile.
|
private |
The last target vector of the Projectile
|
private |
Projectile magnitude
|
private |
A vector of Projectiles.
|
private |
The world position of the Projectile spawn
|
private |
The target vector of the Projectile
|
private |
The amount of time it has been since the last projectile was fired.
|
private |
A pointer to the Turret node.