#include <ExplosionSprite.h>
Inheritance diagram for ExplosionSprite:
Public Member Functions | |
| ExplosionSprite (float size=1.0, float strength=50.0, float time=1.0) | |
| Create a new explosion. | |
| virtual | ~ExplosionSprite () |
| Delete this sprite but do not remove it from any lists. | |
| virtual void | paint () |
| Draw this sprite on screen. | |
| virtual void | update () |
| Update this sprite's pysics and stuff. | |
| virtual bool | checkCollision (Sprite *with, bool fromSelf=false) |
| 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. | |
| Packet | packObject () const |
| Create a network packet representing vital data about this Sprite. | |
| void | setObject (Packet &p) |
| Set this object's data to that represented by the packet p. | |
Protected Attributes | |
| float | endSize |
| GLfloat | scale |
| GLfloat | time |
| Current "time". | |
| GLfloat | r |
| GLfloat | g |
| GLfloat | b |
| GLfloat | alpha |
| GLuint | dlist |
| float | pow |
| char | texRsrcKey [32] |
| std::set< Sprite * > | m_hurt |
Static Protected Attributes | |
| static TexID | texture |
This sprite can inflict damage to others within its collision range.
| ExplosionSprite::ExplosionSprite | ( | float | size = 1.0, |
|
| float | strength = 50.0, |
|||
| float | time = 1.0 | |||
| ) |
Create a new explosion.
After the explosion is created its location must be set by modifying the pos parameter. The sprite automatically adds itself to the space org, the g.transparentSprites and the g.updateTransSprites lists.
| size | The size (radius) of the explosion | |
| strength | How much damage the explosion can cause. | |
| time | How long time will the explosion last. |
| virtual ExplosionSprite::~ExplosionSprite | ( | ) | [virtual] |
Delete this sprite but do not remove it from any lists.
| virtual bool ExplosionSprite::checkCollision | ( | Sprite * | with, | |
| bool | fromSelf = false | |||
| ) | [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.
| virtual bool ExplosionSprite::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.
| Packet ExplosionSprite::packObject | ( | ) | const [virtual] |
| virtual void ExplosionSprite::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 ExplosionSprite::setObject | ( | Packet & | p | ) | [virtual] |
Set this object's data to that represented by the packet p.
The default implementation unpacks a packet created by the default impl. of packObject().
Reimplemented from Sprite.
| virtual void ExplosionSprite::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.
GLfloat ExplosionSprite::alpha [protected] |
GLfloat ExplosionSprite::b [protected] |
GLuint ExplosionSprite::dlist [protected] |
float ExplosionSprite::endSize [protected] |
GLfloat ExplosionSprite::g [protected] |
std::set<Sprite*> ExplosionSprite::m_hurt [protected] |
float ExplosionSprite::pow [protected] |
GLfloat ExplosionSprite::r [protected] |
GLfloat ExplosionSprite::scale [protected] |
char ExplosionSprite::texRsrcKey[32] [protected] |
TexID ExplosionSprite::texture [static, protected] |
GLfloat ExplosionSprite::time [protected] |
1.4.7