SuperTuxKart
Loading...
Searching...
No Matches
abstract_kart.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2012-2015 Joerg Henrichs
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_ABSTRACT_KART_HPP
20#define HEADER_ABSTRACT_KART_HPP
21
22#include <memory>
23
24#include "items/powerup_manager.hpp"
25#include "karts/moveable.hpp"
26#include "karts/controller/kart_control.hpp"
27#include "race/race_manager.hpp"
28
29namespace irr
30{
31 namespace scene
32 {
33 class IDummyTransformationSceneNode;
34 }
35}
36
38class Attachment;
39class btKart;
40class btQuaternion;
41class Controller;
42class Item;
43class ItemState;
44class KartGFX;
45class KartModel;
46class KartProperties;
47class Material;
48class Powerup;
49namespace GE { class GERenderInfo; }
50class SFXBuffer;
51class Skidding;
52class SlipStream;
53class Stars;
54class TerrainInfo;
55
56
61class AbstractKart : public Moveable
62{
63private:
74
76 unsigned int m_world_kart_id;
77
79 core::stringw m_name;
80
81 // ------------------------------------------------------------------------
82 void loadKartProperties(const std::string& new_ident,
83 HandicapLevel handicap,
84 std::shared_ptr<GE::GERenderInfo> ri,
85 const KartData& kart_data = KartData());
86protected:
87 btTransform m_starting_transform;
88
89 int m_live_join_util;
90
92 std::unique_ptr<KartProperties> m_kart_properties;
93
96
100 std::unique_ptr<KartModel> m_kart_model;
101
103 std::unique_ptr<Attachment> m_attachment;
104
107
110
112 irr::scene::IDummyTransformationSceneNode *m_wheel_box;
113public:
114 AbstractKart(const std::string& ident,
115 int world_kart_id,
116 int position, const btTransform& init_transform,
117 HandicapLevel handicap,
118 std::shared_ptr<GE::GERenderInfo> ri);
119 virtual ~AbstractKart();
120 // ------------------------------------------------------------------------
122 const core::stringw& getName() const { return m_name; }
123 // ------------------------------------------------------------------------
124 virtual void reset();
125 virtual void init(RaceManager::KartType type) = 0;
126 // ========================================================================
127 // Functions related to controlling the kart
128 // ------------------------------------------------------------------------
130 virtual float getSteerPercent() const { return m_controls.getSteer(); }
131 // ------------------------------------------------------------------------
134 // ------------------------------------------------------------------------
136 const KartControl& getControls() const { return m_controls; }
137
138 // ========================================================================
139 // Access to the kart properties.
140 // ------------------------------------------------------------------------
143 { return m_kart_properties.get(); }
144 // ========================================================================
146 virtual void changeKart(const std::string& new_ident,
147 HandicapLevel handicap,
148 std::shared_ptr<GE::GERenderInfo> ri,
149 const KartData& kart_data = KartData());
150 // ========================================================================
151 // Access to the handicap.
152 // ------------------------------------------------------------------------
154 const HandicapLevel getHandicap() const { return m_handicap; }
155 // ------------------------------------------------------------------------
158
159 // ------------------------------------------------------------------------
162 virtual const std::string& getIdent() const;
163 // ------------------------------------------------------------------------
166 virtual float getMaxSteerAngle () const = 0;
167 // ------------------------------------------------------------------------
170 virtual float getSpeedForTurnRadius(float radius) const = 0;
171 // ------------------------------------------------------------------------
175 virtual float getTimeFullSteer(float steer) const = 0;
176
177 // ========================================================================
178 // Attachment related functions.
179 // ------------------------------------------------------------------------
181 const Attachment* getAttachment() const {return m_attachment.get(); }
182 // ------------------------------------------------------------------------
185
186 // ========================================================================
187 // Access to the graphical kart model.
188 // ------------------------------------------------------------------------
190 KartModel* getKartModel() const { return m_kart_model.get(); }
191 // ------------------------------------------------------------------------
193 float getKartLength() const { return m_kart_length; }
194 // ------------------------------------------------------------------------
196 float getKartHeight() const { return m_kart_height; }
197 // ------------------------------------------------------------------------
199 float getKartWidth() const {return m_kart_width; }
200 // ------------------------------------------------------------------------
202 float getHighestPoint() const { return m_kart_highest_point; }
203 // ------------------------------------------------------------------------
208 virtual void kartIsInRestNow();
209
210 // ------------------------------------------------------------------------
213 virtual float getTimeForDistance(float distance);
214 // ------------------------------------------------------------------------
216 bool isWheeless() const;
217 // ------------------------------------------------------------------------
220 virtual const Vec3& getFrontXYZ() const = 0;
221 // ------------------------------------------------------------------------
225 const Vec3& getWheelGraphicsPosition(int i) const
226 {assert(i>=0 && i<4); return m_wheel_graphics_position[i];}
227
228 // ========================================================================
229 // Emergency animation related functions.
230 // ------------------------------------------------------------------------
234 // ------------------------------------------------------------------------
236 { return m_kart_animation; }
237 // ------------------------------------------------------------------------
239 virtual void setKartAnimation(AbstractKartAnimation *ka);
240 // ------------------------------------------------------------------------
241
242 // ------------------------------------------------------------------------
243 // ------------------------------------------------------------------------
245 unsigned int getWorldKartId() const { return m_world_kart_id; }
246 // ------------------------------------------------------------------------
251 virtual void setController(Controller *controller) = 0;
252 // ------------------------------------------------------------------------
254 virtual Controller* getController() = 0;
255 // ------------------------------------------------------------------------
257 virtual const Controller* getController() const = 0;
258 // ------------------------------------------------------------------------
261 virtual const Skidding *getSkidding() const = 0;
262 // ------------------------------------------------------------------------
263 virtual RaceManager::KartType getType() const = 0;
264 // ------------------------------------------------------------------------
267 virtual Skidding *getSkidding() = 0;
268 // ------------------------------------------------------------------------
270 virtual bool isEliminated() const = 0;
271 // ------------------------------------------------------------------------
273 virtual void eliminate() = 0;
274 // ------------------------------------------------------------------------
275 virtual void finishedRace(float time, bool from_server=false) = 0;
276 // ------------------------------------------------------------------------
278 virtual float getFinishTime() const = 0;
279 // ------------------------------------------------------------------------
281 virtual int getBlockedByPlungerTicks() const = 0;
282 // ------------------------------------------------------------------------
285 virtual void blockViewWithPlunger() = 0;
286 // ------------------------------------------------------------------------
288 virtual bool isSquashed() const = 0;
289 // ------------------------------------------------------------------------
295 virtual bool setSquash(float time, float slowdown) = 0;
296 // ------------------------------------------------------------------------
298 virtual void unsetSquash() = 0;
299 // ------------------------------------------------------------------------
303 virtual float getSpeed() const = 0;
304 // ------------------------------------------------------------------------
307 virtual float getCurrentMaxSpeed() const = 0;
308 // ------------------------------------------------------------------------
312 virtual int getSpeedIncreaseTicksLeft(unsigned int category) const = 0;
313
314 // ------------------------------------------------------------------------
318 virtual void setBoostAI(bool boosted) = 0;
319
320 // ------------------------------------------------------------------------
323 virtual bool getBoostAI() const = 0;
324
325 // ------------------------------------------------------------------------
326
334 virtual void increaseMaxSpeed(unsigned int category, float add_speed,
335 float engine_force, int duration,
336 int fade_out_time) = 0;
337
338 // ----------------------------------------------------------------------------
350 virtual void instantSpeedIncrease(unsigned int category, float add_max_speed,
351 float speed_boost, float engine_force,
352 int duration, int fade_out_time) = 0;
353
354 // ------------------------------------------------------------------------
359 virtual void setSlowdown(unsigned int category, float max_speed_fraction,
360 int fade_in_time) = 0;
361 // ------------------------------------------------------------------------
363 virtual float getEnergy() const = 0;
364 // ------------------------------------------------------------------------
368 virtual void collectedItem(ItemState *item_state) = 0;
369 // ------------------------------------------------------------------------
371 virtual int getPosition() const = 0;
372 // ------------------------------------------------------------------------
374 virtual void setPosition(int p) = 0;
375 // ------------------------------------------------------------------------
377 virtual int getInitialPosition() const = 0;
378 // ------------------------------------------------------------------------
380 virtual bool isOnGround() const = 0;
381 // ------------------------------------------------------------------------
383 virtual const SlipStream* getSlipstream() const = 0;
384 // ------------------------------------------------------------------------
386 virtual SlipStream* getSlipstream() = 0;
387 // ------------------------------------------------------------------------
389 virtual void setSlipstreamEffect(float f) = 0;
390 // ------------------------------------------------------------------------
392 virtual void beep() = 0;
393 // ------------------------------------------------------------------------
398 virtual bool playCustomSFX(unsigned int type) = 0;
399 // ------------------------------------------------------------------------
401 virtual void showZipperFire() = 0;
402 // ------------------------------------------------------------------------
407 virtual void handleZipper(const Material *m=NULL,
408 bool play_sound=false) = 0;
409 // ------------------------------------------------------------------------
411 virtual bool hasFinishedRace() const = 0;
412 // ------------------------------------------------------------------------
413 virtual void setEnergy(float val) = 0;
414 // ------------------------------------------------------------------------
418 virtual bool isOnMinNitroTime() const = 0;
419 // ------------------------------------------------------------------------
421 virtual const Material *getMaterial() const = 0;
422 // ------------------------------------------------------------------------
425 virtual const Material *getLastMaterial() const = 0;
426 // ------------------------------------------------------------------------
428 virtual const Powerup *getPowerup() const = 0;
429 // ------------------------------------------------------------------------
431 virtual Powerup *getPowerup() = 0;
432 // ------------------------------------------------------------------------
434 virtual PowerupManager::PowerupType getLastUsedPowerup() = 0;
435 // ------------------------------------------------------------------------
437 virtual int getNumPowerup() const = 0;
438 // ------------------------------------------------------------------------
440 virtual KartGFX* getKartGFX() = 0;
441 // ------------------------------------------------------------------------
442 virtual void setPowerup (PowerupManager::PowerupType t, int n) = 0;
443 // ------------------------------------------------------------------------
445 virtual btKart* getVehicle() const = 0;
446 // ------------------------------------------------------------------------
447 virtual btQuaternion getVisualRotation() const = 0;
448 // ------------------------------------------------------------------------
450 virtual bool isInRest() const = 0;
451 // ------------------------------------------------------------------------
454 virtual void startEngineSFX() = 0;
455 // ------------------------------------------------------------------------
459 virtual void adjustSpeed(float f) = 0;
460 // ------------------------------------------------------------------------
463 virtual void setSpeed(float s) = 0;
464 // ------------------------------------------------------------------------
466 virtual bool isInvulnerable() const = 0;
467 // ------------------------------------------------------------------------
468 virtual void setInvulnerableTicks(int ticks) = 0;
469 // ------------------------------------------------------------------------
471 virtual bool isShielded() const = 0;
472 // ------------------------------------------------------------------------
473 virtual void setShieldTime(float t) = 0;
474 // ------------------------------------------------------------------------
475 virtual float getShieldTime() const = 0;
476 // ------------------------------------------------------------------------
478 virtual void decreaseShieldTime() = 0;
479 // ------------------------------------------------------------------------
480
482 virtual void showStarEffect(float t) = 0;
483 // ------------------------------------------------------------------------
485 virtual const TerrainInfo *getTerrainInfo() const = 0;
486 // ------------------------------------------------------------------------
491 virtual void crashed(AbstractKart *k, bool update_attachments) = 0;
492 // ------------------------------------------------------------------------
493 virtual void crashed(const Material *m, const Vec3 &normal) = 0;
494 // ------------------------------------------------------------------------
497 virtual const Vec3& getNormal() const = 0;
498 // ------------------------------------------------------------------------
500 virtual const Vec3& getPreviousXYZ() const = 0;
501 // ------------------------------------------------------------------------
503 virtual const Vec3& getRecentPreviousXYZ() const = 0;
504 // ------------------------------------------------------------------------
506 virtual const float getRecentPreviousXYZTime() const = 0;
507 // ------------------------------------------------------------------------
509 virtual float getHoT() const = 0;
510 // ------------------------------------------------------------------------
512 virtual float getTerrainPitch(float heading) const = 0;
513 // -------------------------------------------------------------------------
517 virtual btTransform getAlignedTransform(const float customPitch=-1) = 0;
518 // -------------------------------------------------------------------------
521 virtual void setOnScreenText(const core::stringw& text) = 0;
522 // ------------------------------------------------------------------------
524 virtual bool getRaceResult() const = 0;
525 // ------------------------------------------------------------------------
527 virtual bool isGhostKart() const = 0;
528 // ------------------------------------------------------------------------
530 virtual bool isJumping() const = 0;
531 // ------------------------------------------------------------------------
532 virtual void playSound(SFXBuffer* buffer) = 0;
533 // ------------------------------------------------------------------------
534 virtual bool isVisible() const = 0;
535 // ------------------------------------------------------------------------
536 virtual void makeKartRest();
537 // ------------------------------------------------------------------------
538 virtual void setStartupBoost(float val) = 0;
539 // ------------------------------------------------------------------------
540 virtual float getStartupBoost() const = 0;
541 // ------------------------------------------------------------------------
542 virtual float getStartupBoostFromStartTicks(int ticks) const = 0;
543 // ------------------------------------------------------------------------
544 virtual Stars* getStarsEffect() const = 0;
545 // ------------------------------------------------------------------------
546 int getLiveJoinUntilTicks() const { return m_live_join_util; }
547 // ------------------------------------------------------------------------
548 void setLiveJoinKart(int util_ticks) { m_live_join_util = util_ticks; }
549 // ------------------------------------------------------------------------
552 virtual int getNetworkConfirmedFinishTicks() const = 0;
553}; // AbstractKart
554
555
556#endif
557
558/* 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
virtual int getNetworkConfirmedFinishTicks() const =0
Return the confirmed finish ticks (sent by the server) indicating that this kart has really finished ...
virtual int getPosition() const =0
Returns the current position of this kart in the race.
virtual bool getRaceResult() const =0
Returns whether this kart wins or loses.
const core::stringw & getName() const
Returns a name to be displayed for this kart.
Definition: abstract_kart.hpp:122
virtual const Vec3 & getPreviousXYZ() const =0
Returns the position 0.25s before.
virtual const Skidding * getSkidding() const =0
Returns the skidding object for this kart (which can be used to query skidding related values).
virtual KartGFX * getKartGFX()=0
Returns a points to this kart's graphical effects.
virtual const float getRecentPreviousXYZTime() const =0
Returns the time at which the recent previous position occured.
virtual Controller * getController()=0
Returns the controller of this kart.
float m_kart_height
Height of the kart, copy of the data from KartModel.
Definition: abstract_kart.hpp:69
virtual void changeKart(const std::string &new_ident, HandicapLevel handicap, std::shared_ptr< GE::GERenderInfo > ri, const KartData &kart_data=KartData())
Change to new kart instancely (used in network live join).
Definition: abstract_kart.cpp:182
virtual void adjustSpeed(float f)=0
Multiplies the velocity of the kart by a factor f (both linear and angular).
virtual void kartIsInRestNow()
Called after the kart comes to rest.
Definition: abstract_kart.cpp:252
float m_kart_highest_point
Coordinate on up axis.
Definition: abstract_kart.hpp:71
float getKartLength() const
Returns the length of the kart.
Definition: abstract_kart.hpp:193
virtual float getFinishTime() const =0
Returns the finished time for a kart.
virtual void decreaseShieldTime()=0
Decreases the kart's shield time.
virtual bool playCustomSFX(unsigned int type)=0
This function will play a particular character voice for this kart.
virtual const Vec3 & getNormal() const =0
Returns the normal of the terrain the kart is over atm.
virtual float getSteerPercent() const
Returns the current steering value for this kart.
Definition: abstract_kart.hpp:130
const KartProperties * getKartProperties() const
Returns the kart properties of this kart.
Definition: abstract_kart.hpp:142
virtual const Material * getMaterial() const =0
Returns the current material the kart is on.
virtual bool isJumping() const =0
Returns whether this kart is jumping.
Attachment * getAttachment()
Returns the current attachment, non-const version.
Definition: abstract_kart.hpp:184
virtual void instantSpeedIncrease(unsigned int category, float add_max_speed, float speed_boost, float engine_force, int duration, int fade_out_time)=0
This adjusts the top speed using increaseMaxSpeed, but additionally causes an instant speed boost,...
virtual void showZipperFire()=0
Show fire to go with a zipper.
core::stringw m_name
Name of the kart with translation.
Definition: abstract_kart.hpp:79
virtual const Powerup * getPowerup() const =0
Returns the current powerup.
virtual Powerup * getPowerup()=0
Returns the current powerup.
virtual PowerupManager::PowerupType getLastUsedPowerup()=0
Returns the last used powerup type.
virtual bool isEliminated() const =0
Returns true if the kart is eliminated.
virtual void setBoostAI(bool boosted)=0
Sets the kart AI boost state.
virtual void blockViewWithPlunger()=0
Sets that the view is blocked by a plunger.
bool isWheeless() const
Returns true if this kart has no wheels.
Definition: abstract_kart.cpp:202
std::unique_ptr< KartModel > m_kart_model
This stores a copy of the kart model.
Definition: abstract_kart.hpp:100
virtual void eliminate()=0
Marks this kart to be eliminated.
virtual float getEnergy() const =0
Returns the remaining collected energy.
KartModel * getKartModel() const
Returns this kart's kart model.
Definition: abstract_kart.hpp:190
virtual int getSpeedIncreaseTicksLeft(unsigned int category) const =0
Returns how much increased speed time is left over in the given category.
virtual void setKartAnimation(AbstractKartAnimation *ka)
Sets a new kart animation.
Definition: abstract_kart.cpp:214
virtual float getTimeFullSteer(float steer) const =0
Returns the time till full steering is reached for this kart.
virtual void makeKartRest()
Called before go phase to make sure all karts start at the same position in case there is a slope.
Definition: abstract_kart.cpp:263
virtual float getSpeed() const =0
Returns the speed of the kart in meters/second.
float getKartWidth() const
Returns the width of the kart.
Definition: abstract_kart.hpp:199
virtual int getNumPowerup() const =0
Returns the number of powerups.
HandicapLevel m_handicap
The handicap level of this kart.
Definition: abstract_kart.hpp:95
const KartControl & getControls() const
Returns all controls of this kart - const version.
Definition: abstract_kart.hpp:136
virtual SlipStream * getSlipstream()=0
Returns the slipstream object of this kart.
unsigned int m_world_kart_id
Index of kart in world.
Definition: abstract_kart.hpp:76
const Vec3 * m_wheel_graphics_position
The position of all four wheels in the 3d model.
Definition: abstract_kart.hpp:73
std::unique_ptr< KartProperties > m_kart_properties
The kart properties.
Definition: abstract_kart.hpp:92
virtual float getSpeedForTurnRadius(float radius) const =0
Returns the (maximum) speed for a given turn radius.
virtual float getTimeForDistance(float distance)
Returns the time at which the kart was at a given distance.
Definition: abstract_kart.cpp:244
virtual void setSlipstreamEffect(float f)=0
Activates a slipstream effect, atm that is display some nitro.
virtual bool getBoostAI() const =0
Returns the kart AI boost state.
virtual int getBlockedByPlungerTicks() const =0
Returns true if the kart has a plunger attached to its face.
virtual void startEngineSFX()=0
Starts the engine sound effect.
virtual const std::string & getIdent() const
Returns a unique identifier for this kart (name of the directory the kart was loaded from).
Definition: abstract_kart.cpp:197
virtual void beep()=0
Plays a beep sfx.
virtual void crashed(AbstractKart *k, bool update_attachments)=0
Called when the kart crashes against another kart.
virtual int getInitialPosition() const =0
Returns the initial position of this kart.
virtual const Controller * getController() const =0
Returns the controller of this kart (const version).
virtual void setSlowdown(unsigned int category, float max_speed_fraction, int fade_in_time)=0
Defines a slowdown, which is in fraction of top speed.
virtual float getCurrentMaxSpeed() const =0
Returns the current maximum speed for this kart, this includes all bonus and maluses that are current...
virtual void setPosition(int p)=0
Returns the current position of this kart in the race.
virtual float getHoT() const =0
Returns the height of the terrain.
const Attachment * getAttachment() const
Returns the current attachment.
Definition: abstract_kart.hpp:181
float m_kart_length
Length of the kart, copy of the data from KartModel.
Definition: abstract_kart.hpp:65
virtual bool setSquash(float time, float slowdown)=0
Squashes this kart: it will scale the kart in up direction, and causes a slowdown while this kart is ...
virtual bool isInRest() const =0
Returns true if the kart is 'resting', i.e.
virtual void setOnScreenText(const core::stringw &text)=0
Set a text that is displayed on top of a kart.
const HandicapLevel getHandicap() const
Returns the handicap of this kart.
Definition: abstract_kart.hpp:154
virtual void unsetSquash()=0
Makes the kart unsquashed again.
virtual const SlipStream * getSlipstream() const =0
Returns the slipstream object of this kart.
virtual float getMaxSteerAngle() const =0
Returns the maximum steering angle for this kart, which depends on the speed.
float m_kart_width
Width of the kart, copy of the data from KartModel.
Definition: abstract_kart.hpp:67
virtual void showStarEffect(float t)=0
Shows the star effect for a certain time.
virtual void handleZipper(const Material *m=NULL, bool play_sound=false)=0
Sets zipper time, and apply one time additional speed boost.
AbstractKartAnimation * m_kart_animation
A kart animation object to handle rescue, explosion etc.
Definition: abstract_kart.hpp:109
virtual void setSpeed(float s)=0
This is used on the client side only to set the speed of the kart from the server information.
virtual bool isOnGround() const =0
True if the wheels are touching the ground.
virtual const Material * getLastMaterial() const =0
Returns the previous material the kart was one (which might be the same as getMaterial() ).
virtual const Vec3 & getFrontXYZ() const =0
Returns the coordinates of the front of the kart.
virtual btTransform getAlignedTransform(const float customPitch=-1)=0
Returns a bullet transform object located at the kart's position and oriented in the direction the ka...
virtual bool isOnMinNitroTime() const =0
Return whether nitro is being used despite the nitro button not being pressed due to minimal use time...
float getKartHeight() const
Returns the height of the kart.
Definition: abstract_kart.hpp:196
float getHighestPoint() const
Returns the highest point of the kart (coordinate on up axis)
Definition: abstract_kart.hpp:202
virtual float getTerrainPitch(float heading) const =0
Returns the pitch of the terrain depending on the heading.
virtual bool isSquashed() const =0
Returns if the kart is currently being squashed.
const Vec3 & getWheelGraphicsPosition(int i) const
Returns the position of a wheel relative to the kart.
Definition: abstract_kart.hpp:225
virtual void increaseMaxSpeed(unsigned int category, float add_speed, float engine_force, int duration, int fade_out_time)=0
Sets an increased maximum speed for a category.
virtual btKart * getVehicle() const =0
Returns the bullet vehicle which represents this kart.
virtual Skidding * getSkidding()=0
Returns the skidding object for this kart (which can be used to query skidding related values),...
virtual const TerrainInfo * getTerrainInfo() const =0
Returns the terrain info oject.
virtual bool isGhostKart() const =0
Returns whether this kart is a ghost (replay) kart.
virtual const Vec3 & getRecentPreviousXYZ() const =0
Returns the most recent different previous position.
virtual bool isInvulnerable() const =0
Returns if the kart is invulnerable.
KartControl m_controls
The kart controls (e.g.
Definition: abstract_kart.hpp:106
virtual void setController(Controller *controller)=0
Saves the old controller in m_saved_controller and stores a new controller.
KartControl & getControls()
Returns all controls of this kart.
Definition: abstract_kart.hpp:133
irr::scene::IDummyTransformationSceneNode * m_wheel_box
Node between wheels and kart.
Definition: abstract_kart.hpp:112
std::unique_ptr< Attachment > m_attachment
Handles the attachment the kart might have.
Definition: abstract_kart.hpp:103
virtual void reset()
The reset position must be set before calling reset.
Definition: abstract_kart.cpp:70
virtual bool isShielded() const =0
Returns if the kart is protected by a shield.
void setHandicap(const HandicapLevel h)
Sets the handicap.
Definition: abstract_kart.hpp:157
virtual bool hasFinishedRace() const =0
Returns true if this kart has finished the race.
AbstractKartAnimation * getKartAnimation()
Returns a kart animation (if any), or NULL if currently no kart animation is being shown.
Definition: abstract_kart.hpp:233
virtual void collectedItem(ItemState *item_state)=0
Called when an item is collected.
unsigned int getWorldKartId() const
Returns the index of this kart in world.
Definition: abstract_kart.hpp:245
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
Contains the state information of an item, i.e.
Definition: item.hpp:53
Definition: item.hpp:324
Definition: kart_control.hpp:30
float getSteer() const
Returns the current steering value in [-1, 1].
Definition: kart_control.hpp:128
Definition: kart_data.hpp:12
Definition: kart_gfx.hpp:40
This class stores a 3D kart model.
Definition: kart_model.hpp:168
This class stores the properties of a kart.
Definition: kart_properties.hpp:60
Definition: material.hpp:48
Definition: moveable.hpp:46
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 buffer (data) for one kind of sound effects.
Definition: sfx_buffer.hpp:44
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
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:42