#include <TreeSprite.h>
Inheritance diagram for TreeSprite:
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] |
| TreeSprite::TreeSprite | ( | float | h, | |
| float | w, | |||
| float | x, | |||
| float | y, | |||
| float | z, | |||
| std::string | texFile | |||
| ) |
| virtual bool TreeSprite::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.
| 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.
| 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.
| sender | Pointer to the sprite that detected the collision. |
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.
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 |
| float TreeSprite::theta |
| float TreeSprite::width |
1.4.7