TreeSprite Class Reference

#include <TreeSprite.h>

Inheritance diagram for TreeSprite:

Inheritance graph
[legend]
Collaboration diagram for TreeSprite:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TreeSprite (float h, float w, float x, float y, float z, std::string texFile)
virtual void update ()
 Update this sprite's pysics and stuff.
virtual void paint ()
 Draw this sprite on screen.
virtual void handleCollision (Sprite *with)
virtual bool checkCollision (Sprite *with, bool fromSelf)
 Performe collision detection and handling between two sprites.
virtual bool notifyCollision (Sprite *sender)
 Notify an other sprite that we think we have collided with it.
void inflictDamage (DamageType dmg, float strength)
 Inflict damage on this sprite.

Public Attributes

float height
float width
float theta
float fi
float omega0
float fall_angle
TexID tex
bool fallen

Static Public Attributes

static GLfloat coordArray [40]
static GLuint indexArray [12]

Constructor & Destructor Documentation

TreeSprite::TreeSprite ( float  h,
float  w,
float  x,
float  y,
float  z,
std::string  texFile 
)


Member Function Documentation

virtual bool TreeSprite::checkCollision ( Sprite with,
bool  fromSelf 
) [virtual]

Performe collision detection and handling between two sprites.

Parameters:
with The sprite to performe collision detection with.
fromSelf set this to true when the collision check originates from one self, normally all external callers should leave this variable at the default (false) value.
Returns:
true if a collision was detected, false otherwise.

Reimplemented from Sprite.

virtual void TreeSprite::handleCollision ( Sprite with  )  [virtual]

void TreeSprite::inflictDamage ( DamageType  dmg,
float  strength 
) [virtual]

Inflict damage on this sprite.

By default sprites are immune to damage.

Parameters:
dmg the type of damage, different types of damages affect different sprites in different ways.
strength the amount of damage to deliver (values are usually in range 20-100 but can be anything)

Reimplemented from Sprite.

virtual bool TreeSprite::notifyCollision ( Sprite sender  )  [virtual]

Notify an other sprite that we think we have collided with it.

Parameters:
sender Pointer to the sprite that detected the collision.
Returns:
true if the receiving object accepts this as a collision, false otherwise.

Reimplemented from Sprite.

virtual void TreeSprite::paint (  )  [virtual]

Draw this sprite on screen.

The paint method is allowed to change the model-view matrix and any pushable attributes.

Implements Sprite.

virtual void TreeSprite::update (  )  [virtual]

Update this sprite's pysics and stuff.

Note that the update method should use the static dTime variable to check the time since last invokation. The caller is responsible for setting this variable to an apropriate value!

Implements Sprite.


Member Data Documentation

GLfloat TreeSprite::coordArray[40] [static]

float TreeSprite::fall_angle

bool TreeSprite::fallen

float TreeSprite::fi

float TreeSprite::height

GLuint TreeSprite::indexArray[12] [static]

float TreeSprite::omega0

TexID TreeSprite::tex

float TreeSprite::theta

float TreeSprite::width


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7