ComputerGraphik TU WIEN
Classes | Public Member Functions | Private Attributes | List of all members
Tank Class Reference

Implements the tank functionalities. More...

#include <tank.hpp>

Inheritance diagram for Tank:
SceneObject

Classes

class  Gun
 
class  Turret
 

Public Member Functions

 Tank (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 
virtual ~Tank ()
 
void reset ()
 
bool animate (double time)
 
void update (double deltaT)
 
double getHP () const
 
void setHP (double val)
 
bool getActive () const
 
void setActive (bool val)
 
glm::mat4 getShootOrigin () const
 
- Public Member Functions inherited from SceneObject
 SceneObject (std::shared_ptr< SceneObject > &effectParent, const glm::mat4 &modelMatrix=glm::mat4(1))
 
 SceneObject (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 
virtual ~SceneObject ()
 
ModelgetModel () const
 
ShadergetShader () const
 
glm::mat4 getModelMatrix () const
 
glm::mat4 getGlobalModelMatrix () const
 
std::string getName () const
 
std::shared_ptr< SceneObjectgetParent () const
 
void setAnimationTime (double time)
 
bool setAnimation (const Animation &anim)
 
bool delChild (size_t idx)
 
bool getChild (size_t idx, std::shared_ptr< SceneObject > &child) const
 
bool addChild (std::shared_ptr< SceneObject > &child)
 
bool remEffect (const std::string &name)
 
SceneObjectgetEffect (const std::string &name) const
 
bool addEffect (const std::string &name, std::unique_ptr< SceneObject > &effect)
 
bool doNotRender ()
 
bool getIsVolSun ()
 
virtual void draw () const
 
virtual void setShader (Shader *val)
 

Private Attributes

double hp
 
bool active
 
double lastCPU
 
double lastGPU
 
std::shared_ptr< SceneObjectgun
 
std::shared_ptr< SceneObjectturret
 
std::shared_ptr< SceneObjecttrackL
 
std::shared_ptr< SceneObjecttrackR
 
std::shared_ptr< SceneObjectshootOrigin
 
std::shared_ptr< GameLogicgameLogic
 
std::shared_ptr< ParticleSystemCPUpsCPU
 
std::shared_ptr< ParticleSystemGPUpsGPU
 

Additional Inherited Members

- Public Types inherited from SceneObject
typedef std::vector< std::pair< double, glm::mat4 > > Animation
 
- Protected Attributes inherited from SceneObject
GLuint vao
 
Scenescene
 
Modelmodel
 
Shadershader
 
glm::mat4 modelMatrix
 
std::string name
 
std::weak_ptr< SceneObjectparent
 
std::vector< std::shared_ptr< SceneObject > > childs
 
std::map< std::string, std::unique_ptr< SceneObject > > effectChilds
 
size_t animIDX
 
Animation animation
 
bool norender
 
bool isVolSun
 

Detailed Description

Implements the tank functionalities.

The Tank class

Author
Adam

Constructor & Destructor Documentation

Tank::Tank ( const std::string &  name,
Scene scene = 0,
Model model = 0,
const glm::mat4 &  modelMatrix = glm::mat4(1) 
)
Tank::~Tank ( )
virtual

Member Function Documentation

bool Tank::animate ( double  time)
virtual

Reimplemented from SceneObject.

bool Tank::getActive ( ) const
inline
double Tank::getHP ( ) const
inline
glm::mat4 Tank::getShootOrigin ( ) const
void Tank::reset ( )
virtual
Todo:
getObject should be improved to start from this node

Reimplemented from SceneObject.

void Tank::setActive ( bool  val)
inline
void Tank::setHP ( double  val)
inline
void Tank::update ( double  deltaT)
virtual

Reimplemented from SceneObject.

Member Data Documentation

bool Tank::active
private
std::shared_ptr<GameLogic> Tank::gameLogic
private
std::shared_ptr<SceneObject> Tank::gun
private
double Tank::hp
private
double Tank::lastCPU
private
double Tank::lastGPU
private
std::shared_ptr<ParticleSystemCPU> Tank::psCPU
private
std::shared_ptr<ParticleSystemGPU> Tank::psGPU
private
std::shared_ptr<SceneObject> Tank::shootOrigin
private
std::shared_ptr<SceneObject> Tank::trackL
private
std::shared_ptr<SceneObject> Tank::trackR
private
std::shared_ptr<SceneObject> Tank::turret
private

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