GroundVehicleSprite Class Reference

#include <GroundVehicleSprite.h>

Inheritance diagram for GroundVehicleSprite:

Inheritance graph
[legend]
Collaboration diagram for GroundVehicleSprite:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GroundVehicleSprite (int owner, std::string type)
void setAccelerate (bool b)
void setSlowDown (bool b)
void setTurnLeft (bool b)
void setTurnRight (bool b)
void paint ()
 Draw this sprite on screen.
void findNormal (float *ret_norm)
bool checkCollision (Sprite *with, bool fromSelf)
 Performe collision detection and handling between two sprites.
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.
void handleCollision (Sprite *with)
bool updateHealth ()
 returns true if dead
void updatePosition ()
void updateNormal ()

Public Attributes

bool accel
 should we accelerate on next update?
bool slowDown
 should we slow down on next update?
bool left
 should we turn left on next update?
bool right
 should we turn right on next update?
float speed
 current speed
bool dead

Protected Attributes

TexID tex
 texture id
float length
float width
float normal [3]
FireSpritefireSprite

Constructor & Destructor Documentation

GroundVehicleSprite::GroundVehicleSprite ( int  owner,
std::string  type 
)


Member Function Documentation

bool GroundVehicleSprite::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.

void GroundVehicleSprite::findNormal ( float *  ret_norm  ) 

void GroundVehicleSprite::handleCollision ( Sprite with  ) 

void GroundVehicleSprite::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.

bool GroundVehicleSprite::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.

void GroundVehicleSprite::paint (  )  [virtual]

Draw this sprite on screen.

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

Implements Sprite.

void GroundVehicleSprite::setAccelerate ( bool  b  )  [virtual]

Implements VehicleSprite.

void GroundVehicleSprite::setSlowDown ( bool  b  )  [virtual]

Implements VehicleSprite.

void GroundVehicleSprite::setTurnLeft ( bool  b  )  [virtual]

Implements VehicleSprite.

void GroundVehicleSprite::setTurnRight ( bool  b  )  [virtual]

Implements VehicleSprite.

bool GroundVehicleSprite::updateHealth (  ) 

returns true if dead

void GroundVehicleSprite::updateNormal (  ) 

void GroundVehicleSprite::updatePosition (  ) 


Member Data Documentation

bool GroundVehicleSprite::accel

should we accelerate on next update?

bool GroundVehicleSprite::dead

FireSprite* GroundVehicleSprite::fireSprite [protected]

bool GroundVehicleSprite::left

should we turn left on next update?

float GroundVehicleSprite::length [protected]

float GroundVehicleSprite::normal[3] [protected]

bool GroundVehicleSprite::right

should we turn right on next update?

bool GroundVehicleSprite::slowDown

should we slow down on next update?

float GroundVehicleSprite::speed

current speed

TexID GroundVehicleSprite::tex [protected]

texture id

float GroundVehicleSprite::width [protected]


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