|
| enum | {
MS_INCREASE_MIN
, MS_INCREASE_ZIPPER = MS_INCREASE_MIN
, MS_INCREASE_SLIPSTREAM
, MS_INCREASE_NITRO
,
MS_INCREASE_RUBBER
, MS_INCREASE_SKIDDING
, MS_INCREASE_RED_SKIDDING
, MS_INCREASE_MAX
} |
| | The categories to use for increasing the speed of a kart: Increase due to zipper, slipstream, nitro, rubber band, skidding usage.
|
| |
| enum | {
MS_DECREASE_MIN
, MS_DECREASE_TERRAIN = MS_DECREASE_MIN
, MS_DECREASE_AI
, MS_DECREASE_BUBBLE
,
MS_DECREASE_SQUASH
, MS_DECREASE_MAX
} |
| | The categories to use for decreasing the speed of a kart: Decrease due to terrain, different AI levels and end controller.
|
| |
|
| | MaxSpeed (AbstractKart *kart) |
| | This class handles maximum speed for karts. More...
|
| |
| void | increaseMaxSpeed (unsigned int category, float add_speed, float engine_force, int duration, int fade_out_time) |
| | Sets an increased maximum speed for a category. More...
|
| |
| void | instantSpeedIncrease (unsigned int category, float add_speed, float speed_boost, float engine_force, int duration, int fade_out_time) |
| | This adjusts the top speed using increaseMaxSpeed, but additionally causes an instant speed boost, which can be smaller than add-max-speed. More...
|
| |
| void | setSlowdown (unsigned int category, float max_speed_fraction, int fade_in_time, int duration=-1) |
| | Defines a slowdown, which is in fraction of top speed. More...
|
| |
| int | getSpeedIncreaseTicksLeft (unsigned int category) |
| | Returns how much increased speed time is left over in the given category. More...
|
| |
| int | isSpeedIncreaseActive (unsigned int category) |
| | Returns if increased speed is active in the given category. More...
|
| |
| int | isSpeedDecreaseActive (unsigned int category) |
| | Returns if decreased speed is active in the given category. More...
|
| |
| void | update (int ticks) |
| | Updates all speed increase and decrease objects, and determines the current maximum speed. More...
|
| |
| void | reset () |
| | Reset to prepare for a restart. More...
|
| |
| void | saveState (BareNetworkString *buffer) const |
| | Saves the speed data in a network string for rewind. More...
|
| |
| void | rewindTo (BareNetworkString *buffer) |
| | Restore a saved state. More...
|
| |
| void | setMinSpeed (float s) |
| | Sets the minimum speed a kart should have. More...
|
| |
|
float | getCurrentMaxSpeed () const |
| | Returns the current maximum speed for this kart.
|
| |
|
float | getCurrentAdditionalEngineForce () const |
| | Returns the additional engine force.
|
| |
| void MaxSpeed::instantSpeedIncrease |
( |
unsigned int |
category, |
|
|
float |
add_max_speed, |
|
|
float |
speed_boost, |
|
|
float |
engine_force, |
|
|
int |
duration, |
|
|
int |
fade_out_time |
|
) |
| |
This adjusts the top speed using increaseMaxSpeed, but additionally causes an instant speed boost, which can be smaller than add-max-speed.
(e.g. a zipper can give an instant boost of 5 m/s, but over time would allow the speed to go up by 10 m/s). Note that bullet does not restrict speed (e.g. by simulating air resistance), so without capping the speed (which is done my this object) the speed would go arbitrary high over time
- Parameters
-
| category | The category for which the speed is increased. |
| add_max_speed | Increase of the maximum allowed speed. |
| speed_boost | An instant speed increase for this kart. |
| engine_force | Additional engine force. |
| duration | Duration of the increased speed. |
| fade_out_time | How long the maximum speed will fade out linearly. |