#include <GroundVehicleSprite.h>
Inheritance diagram for GroundVehicleSprite:
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] |
| FireSprite * | fireSprite |
| GroundVehicleSprite::GroundVehicleSprite | ( | int | owner, | |
| std::string | type | |||
| ) |
| bool GroundVehicleSprite::checkCollision | ( | Sprite * | with, | |
| bool | fromSelf | |||
| ) | [virtual] |
Performe collision detection and handling between two sprites.
| 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. |
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.
| 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.
| sender | Pointer to the sprite that detected the collision. |
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 | ( | ) |
should we accelerate on next update?
FireSprite* GroundVehicleSprite::fireSprite [protected] |
should we turn left on next update?
float GroundVehicleSprite::length [protected] |
float GroundVehicleSprite::normal[3] [protected] |
should we turn right on next update?
should we slow down on next update?
current speed
TexID GroundVehicleSprite::tex [protected] |
texture id
float GroundVehicleSprite::width [protected] |
1.4.7