SuperTuxKart
|
This class is a 'mixin' for kart, and handles the animated explosion. More...
#include <explosion_animation.hpp>
Public Member Functions | |
virtual void | update (int ticks) |
Updates the kart animation. More... | |
virtual void | updateGraphics (float dt) |
virtual KartAnimationType | getAnimationType () const |
virtual void | saveState (BareNetworkString *buffer) |
virtual void | restoreState (BareNetworkString *buffer) |
bool | hasResetAlready () const |
![]() | |
AbstractKartAnimation (AbstractKart *kart, const std::string &name) | |
Constructor. More... | |
virtual float | getAnimationTimer () const |
Returns the current animation timer. | |
virtual const std::string & | getName () const |
To easily allow printing the name of the animation being used atm. More... | |
void | handleResetRace () |
Static Public Member Functions | |
static ExplosionAnimation * | create (AbstractKart *kart, const Vec3 &pos, bool direct_hit) |
A static create function that does only create an explosion if the explosion happens to be close enough to affect the kart. More... | |
static ExplosionAnimation * | create (AbstractKart *kart) |
A static create function that does only create an explosion if the explosion happens to be close enough to affect the kart. More... | |
Protected Member Functions | |
void | restoreData (BareNetworkString *b) |
void | init (bool direct_hit, const Vec3 &normal, const btTransform &reset_trans) |
ExplosionAnimation (AbstractKart *kart, BareNetworkString *buffer) | |
ExplosionAnimation (AbstractKart *kart, bool direct_hit) | |
![]() | |
void | resetPowerUp () |
In CTF mode call this to reset kart powerup when get hit. | |
void | restoreBasicState (BareNetworkString *buffer) |
Used in constructor of sub-class as no virtual function can be used there. | |
float | getMaximumHeight (const Vec3 &up_vector, float height_remove) |
Determine maximum rescue height with up-raycast. | |
Protected Attributes | |
Vec3 | m_normal |
The normal of kart when it started to explode. More... | |
Vec3 | m_curr_rotation |
The kart's current rotation. More... | |
Vec3 | m_add_rotation |
The artificial rotation to toss the kart around. More... | |
float | m_velocity |
The velocity with which the kart is moved. More... | |
int | m_reset_ticks |
If not -1, when > world count up ticks it will use m_reset_trans below for animation. More... | |
btTransform | m_reset_trans |
Used for reset kart back to flag base in CTF. More... | |
int | m_reset_trans_compressed [4] |
bool | m_direct_hit |
![]() | |
AbstractKart * | m_kart |
A pointer to the kart which is animated by this class. More... | |
int | m_end_ticks |
Time in ticks for the animation which ends in world count up ticks. More... | |
int | m_created_ticks |
Time in ticks for the animation creation. More... | |
btTransform | m_created_transform |
Transformation by the time the animation was created, used for rewind to recreate the animation with the same one. More... | |
int | m_created_transform_compressed [4] |
Friends | |
class | KartRewinder |
This class is a 'mixin' for kart, and handles the animated explosion.
I.e. it will throw the kart a certain amount in the air, rotate it randomly, and after the specified time period let it land at the same spot where it was hit, therefore avoiding any problems of karts being pushed on wrong parts of the track, and making explosion more 'fair' (it can't happen that one explosion give you actually a benefit by pushing you forwards. The object is a base class for kart, but will only be used if an explosion happens.
|
static |
A static create function that does only create an explosion if the explosion happens to be close enough to affect the kart.
Otherwise, NULL is returned.
kart | The kart that is exploded. |
pos | The position where the explosion happened. |
direct_hit | If the kart was hit directly. |
|
static |
A static create function that does only create an explosion if the explosion happens to be close enough to affect the kart.
Otherwise, NULL is returned.
|
virtual |
Updates the kart animation.
ticks | Number of time steps - should be 1. |
Reimplemented from AbstractKartAnimation.
|
protected |
The artificial rotation to toss the kart around.
It's in units of rotation per second.
|
protected |
The kart's current rotation.
|
protected |
The normal of kart when it started to explode.
|
protected |
If not -1, when > world count up ticks it will use m_reset_trans below for animation.
|
protected |
Used for reset kart back to flag base in CTF.
|
protected |
The velocity with which the kart is moved.