SuperTuxKart
|
Controls all checks structures of a track. More...
#include <check_manager.hpp>
Public Member Functions | |
~CheckManager () | |
Private destructor (to make sure it is only called using the static destroy function). | |
void | add (CheckStructure *strct) |
void | addFlyableToCannons (Flyable *flyable) |
Adds a flyable object to be tested against cannons. | |
void | removeFlyableFromCannons (Flyable *flyable) |
Removes a flyable from all cannons. | |
void | load (const XMLNode &node) |
Loads all check structure informaiton from the specified xml file. | |
void | update (float dt) |
Updates all animations. | |
void | reset (const Track &track) |
Resets all checks. | |
void | resetAfterKartMove (AbstractKart *kart) |
Called after a kart is moved (e.g. | |
void | resetAfterRewind () |
unsigned int | getLapLineIndex () const |
Returns the index of the first check structures that triggers a new lap to be counted. | |
int | getChecklineTriggering (const Vec3 &from, const Vec3 &to) const |
Returns the check line index that is triggered when going from 'from' to 'to'. | |
unsigned int | getCheckStructureCount () const |
Returns the number of check structures defined. | |
CheckStructure * | getCheckStructure (unsigned int n) const |
Returns the nth. | |
Private Attributes | |
std::vector< CheckStructure * > | m_all_checks |
Controls all checks structures of a track.
CheckManager::~CheckManager | ( | ) |
Private destructor (to make sure it is only called using the static destroy function).
Frees all check structures.
void CheckManager::addFlyableToCannons | ( | Flyable * | flyable | ) |
Adds a flyable object to be tested against cannons.
This will allow bowling- and rubber-balls to fly in a cannon.
flyable | Pointer to the flyable to be added. |
Returns the check line index that is triggered when going from 'from' to 'to'.
If no check line is triggered, -1 will be returned.
from | Coordinates to start from. |
to | Coordinates to go to. |
|
inline |
Returns the nth.
check structure.
unsigned int CheckManager::getLapLineIndex | ( | ) | const |
Returns the index of the first check structures that triggers a new lap to be counted.
It aborts if no lap structure is defined.
void CheckManager::removeFlyableFromCannons | ( | Flyable * | flyable | ) |
Removes a flyable from all cannons.
Used when this flyable is removed (e.g. explodes).
flyable | Pointer to the flyable to be removed. |
void CheckManager::resetAfterKartMove | ( | AbstractKart * | kart | ) |
Called after a kart is moved (e.g.
after a rescue) to reset any cached check information. Without this an incorrect crossing of a checkline could be triggered since a CheckLine stores the previous position).
kart_index | Index of the kart that was moved. |
void CheckManager::update | ( | float | dt | ) |
Updates all animations.
Called one per time step.
dt | Time since last call. |