#include <ShellSprite.h>
Inheritance diagram for ShellSprite:
Public Member Functions | |
| ShellSprite () | |
| Create a invisible, inactive ShellSprite at an undefined location. | |
| ShellSprite (float pos[], float vel[], float rot[], bool dummy=false) | |
| Create a ShellSprite at with a specified pose and a specified velocity. | |
| virtual void | update () |
| Update this sprite's pysics and stuff. | |
| virtual void | paint () |
| Draw this sprite on screen. | |
| virtual bool | notifyCollision (Sprite *sender) |
| Notify an other sprite that we think we have collided with it. | |
| virtual bool | checkCollision (Sprite *with, bool fromSelf=false) |
| Performe collision detection and handling between two sprites. | |
| virtual void | getCollisionPoint (float where[3]) |
| Compute where this Shell would collide. | |
| virtual Packet | packObject () const |
| Create a network packet representing vital data about this Sprite. | |
| virtual void | setObject (Packet &p) |
| Set this object's data to that represented by the packet p. | |
Protected Member Functions | |
| template<bool forReal> | |
| bool | execUpdate (float dt) |
| Update this shell objects physics. | |
| virtual void | explode () |
Static Protected Member Functions | |
| static void | Init () |
Private Attributes | |
| std::list< float > | trajectory |
| bool | canExplode |
Static Private Attributes | |
| static bool | initialized |
| static Model * | m |
| ShellSprite::ShellSprite | ( | ) | [inline] |
Create a invisible, inactive ShellSprite at an undefined location.
| ShellSprite::ShellSprite | ( | float | pos[], | |
| float | vel[], | |||
| float | rot[], | |||
| bool | dummy = false | |||
| ) |
Create a ShellSprite at with a specified pose and a specified velocity.
| pos | Where in the world the shell's origo should be. | |
| vel | The velocity the shell should have. | |
| rot | The rotation of the shell. |
| virtual bool ShellSprite::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.
| bool ShellSprite::execUpdate | ( | float | dt | ) | [protected] |
Update this shell objects physics.
If forReal i true the update is "sticky" otherwise it is only a simulation and can not affect anything or explode etc.
| dt | Timestep to use for update. |
| virtual void ShellSprite::explode | ( | ) | [protected, virtual] |
| virtual void ShellSprite::getCollisionPoint | ( | float | where[3] | ) | [virtual] |
Compute where this Shell would collide.
The function considers the world to be static and it does not modify the Shell.
| where | The resulting point in the world where the sprite will collide. |
| static void ShellSprite::Init | ( | ) | [static, protected] |
| virtual bool ShellSprite::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 Packet ShellSprite::packObject | ( | ) | const [virtual] |
| virtual void ShellSprite::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 ShellSprite::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 ShellSprite::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.
bool ShellSprite::canExplode [private] |
bool ShellSprite::initialized [static, private] |
Model* ShellSprite::m [static, private] |
std::list<float> ShellSprite::trajectory [private] |
1.4.7