Jamie Slowgrove - OOT Assignment 1 - A Mission in Afghanistan
 All Classes Namespaces Files Functions Variables Macros
TurretBarrel.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 "Projectile.h"
10 #include "Helicopter.h"
11 
16 class TurretBarrel : public GameActor
17 {
18 private:
20  std::shared_ptr<Ogre::SceneNode> turretNode;
24  std::vector<std::shared_ptr<Projectile>> projectile;
26  Ogre::Real magnitude;
28  Ogre::Vector3 target;
30  Ogre::Vector3 lastTarget;
32  Ogre::Vector3 spawn;
33 
37  void rotateTurretBarrel();
38 
43  Ogre::Vector3 workOutLaunchVector();
44 
45 public:
54  TurretBarrel(Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale,
55  std::shared_ptr<Ogre::SceneNode> turretNode, Ogre::Vector3 spawn);
56 
60  ~TurretBarrel();
61 
66  void setTarget(Ogre::Vector3 target);
67 
72  void setUpActor(OgreApplication* application);
73 
78  void updateActor(float dt);
79 
85  void updateProjectiles(float dt, OgreApplication* application, std::shared_ptr<Helicopter> helicopter);
86 };
void rotateTurretBarrel()
Definition: TurretBarrel.cpp:42
void setUpActor(OgreApplication *application)
Definition: TurretBarrel.cpp:55
Definition: OgreApplication.h:22
Ogre::Real scale
Definition: GameActor.h:26
std::vector< std::shared_ptr< Projectile > > projectile
Definition: TurretBarrel.h:24
~TurretBarrel()
Definition: TurretBarrel.cpp:25
A class for a GameActor object.
Definition: GameActor.h:14
Ogre::Vector3 workOutLaunchVector()
Definition: TurretBarrel.cpp:144
Ogre::Vector3 orientation
Definition: GameActor.h:24
Ogre::Real magnitude
Definition: TurretBarrel.h:26
TurretBarrel(Ogre::Vector3 position, Ogre::Vector3 orientation, Ogre::Real scale, std::shared_ptr< Ogre::SceneNode > turretNode, Ogre::Vector3 spawn)
Definition: TurretBarrel.cpp:7
std::shared_ptr< Ogre::SceneNode > turretNode
Definition: TurretBarrel.h:20
Ogre::Vector3 position
Definition: GameActor.h:22
void setTarget(Ogre::Vector3 target)
Definition: TurretBarrel.cpp:32
Ogre::Vector3 spawn
Definition: TurretBarrel.h:32
void updateProjectiles(float dt, OgreApplication *application, std::shared_ptr< Helicopter > helicopter)
Definition: TurretBarrel.cpp:87
void updateActor(float dt)
Definition: TurretBarrel.cpp:78
Ogre::Vector3 lastTarget
Definition: TurretBarrel.h:30
Ogre::Vector3 target
Definition: TurretBarrel.h:28
A class for a TurretBarrel object that inherits GameActor.
Definition: TurretBarrel.h:16
Ogre::Real timeSinceLastProjectile
Definition: TurretBarrel.h:22