SuperTuxKart
Loading...
Searching...
No Matches
kart.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2004-2015 Steve Baker <sjbaker1@airmail.net>
4// Copyright (C) 2006-2015 SuperTuxKart-Team, Joerg Henrichs, Steve Baker
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU General Public License
8// as published by the Free Software Foundation; either version 3
9// of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20#ifndef HEADER_KART_HPP
21#define HEADER_KART_HPP
22
29#include "LinearMath/btTransform.h"
30
31#include "items/powerup_manager.hpp" // For PowerupType
32#include "karts/abstract_kart.hpp"
33#include "utils/cpp2011.hpp"
34#include "utils/no_copy.hpp"
35
36#include <SColor.h>
37
39class Attachment;
40class btKart;
41class btUprightConstraint;
42class Controller;
43class HitEffect;
44class Item;
45class ItemState;
46class KartGFX;
47class KartRewinder;
48class MaxSpeed;
49class ParticleEmitter;
50class ParticleKind;
51class SFXBase;
52class Shadow;
53class Skidding;
54class SkidMarks;
55class SlipStream;
56class Stars;
57class TerrainInfo;
58
68class Kart : public AbstractKart
69{
70 friend class Skidding;
71private:
72 int m_network_finish_check_ticks;
73 int m_network_confirmed_finish_ticks;
74protected:
77
81
82 /* Determines the time covered by the history size, in seconds */
83 const float XYZ_HISTORY_TIME = 0.25f;
84
85 /* Determines the number of previous XYZ positions of the kart to remember
86 Initialized in the constructor and unchanged from then on */
87 int m_xyz_history_size;
88
90 std::vector<Vec3> m_previous_xyz;
91
94 std::vector<float> m_previous_xyz_times;
95
96 float m_time_previous_counter;
97
100
103
107
108protected:
111
114
117
118 std::unique_ptr<btVehicleRaycaster> m_vehicle_raycaster;
119
120 std::unique_ptr<btKart> m_vehicle;
121
123 std::unique_ptr<Skidding> m_skidding;
124
126 std::unique_ptr<Stars> m_stars_effect;
127
128 // Graphical effects
129 // -----------------
130
131#ifndef SERVER_ONLY
133 std::unique_ptr<Shadow> m_shadow;
134
136 std::unique_ptr<SkidMarks> m_skidmarks;
137#endif
138
140 std::unique_ptr<KartGFX> m_kart_gfx;
141
143 std::unique_ptr<SlipStream> m_slipstream;
144
145 // Bullet physics parameters
146 // -------------------------
148 {
149 void operator()(btCompoundShape* p) const
150 {
151 for(int i = 0; i< p->getNumChildShapes(); i++)
152 delete p->getChildShape(i);
153 delete p;
154 }
155 };
156 std::unique_ptr<btCompoundShape, btCompoundShapeDeleter> m_kart_chassis;
157
160
165
170
172 PowerupManager::PowerupType m_last_used_powerup;
173
176
179
182
185
188
191
194
198
201
204
208
211
214
217
220
221 bool m_finished_race;
222
223 float m_finish_time;
224
228
229 float m_consumption_per_tick;
230
231 float m_energy_to_min_ratio;
232
233 float m_startup_boost;
234
235 float m_falling_time;
236
237 float m_weight;
238
240 float m_speed;
241
244
247
249 btTransform m_reset_transform;
250
251 std::vector<SFXBase*> m_custom_sounds;
252 int m_emitter_id = 0;
253 static const int EMITTER_COUNT = 3;
254 SFXBase *m_emitters[EMITTER_COUNT];
255 SFXBase *m_engine_sound;
258
261
262 SFXBase *m_nitro_sound;
266 SFXBase *m_skid_sound;
267 SFXBuffer *m_horn_sound;
268 static const int CRASH_SOUND_COUNT = 3;
269 SFXBuffer *m_crash_sounds[CRASH_SOUND_COUNT];
270 SFXBuffer *m_goo_sound;
271 SFXBuffer *m_boing_sound;
272 /* Used to avoid re-play the sound during rewinding, if it's happening at
273 * the same ticks. */
274 int m_ticks_last_crash;
275 int m_ticks_last_zipper;
277
278 void updatePhysics(int ticks);
279 void handleMaterialSFX();
280 void handleMaterialGFX(float dt);
281 void updateFlying();
282 void updateSliding();
283 void updateEnginePowerAndBrakes(int ticks);
284 void updateEngineSFX(float dt);
285 void updateSpeed();
286 void updateNitro(int ticks);
287 float applyAirFriction (float engine_power);
288 float getActualWheelForce();
289 void playCrashSFX(const Material* m, AbstractKart *k);
290 void loadData(RaceManager::KartType type, bool animatedModel);
291 void updateWeight();
292 void initSound();
293public:
294 Kart(const std::string& ident, unsigned int world_kart_id,
295 int position, const btTransform& init_transform,
296 HandicapLevel handicap,
297 std::shared_ptr<GE::GERenderInfo> ri);
298 virtual ~Kart();
299 virtual void init(RaceManager::KartType type) OVERRIDE;
300 virtual void kartIsInRestNow() OVERRIDE;
301 virtual void updateGraphics(float dt) OVERRIDE;
302 virtual void createPhysics ();
303 virtual bool isInRest () const OVERRIDE;
304 virtual void applyEngineForce (float force);
305
306 virtual void flyUp() OVERRIDE;
307 virtual void flyDown() OVERRIDE;
308
309 virtual void startEngineSFX () OVERRIDE;
310 virtual void collectedItem(ItemState *item) OVERRIDE;
311 virtual float getStartupBoostFromStartTicks(int ticks) const OVERRIDE;
312 virtual float getStartupBoost() const OVERRIDE { return m_startup_boost; }
313 virtual void setStartupBoost(float val) OVERRIDE { m_startup_boost = val; }
314 virtual const Material *getMaterial() const OVERRIDE;
315 virtual const Material *getLastMaterial() const OVERRIDE;
317 virtual float getTerrainPitch(float heading) const OVERRIDE;
318
319 virtual void reset () OVERRIDE;
320 virtual void handleZipper (const Material *m=NULL,
321 bool play_sound=false) OVERRIDE;
322 virtual bool setSquash (float time, float slowdown) OVERRIDE;
323 void setSquashGraphics();
324 virtual void unsetSquash () OVERRIDE;
325
326 virtual void crashed (AbstractKart *k, bool update_attachments) OVERRIDE;
327 virtual void crashed (const Material *m, const Vec3 &normal) OVERRIDE;
328 virtual float getHoT () const OVERRIDE;
329 virtual void update (int ticks) OVERRIDE;
330 virtual void finishedRace (float time, bool from_server=false) OVERRIDE;
331 virtual void setPosition (int p) OVERRIDE;
332 virtual void beep () OVERRIDE;
333 virtual void showZipperFire () OVERRIDE;
334
335
336 virtual bool playCustomSFX (unsigned int type) OVERRIDE;
337 virtual void setController(Controller *controller) OVERRIDE;
338 virtual void setXYZ(const Vec3& a) OVERRIDE;
339 virtual void changeKart(const std::string& new_ident,
340 HandicapLevel handicap,
341 std::shared_ptr<GE::GERenderInfo> ri,
342 const KartData& kart_data = KartData()) OVERRIDE;
343
344 // ========================================================================================
345 // SPEED and speed-boost related functions
346 // ----------------------------------------------------------------------------------------
347 virtual void adjustSpeed (float f) OVERRIDE;
348 // ----------------------------------------------------------------------------------------
349 virtual void increaseMaxSpeed(unsigned int category, float add_speed,
350 float engine_force, int duration,
351 int fade_out_time) OVERRIDE;
352 // ----------------------------------------------------------------------------------------
353 virtual void instantSpeedIncrease(unsigned int category, float add_max_speed,
354 float speed_boost, float engine_force,
355 int duration, int fade_out_time) OVERRIDE;
356 // ----------------------------------------------------------------------------------------
357 virtual void setSlowdown(unsigned int category, float max_speed_fraction,
358 int fade_in_time) OVERRIDE;
359 // ----------------------------------------------------------------------------------------
360 virtual int getSpeedIncreaseTicksLeft(unsigned int category) const OVERRIDE;
361 // ----------------------------------------------------------------------------------------
362 virtual float getSpeed() const OVERRIDE { return m_speed; }
363 // ----------------------------------------------------------------------------------------
364 virtual float getCurrentMaxSpeed() const OVERRIDE;
365 // ----------------------------------------------------------------------------------------
368 virtual void setSpeed(float s) OVERRIDE { m_speed = s; }
369
370 // ========================================================================================
371 // STEERING and skidding related functions
372 // ----------------------------------------------------------------------------------------
375 virtual float getMaxSteerAngle () const OVERRIDE
376 { return getMaxSteerAngle(getSpeed()); }
377 // ----------------------------------------------------------------------------------------
381 virtual float getTimeFullSteer(float steer) const OVERRIDE;
382 // ----------------------------------------------------------------------------------------
383 virtual float getSpeedForTurnRadius(float radius) const OVERRIDE;
384 // ----------------------------------------------------------------------------------------
385 virtual float getMaxSteerAngle(float speed) const;
386 // ----------------------------------------------------------------------------------------
389 virtual const Skidding *getSkidding() const OVERRIDE { return m_skidding.get(); }
390 // ----------------------------------------------------------------------------------------
393 virtual Skidding *getSkidding() OVERRIDE { return m_skidding.get(); }
394
395 // ========================================================================================
396 // NITRO related functions.
397 // ----------------------------------------------------------------------------------------
399 virtual float getEnergy() const OVERRIDE { return m_collected_energy; }
400 // ----------------------------------------------------------------------------------------
402 virtual void setEnergy(float val) OVERRIDE { m_collected_energy = val; }
403 // ----------------------------------------------------------------------------------------
407 virtual bool isOnMinNitroTime() const OVERRIDE { return m_min_nitro_ticks > 0; }
408
409 // ========================================================================================
410 // POWERUP related functions.
411 // ----------------------------------------------------------------------------------------
413 virtual void setPowerup (PowerupManager::PowerupType t, int n) OVERRIDE;
414 // ----------------------------------------------------------------------------------------
416 virtual void setLastUsedPowerup (PowerupManager::PowerupType t);
417 // ----------------------------------------------------------------------------------------
419 virtual const Powerup* getPowerup() const OVERRIDE { return m_powerup; }
420 // ----------------------------------------------------------------------------------------
422 virtual Powerup* getPowerup() OVERRIDE { return m_powerup; }
423 // ----------------------------------------------------------------------------------------
425 virtual PowerupManager::PowerupType getLastUsedPowerup() OVERRIDE
426 {
427 return m_last_used_powerup;
428 }
429 // ----------------------------------------------------------------------------------------
431 virtual int getNumPowerup() const OVERRIDE;
432
433 // ========================================================================================
434 // SPECIAL-STATUS related functions (plunger, squash, shield, immunity).
435 // ----------------------------------------------------------------------------------------
437 virtual void setInvulnerableTicks(int ticks) OVERRIDE
438 {
439 // int16_t max
440 if (ticks > 32767)
441 ticks = 32767;
442 m_invulnerable_ticks = ticks;
443 } // setInvulnerableTicks
444 // ----------------------------------------------------------------------------------------
446 virtual bool isInvulnerable() const OVERRIDE { return m_invulnerable_ticks > 0; }
447 // ----------------------------------------------------------------------------------------
449 virtual int getBlockedByPlungerTicks() const OVERRIDE
450 { return m_view_blocked_by_plunger; }
451 // ----------------------------------------------------------------------------------------
454 virtual void blockViewWithPlunger() OVERRIDE;
455 // ----------------------------------------------------------------------------------------
457 virtual void setShieldTime(float t) OVERRIDE;
458 // ----------------------------------------------------------------------------------------
460 virtual bool isShielded() const OVERRIDE;
461 // ----------------------------------------------------------------------------------------
463 virtual float getShieldTime() const OVERRIDE;
464 // ----------------------------------------------------------------------------------------
466 virtual void decreaseShieldTime() OVERRIDE;
467 // ----------------------------------------------------------------------------------------
469 virtual bool isSquashed() const OVERRIDE;
470
471 // ========================================================================================
472 // CONTROLLER related functions
473 // ----------------------------------------------------------------------------------------
474 virtual void setBoostAI (bool boosted) OVERRIDE;
475 // ----------------------------------------------------------------------------------------
476 virtual bool getBoostAI () const OVERRIDE;
477 // ----------------------------------------------------------------------------------------
479 virtual Controller* getController() OVERRIDE { return m_controller; }
480 // ----------------------------------------------------------------------------------------
482 const Controller* getController() const OVERRIDE { return m_controller; }
483
484 // ========================================================================================
485 // LOCATION ON-TRACK related functions
486 // ----------------------------------------------------------------------------------------
489 virtual const Vec3& getFrontXYZ() const OVERRIDE { return m_xyz_front; }
490 // -----------------------------------------------------------------------------------------
494 virtual btTransform getAlignedTransform(const float customPitch=-1) OVERRIDE;
495 // ----------------------------------------------------------------------------------------
497 const btTransform& getResetTransform() const {return m_reset_transform;}
498 // ----------------------------------------------------------------------------------------
500 virtual bool isOnGround() const OVERRIDE;
501 // ----------------------------------------------------------------------------------------
504 bool isNearGround() const;
505 // ----------------------------------------------------------------------------------------
508 virtual const Vec3& getNormal() const OVERRIDE;
509 // ----------------------------------------------------------------------------------------
511 virtual const Vec3& getPreviousXYZ() const OVERRIDE
512 { return m_previous_xyz[m_xyz_history_size-1]; }
513 // ----------------------------------------------------------------------------------------
515 virtual const Vec3& getRecentPreviousXYZ() const OVERRIDE;
516 // ----------------------------------------------------------------------------------------
518 virtual const float getRecentPreviousXYZTime() const OVERRIDE
519 { return m_previous_xyz_times[m_xyz_history_size/5]; }
520 // ----------------------------------------------------------------------------------------
522 bool isFlying() const { return m_flying; }
523 // ----------------------------------------------------------------------------------------
525 virtual bool isJumping() const OVERRIDE { return m_is_jumping; }
526 // ----------------------------------------------------------------------------------------
528 virtual const TerrainInfo *getTerrainInfo() const OVERRIDE { return m_terrain_info; }
529
530 // ========================================================================================
531 // ----------------------------------------------------------------------------------------
533 virtual KartGFX* getKartGFX() OVERRIDE { return m_kart_gfx.get(); }
534 // ----------------------------------------------------------------------------------------
536 virtual int getPosition() const OVERRIDE { return m_race_position; }
537 // ----------------------------------------------------------------------------------------
539 virtual int getInitialPosition () const OVERRIDE { return m_initial_position; }
540 // ----------------------------------------------------------------------------------------
542 virtual float getFinishTime () const OVERRIDE { return m_finish_time; }
543 // ----------------------------------------------------------------------------------------
545 virtual bool hasFinishedRace () const OVERRIDE { return m_finished_race; }
546 // -----------------------------------------------------------------------------------------
548 const irr::video::SColor &getColor() const;
549 // ----------------------------------------------------------------------------------------
550 virtual RaceManager::KartType getType() const OVERRIDE { return m_type; }
551 // ----------------------------------------------------------------------------------------
553 virtual btKart *getVehicle() const OVERRIDE { return m_vehicle.get(); }
554 // ----------------------------------------------------------------------------------------
555 virtual btQuaternion getVisualRotation() const OVERRIDE;
556 // ----------------------------------------------------------------------------------------
558 virtual const SlipStream* getSlipstream() const OVERRIDE { return m_slipstream.get(); }
559 // ----------------------------------------------------------------------------------------
561 virtual SlipStream* getSlipstream() OVERRIDE {return m_slipstream.get(); }
562 // ----------------------------------------------------------------------------------------
564 virtual void setSlipstreamEffect(float f) OVERRIDE;
565 // ----------------------------------------------------------------------------------------
566 virtual bool isEliminated() const OVERRIDE { return m_eliminated; }
567 // ----------------------------------------------------------------------------------------
568 virtual void eliminate() OVERRIDE;
569 // ----------------------------------------------------------------------------------------
570 virtual void setOnScreenText(const core::stringw& text) OVERRIDE;
571 // ----------------------------------------------------------------------------------------
573 virtual bool getRaceResult() const OVERRIDE { return m_race_result; }
574 // ----------------------------------------------------------------------------------------
576 void setRaceResult();
577 // ----------------------------------------------------------------------------------------
579 virtual bool isGhostKart() const OVERRIDE { return false; }
580 // ----------------------------------------------------------------------------------------
581 SFXBase* getNextEmitter();
582 // ----------------------------------------------------------------------------------------
583 virtual void playSound(SFXBuffer* buffer) OVERRIDE;
584 // ----------------------------------------------------------------------------------------
585 virtual bool isVisible() const OVERRIDE;
586 // ----------------------------------------------------------------------------------------
588 virtual void showStarEffect(float t) OVERRIDE;
589 // ----------------------------------------------------------------------------------------
590 virtual Stars* getStarsEffect() const OVERRIDE
591 { return m_stars_effect.get(); }
592 // ------------------------------------------------------------------------
596 { return m_network_confirmed_finish_ticks; }
597
598}; // Kart
599
600
601#endif
602
603/* EOF */
The base class for all kart animation, like rescue, explosion, or cannon.
Definition: abstract_kart_animation.hpp:60
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
This objects is permanently available in a kart and stores information about addons.
Definition: attachment.hpp:52
This is the base class for kart controller - that can be a player or a a robot.
Definition: controller.hpp:46
A small interface for effects to be used when a kart is hit.
Definition: hit_effect.hpp:33
Contains the state information of an item, i.e.
Definition: item.hpp:53
Definition: item.hpp:324
Definition: kart_data.hpp:12
Definition: kart_gfx.hpp:40
Definition: kart_rewinder.hpp:30
The main kart class.
Definition: kart.hpp:69
std::unique_ptr< SlipStream > m_slipstream
Handles all slipstreaming.
Definition: kart.hpp:143
virtual float getMaxSteerAngle() const OVERRIDE
Returns the maximum steering angle for this kart, which depends on the speed.
Definition: kart.hpp:375
float m_default_suspension_force
For changeKart.
Definition: kart.hpp:246
void updateSpeed()
Updates the local speed based on the current physical velocity.
Definition: kart.cpp:1797
virtual const Vec3 & getFrontXYZ() const OVERRIDE
Returns the coordinates of the front of the kart.
Definition: kart.hpp:489
virtual PowerupManager::PowerupType getLastUsedPowerup() OVERRIDE
Returns the last used powerup.
Definition: kart.hpp:425
btTransform m_reset_transform
Reset position.
Definition: kart.hpp:249
bool m_is_jumping
Is time flying activated.
Definition: kart.hpp:99
MaxSpeed * m_max_speed
Handles speed increase and capping due to powerup, terrain, ...
Definition: kart.hpp:110
std::unique_ptr< Shadow > m_shadow
The shadow of a kart.
Definition: kart.hpp:133
virtual const Material * getMaterial() const OVERRIDE
Returns the current material the kart is on.
Definition: kart.cpp:524
const Material * m_last_sound_material
The material for which the last sound effect was played.
Definition: kart.hpp:260
bool isFlying() const
For debugging only: check if a kart is flying.
Definition: kart.hpp:522
virtual int getBlockedByPlungerTicks() const OVERRIDE
Returns true if the kart has a plunger attached to its face.
Definition: kart.hpp:449
Powerup * m_powerup
Handles the powerup of a kart.
Definition: kart.hpp:116
Vec3 m_xyz_front
The coordinates of the front of the kart, used to determine when a new lap is triggered.
Definition: kart.hpp:80
virtual Skidding * getSkidding() OVERRIDE
Returns the skidding object for this kart (which can be used to query skidding related values) - non-...
Definition: kart.hpp:393
std::unique_ptr< Stars > m_stars_effect
For stars rotating around head effect.
Definition: kart.hpp:126
virtual btKart * getVehicle() const OVERRIDE
Returns the bullet vehicle which represents this kart.
Definition: kart.hpp:553
virtual KartGFX * getKartGFX() OVERRIDE
Returns a pointer to this kart's graphical effects.
Definition: kart.hpp:533
int m_race_position
Current race position (1-num_karts).
Definition: kart.hpp:190
virtual void kartIsInRestNow() OVERRIDE
Computes the transform of the graphical kart chasses with regards to the physical chassis.
Definition: kart.cpp:3086
void updateEngineSFX(float dt)
Adjust the engine sound effect depending on the speed of the kart.
Definition: kart.cpp:2668
void handleMaterialGFX(float dt)
Handles material specific GFX, mostly particle effects.
Definition: kart.cpp:2031
std::vector< Vec3 > m_previous_xyz
The coordinates of the XYZ_HISTORY_SIZE previous positions.
Definition: kart.hpp:90
virtual const Skidding * getSkidding() const OVERRIDE
Returns the skidding object for this kart (which can be used to query skidding related values).
Definition: kart.hpp:389
bool m_bubblegum_torque_sign
The sign of torque to apply after hitting a bubble gum.
Definition: kart.hpp:102
virtual bool isEliminated() const OVERRIDE
Returns true if the kart is eliminated.
Definition: kart.hpp:566
virtual void setEnergy(float val) OVERRIDE
Sets the energy the kart has collected.
Definition: kart.hpp:402
float m_last_factor_engine_sound
For smoothing engine sound.
Definition: kart.hpp:243
int8_t m_min_nitro_ticks
To prevent using nitro in too short bursts.
Definition: kart.hpp:213
virtual const Powerup * getPowerup() const OVERRIDE
Returns the current powerup.
Definition: kart.hpp:419
void playCrashSFX(const Material *m, AbstractKart *k)
Common code used when a kart or a material was hit.
Definition: kart.cpp:2457
float applyAirFriction(float engine_power)
Reduces the engine power according to speed.
Definition: kart.cpp:2716
void updatePhysics(int ticks)
Updates the physics for this kart: computing the driving force, set steering, handles skidding,...
Definition: kart.cpp:2596
float getActualWheelForce()
Simulates gears by adjusting the force of the engine.
Definition: kart.cpp:1204
PowerupManager::PowerupType m_last_used_powerup
Remember the last used powerup type of a kart for AI purposes.
Definition: kart.hpp:172
virtual void init(RaceManager::KartType type) OVERRIDE
This is a second initialisation phase, necessary since in the constructor virtual functions are not c...
Definition: kart.cpp:195
void updateNitro(int ticks)
Updates the current nitro status.
Definition: kart.cpp:2230
virtual Powerup * getPowerup() OVERRIDE
Returns the current powerup.
Definition: kart.hpp:422
Controller * m_controller
The main controller of this object, used for driving.
Definition: kart.hpp:164
virtual int getInitialPosition() const OVERRIDE
Returns the initial position of this kart.
Definition: kart.hpp:539
virtual int getPosition() const OVERRIDE
Returns the current position of this kart in the race.
Definition: kart.hpp:536
virtual float getSpeed() const OVERRIDE
Returns the speed of the kart in meters/second.
Definition: kart.hpp:362
bool m_flying
True if kart is flying (for debug purposes only).
Definition: kart.hpp:175
void updateSliding()
Handles sliding, i.e.
Definition: kart.cpp:2884
std::vector< float > m_previous_xyz_times
The times at which the previous positions occured.
Definition: kart.hpp:94
void updateFlying()
Adjusts kart translation if the kart is flying (in debug mode).
Definition: kart.cpp:2941
uint8_t m_bounce_back_ticks
A short time after a collision acceleration is disabled to allow the karts to bounce back.
Definition: kart.hpp:106
void handleMaterialSFX()
Plays any terrain specific sound effect.
Definition: kart.cpp:1933
Controller * m_saved_controller
This saves the original controller when the end controller is used.
Definition: kart.hpp:169
int16_t m_invulnerable_ticks
Time a kart is invulnerable.
Definition: kart.hpp:200
TerrainInfo * m_terrain_info
Stores information about the terrain the kart is on.
Definition: kart.hpp:113
int getNetworkConfirmedFinishTicks() const OVERRIDE
Return the confirmed finish ticks (sent by the server) indicating that this kart has really finished ...
Definition: kart.hpp:595
void loadData(RaceManager::KartType type, bool animatedModel)
Attaches the right model, creates the physics and loads all special effects (particle systems etc....
Definition: kart.cpp:2985
int16_t m_bubblegum_ticks
If > 0 then bubble gum effect is on.
Definition: kart.hpp:203
float m_max_gear_rpm
Maximum engine rpm's for the current gear.
Definition: kart.hpp:193
SFXBase * m_terrain_sound
Sound to be played depending on terrain.
Definition: kart.hpp:257
virtual float getFinishTime() const OVERRIDE
Returns the finished time for a kart.
Definition: kart.hpp:542
virtual bool isInvulnerable() const OVERRIDE
Returns if the kart is invulnerable.
Definition: kart.hpp:446
float m_current_lean
Current leaning of the kart.
Definition: kart.hpp:210
bool m_boosted_ai
True if the kart has been selected to have a boosted ai.
Definition: kart.hpp:219
virtual bool isJumping() const OVERRIDE
Returns whether this kart is jumping.
Definition: kart.hpp:525
bool m_has_caught_nolok_bubblegum
Set when hitting bubblegum.
Definition: kart.hpp:178
void updateWeight()
This method is to be called every time the mass of the kart is updated, which includes attaching an a...
Definition: kart.cpp:872
float m_collected_energy
The amount of energy collected with nitro cans.
Definition: kart.hpp:227
SFXBase * m_previous_terrain_sound
A pointer to the previous terrain sound needs to be saved so that an 'older' sfx can be finished and ...
Definition: kart.hpp:265
bool m_fire_clicked
True if fire button was pushed and not released.
Definition: kart.hpp:216
int16_t m_view_blocked_by_plunger
When a kart has its view blocked by the plunger, this variable will be ‍0 the number it contains is t...
Definition: kart.hpp:207
virtual float getEnergy() const OVERRIDE
Returns the remaining collected energy.
Definition: kart.hpp:399
bool m_eliminated
True if the kart is eliminated.
Definition: kart.hpp:184
std::unique_ptr< Skidding > m_skidding
This object handles all skidding.
Definition: kart.hpp:123
ParticleEmitter * m_collision_particles
For collisions.
Definition: kart.hpp:159
virtual bool isGhostKart() const OVERRIDE
Returns whether this kart is a ghost (replay) kart.
Definition: kart.hpp:579
std::unique_ptr< KartGFX > m_kart_gfx
All particle effects.
Definition: kart.hpp:140
int m_initial_position
Initial rank of the kart.
Definition: kart.hpp:187
void updateEnginePowerAndBrakes(int ticks)
Sets the engine power.
Definition: kart.cpp:2757
std::unique_ptr< SkidMarks > m_skidmarks
The skidmarks object for this kart.
Definition: kart.hpp:136
virtual bool hasFinishedRace() const OVERRIDE
Returns true if this kart has finished the race.
Definition: kart.hpp:545
float m_speed
The current speed (i.e.
Definition: kart.hpp:240
virtual bool isOnMinNitroTime() const OVERRIDE
Return whether nitro is being used despite the nitro button not being pressed due to minimal use time...
Definition: kart.hpp:407
virtual SlipStream * getSlipstream() OVERRIDE
Returns the slipstream object of this kart.
Definition: kart.hpp:561
const Controller * getController() const OVERRIDE
Returns the controller of this kart (const version).
Definition: kart.hpp:482
float m_graphical_y_offset
Offset of the graphical kart chassis from the physical chassis.
Definition: kart.hpp:76
virtual const TerrainInfo * getTerrainInfo() const OVERRIDE
Returns the terrain info oject.
Definition: kart.hpp:528
bool m_race_result
True if the kart wins, false otherwise.
Definition: kart.hpp:181
int m_brake_ticks
How long the brake key has been pressed - the longer the harder the kart will brake.
Definition: kart.hpp:197
Definition: material.hpp:48
Definition: max_speed.hpp:31
manages smoke particle effects
Definition: particle_emitter.hpp:42
type of particles
Definition: particle_kind.hpp:42
Definition: powerup.hpp:38
KartType
Different kart types: A local player, a player connected via network, an AI kart, the leader kart (cu...
Definition: race_manager.hpp:242
The base class for sound effects.
Definition: sfx_base.hpp:43
The buffer (data) for one kind of sound effects.
Definition: sfx_buffer.hpp:44
This class is used to enable a shadow for a kart.
Definition: shadow.hpp:48
This class is responsible for drawing skid marks for a kart.
Definition: skid_marks.hpp:54
Definition: skidding.hpp:40
Definition: slip_stream.hpp:48
This class is used to display rotating stars around a kart's head.
Definition: stars.hpp:41
This class stores information about the triangle that's under an object, i.e.: the normal,...
Definition: terrain_info.hpp:32
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
Definition: btKart.hpp:32
void changeKart(int idKart, std::string *new_id)
Gets the maximum speed (velocity) a kart can reach.
Definition: script_kart.cpp:144
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:42
Definition: kart.hpp:148