SuperTuxKart
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 
29 namespace irr
30 {
31  namespace scene
32  {
33  class IDummyTransformationSceneNode;
34  }
35 }
36 
38 class Attachment;
39 class btKart;
40 class btQuaternion;
41 class Controller;
42 class Item;
43 class ItemState;
44 class KartGFX;
45 class KartModel;
46 class KartProperties;
47 class Material;
48 class Powerup;
49 class RenderInfo;
50 class SFXBuffer;
51 class Skidding;
52 class SlipStream;
53 class Stars;
54 class TerrainInfo;
55 
56 
61 class AbstractKart : public Moveable
62 {
63 private:
67  float m_kart_width;
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<RenderInfo> ri);
85 protected:
86  btTransform m_starting_transform;
87 
88  int m_live_join_util;
89 
91  std::unique_ptr<KartProperties> m_kart_properties;
92 
95 
99  std::unique_ptr<KartModel> m_kart_model;
100 
102  std::unique_ptr<Attachment> m_attachment;
103 
106 
109 
111  irr::scene::IDummyTransformationSceneNode *m_wheel_box;
112 public:
113  AbstractKart(const std::string& ident,
114  int world_kart_id,
115  int position, const btTransform& init_transform,
116  HandicapLevel handicap,
117  std::shared_ptr<RenderInfo> ri);
118  virtual ~AbstractKart();
119  // ------------------------------------------------------------------------
121  const core::stringw& getName() const { return m_name; }
122  // ------------------------------------------------------------------------
123  virtual void reset();
124  virtual void init(RaceManager::KartType type) = 0;
125  // ========================================================================
126  // Functions related to controlling the kart
127  // ------------------------------------------------------------------------
129  virtual float getSteerPercent() const { return m_controls.getSteer(); }
130  // ------------------------------------------------------------------------
133  // ------------------------------------------------------------------------
135  const KartControl& getControls() const { return m_controls; }
136 
137  // ========================================================================
138  // Access to the kart properties.
139  // ------------------------------------------------------------------------
142  { return m_kart_properties.get(); }
143  // ========================================================================
145  virtual void changeKart(const std::string& new_ident,
146  HandicapLevel handicap,
147  std::shared_ptr<RenderInfo> ri);
148  // ========================================================================
149  // Access to the handicap.
150  // ------------------------------------------------------------------------
152  const HandicapLevel getHandicap() const { return m_handicap; }
153  // ------------------------------------------------------------------------
155  void setHandicap(const HandicapLevel h) { m_handicap=h; }
156 
157  // ------------------------------------------------------------------------
160  virtual const std::string& getIdent() const;
161  // ------------------------------------------------------------------------
164  virtual float getMaxSteerAngle () const = 0;
165  // ------------------------------------------------------------------------
168  virtual float getSpeedForTurnRadius(float radius) const = 0;
169  // ------------------------------------------------------------------------
173  virtual float getTimeFullSteer(float steer) const = 0;
174 
175  // ========================================================================
176  // Attachment related functions.
177  // ------------------------------------------------------------------------
179  const Attachment* getAttachment() const {return m_attachment.get(); }
180  // ------------------------------------------------------------------------
183 
184  // ========================================================================
185  // Access to the graphical kart model.
186  // ------------------------------------------------------------------------
188  KartModel* getKartModel() const { return m_kart_model.get(); }
189  // ------------------------------------------------------------------------
191  float getKartLength() const { return m_kart_length; }
192  // ------------------------------------------------------------------------
194  float getKartHeight() const { return m_kart_height; }
195  // ------------------------------------------------------------------------
197  float getKartWidth() const {return m_kart_width; }
198  // ------------------------------------------------------------------------
200  float getHighestPoint() const { return m_kart_highest_point; }
201  // ------------------------------------------------------------------------
206  virtual void kartIsInRestNow();
207 
208  // ------------------------------------------------------------------------
211  virtual float getTimeForDistance(float distance);
212  // ------------------------------------------------------------------------
214  bool isWheeless() const;
215  // ------------------------------------------------------------------------
218  virtual const Vec3& getFrontXYZ() const = 0;
219  // ------------------------------------------------------------------------
223  const Vec3& getWheelGraphicsPosition(int i) const
224  {assert(i>=0 && i<4); return m_wheel_graphics_position[i];}
225 
226  // ========================================================================
227  // Emergency animation related functions.
228  // ------------------------------------------------------------------------
232  // ------------------------------------------------------------------------
234  { return m_kart_animation; }
235  // ------------------------------------------------------------------------
237  virtual void setKartAnimation(AbstractKartAnimation *ka);
238  // ------------------------------------------------------------------------
239 
240  // ------------------------------------------------------------------------
241  // ------------------------------------------------------------------------
243  unsigned int getWorldKartId() const { return m_world_kart_id; }
244  // ------------------------------------------------------------------------
249  virtual void setController(Controller *controller) = 0;
250  // ------------------------------------------------------------------------
252  virtual Controller* getController() = 0;
253  // ------------------------------------------------------------------------
255  virtual const Controller* getController() const = 0;
256  // ------------------------------------------------------------------------
259  virtual const Skidding *getSkidding() const = 0;
260  // ------------------------------------------------------------------------
261  virtual RaceManager::KartType getType() const = 0;
262  // ------------------------------------------------------------------------
265  virtual Skidding *getSkidding() = 0;
266  // ------------------------------------------------------------------------
268  virtual bool isEliminated() const = 0;
269  // ------------------------------------------------------------------------
271  virtual void eliminate() = 0;
272  // ------------------------------------------------------------------------
273  virtual void finishedRace(float time, bool from_server=false) = 0;
274  // ------------------------------------------------------------------------
276  virtual float getFinishTime() const = 0;
277  // ------------------------------------------------------------------------
279  virtual int getBlockedByPlungerTicks() const = 0;
280  // ------------------------------------------------------------------------
283  virtual void blockViewWithPlunger() = 0;
284  // ------------------------------------------------------------------------
286  virtual bool isSquashed() const = 0;
287  // ------------------------------------------------------------------------
293  virtual bool setSquash(float time, float slowdown) = 0;
294  // ------------------------------------------------------------------------
296  virtual void unsetSquash() = 0;
297  // ------------------------------------------------------------------------
301  virtual float getSpeed() const = 0;
302  // ------------------------------------------------------------------------
305  virtual float getCurrentMaxSpeed() const = 0;
306  // ------------------------------------------------------------------------
310  virtual int getSpeedIncreaseTicksLeft(unsigned int category) const = 0;
311 
312  // ------------------------------------------------------------------------
316  virtual void setBoostAI(bool boosted) = 0;
317 
318  // ------------------------------------------------------------------------
321  virtual bool getBoostAI() const = 0;
322 
323  // ------------------------------------------------------------------------
324 
332  virtual void increaseMaxSpeed(unsigned int category, float add_speed,
333  float engine_force, int duration,
334  int fade_out_time) = 0;
335 
336  // ----------------------------------------------------------------------------
348  virtual void instantSpeedIncrease(unsigned int category, float add_max_speed,
349  float speed_boost, float engine_force,
350  int duration, int fade_out_time) = 0;
351 
352  // ------------------------------------------------------------------------
357  virtual void setSlowdown(unsigned int category, float max_speed_fraction,
358  int fade_in_time) = 0;
359  // ------------------------------------------------------------------------
361  virtual float getEnergy() const = 0;
362  // ------------------------------------------------------------------------
366  virtual void collectedItem(ItemState *item_state) = 0;
367  // ------------------------------------------------------------------------
369  virtual int getPosition() const = 0;
370  // ------------------------------------------------------------------------
372  virtual void setPosition(int p) = 0;
373  // ------------------------------------------------------------------------
375  virtual int getInitialPosition() const = 0;
376  // ------------------------------------------------------------------------
378  virtual bool isOnGround() const = 0;
379  // ------------------------------------------------------------------------
381  virtual const SlipStream* getSlipstream() const = 0;
382  // ------------------------------------------------------------------------
384  virtual SlipStream* getSlipstream() = 0;
385  // ------------------------------------------------------------------------
387  virtual void setSlipstreamEffect(float f) = 0;
388  // ------------------------------------------------------------------------
390  virtual void beep() = 0;
391  // ------------------------------------------------------------------------
396  virtual bool playCustomSFX(unsigned int type) = 0;
397  // ------------------------------------------------------------------------
399  virtual void showZipperFire() = 0;
400  // ------------------------------------------------------------------------
405  virtual void handleZipper(const Material *m=NULL,
406  bool play_sound=false) = 0;
407  // ------------------------------------------------------------------------
409  virtual bool hasFinishedRace() const = 0;
410  // ------------------------------------------------------------------------
411  virtual void setEnergy(float val) = 0;
412  // ------------------------------------------------------------------------
416  virtual bool isOnMinNitroTime() const = 0;
417  // ------------------------------------------------------------------------
419  virtual const Material *getMaterial() const = 0;
420  // ------------------------------------------------------------------------
423  virtual const Material *getLastMaterial() const = 0;
424  // ------------------------------------------------------------------------
426  virtual const Powerup *getPowerup() const = 0;
427  // ------------------------------------------------------------------------
429  virtual Powerup *getPowerup() = 0;
430  // ------------------------------------------------------------------------
432  virtual PowerupManager::PowerupType getLastUsedPowerup() = 0;
433  // ------------------------------------------------------------------------
435  virtual int getNumPowerup() const = 0;
436  // ------------------------------------------------------------------------
438  virtual KartGFX* getKartGFX() = 0;
439  // ------------------------------------------------------------------------
440  virtual void setPowerup (PowerupManager::PowerupType t, int n) = 0;
441  // ------------------------------------------------------------------------
443  virtual btKart* getVehicle() const = 0;
444  // ------------------------------------------------------------------------
445  virtual btQuaternion getVisualRotation() const = 0;
446  // ------------------------------------------------------------------------
448  virtual bool isInRest() const = 0;
449  // ------------------------------------------------------------------------
452  virtual void startEngineSFX() = 0;
453  // ------------------------------------------------------------------------
457  virtual void adjustSpeed(float f) = 0;
458  // ------------------------------------------------------------------------
461  virtual void setSpeed(float s) = 0;
462  // ------------------------------------------------------------------------
464  virtual bool isInvulnerable() const = 0;
465  // ------------------------------------------------------------------------
466  virtual void setInvulnerableTicks(int ticks) = 0;
467  // ------------------------------------------------------------------------
469  virtual bool isShielded() const = 0;
470  // ------------------------------------------------------------------------
471  virtual void setShieldTime(float t) = 0;
472  // ------------------------------------------------------------------------
473  virtual float getShieldTime() const = 0;
474  // ------------------------------------------------------------------------
476  virtual void decreaseShieldTime() = 0;
477  // ------------------------------------------------------------------------
478 
480  virtual void showStarEffect(float t) = 0;
481  // ------------------------------------------------------------------------
483  virtual const TerrainInfo *getTerrainInfo() const = 0;
484  // ------------------------------------------------------------------------
489  virtual void crashed(AbstractKart *k, bool update_attachments) = 0;
490  // ------------------------------------------------------------------------
491  virtual void crashed(const Material *m, const Vec3 &normal) = 0;
492  // ------------------------------------------------------------------------
495  virtual const Vec3& getNormal() const = 0;
496  // ------------------------------------------------------------------------
498  virtual const Vec3& getPreviousXYZ() const = 0;
499  // ------------------------------------------------------------------------
501  virtual const Vec3& getRecentPreviousXYZ() const = 0;
502  // ------------------------------------------------------------------------
504  virtual const float getRecentPreviousXYZTime() const = 0;
505  // ------------------------------------------------------------------------
507  virtual float getHoT() const = 0;
508  // ------------------------------------------------------------------------
510  virtual float getTerrainPitch(float heading) const = 0;
511  // -------------------------------------------------------------------------
515  virtual btTransform getAlignedTransform(const float customPitch=-1) = 0;
516  // -------------------------------------------------------------------------
519  virtual void setOnScreenText(const core::stringw& text) = 0;
520  // ------------------------------------------------------------------------
522  virtual bool getRaceResult() const = 0;
523  // ------------------------------------------------------------------------
525  virtual bool isGhostKart() const = 0;
526  // ------------------------------------------------------------------------
528  virtual bool isJumping() const = 0;
529  // ------------------------------------------------------------------------
530  virtual void playSound(SFXBuffer* buffer) = 0;
531  // ------------------------------------------------------------------------
532  virtual bool isVisible() const = 0;
533  // ------------------------------------------------------------------------
534  virtual void makeKartRest();
535  // ------------------------------------------------------------------------
536  virtual void setStartupBoost(float val) = 0;
537  // ------------------------------------------------------------------------
538  virtual float getStartupBoost() const = 0;
539  // ------------------------------------------------------------------------
540  virtual float getStartupBoostFromStartTicks(int ticks) const = 0;
541  // ------------------------------------------------------------------------
542  virtual Stars* getStarsEffect() const = 0;
543  // ------------------------------------------------------------------------
544  int getLiveJoinUntilTicks() const { return m_live_join_util; }
545  // ------------------------------------------------------------------------
546  void setLiveJoinKart(int util_ticks) { m_live_join_util = util_ticks; }
547  // ------------------------------------------------------------------------
550  virtual int getNetworkConfirmedFinishTicks() const = 0;
551 }; // AbstractKart
552 
553 
554 #endif
555 
556 /* EOF */
virtual int getNumPowerup() const =0
Returns the number of powerups.
virtual bool hasFinishedRace() const =0
Returns true if this kart has finished the race.
unsigned int m_world_kart_id
Index of kart in world.
Definition: abstract_kart.hpp:76
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:39
virtual float getTimeFullSteer(float steer) const =0
Returns the time till full steering is reached for this kart.
Definition: kart_gfx.hpp:39
This is the base class for kart controller - that can be a player or a a robot.
Definition: controller.hpp:45
std::unique_ptr< Attachment > m_attachment
Handles the attachment the kart might have.
Definition: abstract_kart.hpp:102
AbstractKart(const std::string &ident, int world_kart_id, int position, const btTransform &init_transform, HandicapLevel handicap, std::shared_ptr< RenderInfo > ri)
Creates a kart.
Definition: abstract_kart.cpp:37
std::unique_ptr< KartModel > m_kart_model
This stores a copy of the kart model.
Definition: abstract_kart.hpp:99
virtual float getHoT() const =0
Returns the height of the terrain.
virtual bool isInRest() const =0
Returns true if the kart is 'resting', i.e.
virtual void decreaseShieldTime()=0
Decreases the kart's shield time.
unsigned int getWorldKartId() const
Returns the index of this kart in world.
Definition: abstract_kart.hpp:243
rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
Definition: btKart.hpp:31
const Vec3 * m_wheel_graphics_position
The position of all four wheels in the 3d model.
Definition: abstract_kart.hpp:73
virtual float getSteerPercent() const
Returns the current steering value for this kart.
Definition: abstract_kart.hpp:129
virtual float getSpeedForTurnRadius(float radius) const =0
Returns the (maximum) speed for a given turn radius.
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:34
const core::stringw & getName() const
Returns a name to be displayed for this kart.
Definition: abstract_kart.hpp:121
const Vec3 & getWheelGraphicsPosition(int i) const
Returns the position of a wheel relative to the kart.
Definition: abstract_kart.hpp:223
float getKartLength() const
Returns the length of the kart.
Definition: abstract_kart.hpp:191
virtual const Vec3 & getNormal() const =0
Returns the normal of the terrain the kart is over atm.
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 const Material * getLastMaterial() const =0
Returns the previous material the kart was one (which might be the same as getMaterial() ).
This objects is permanently available in a kart and stores information about addons.
Definition: attachment.hpp:51
virtual void setPosition(int p)=0
Returns the current position of this kart in the race.
virtual void unsetSquash()=0
Makes the kart unsquashed again.
virtual int getNetworkConfirmedFinishTicks() const =0
Return the confirmed finish ticks (sent by the server) indicating that this kart has really finished ...
virtual bool isSquashed() const =0
Returns if the kart is currently being squashed.
virtual const SlipStream * getSlipstream() const =0
Returns the slipstream object of this kart.
HandicapLevel m_handicap
The handicap level of this kart.
Definition: abstract_kart.hpp:94
virtual bool isOnMinNitroTime() const =0
Return whether nitro is being used despite the nitro button not being pressed due to minimal use time...
bool isWheeless() const
Returns true if this kart has no wheels.
Definition: abstract_kart.cpp:128
virtual bool getBoostAI() const =0
Returns the kart AI boost state.
KartType
Different kart types: A local player, a player connected via network, an AI kart, the leader kart (cu...
Definition: race_manager.hpp:236
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 void setKartAnimation(AbstractKartAnimation *ka)
Sets a new kart animation.
Definition: abstract_kart.cpp:140
irr::scene::IDummyTransformationSceneNode * m_wheel_box
Node between wheels and kart.
Definition: abstract_kart.hpp:111
float m_kart_width
Width of the kart, copy of the data from KartModel.
Definition: abstract_kart.hpp:67
float getHighestPoint() const
Returns the highest point of the kart (coordinate on up axis)
Definition: abstract_kart.hpp:200
const HandicapLevel getHandicap() const
Returns the handicap of this kart.
Definition: abstract_kart.hpp:152
The buffer (data) for one kind of sound effects.
Definition: sfx_buffer.hpp:45
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:123
AbstractKartAnimation * getKartAnimation()
Returns a kart animation (if any), or NULL if currently no kart animation is being shown.
Definition: abstract_kart.hpp:231
virtual void eliminate()=0
Marks this kart to be eliminated.
virtual bool isInvulnerable() const =0
Returns if the kart is invulnerable.
virtual float getTerrainPitch(float heading) const =0
Returns the pitch of the terrain depending on the heading.
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.
float getKartWidth() const
Returns the width of the kart.
Definition: abstract_kart.hpp:197
float getKartHeight() const
Returns the height of the kart.
Definition: abstract_kart.hpp:194
KartModel * getKartModel() const
Returns this kart's kart model.
Definition: abstract_kart.hpp:188
const Attachment * getAttachment() const
Returns the current attachment.
Definition: abstract_kart.hpp:179
AbstractKartAnimation * m_kart_animation
A kart animation object to handle rescue, explosion etc.
Definition: abstract_kart.hpp:108
virtual void changeKart(const std::string &new_ident, HandicapLevel handicap, std::shared_ptr< RenderInfo > ri)
Change to new kart instancely (used in network live join).
Definition: abstract_kart.cpp:109
Definition: powerup.hpp:37
KartControl m_controls
The kart controls (e.g.
Definition: abstract_kart.hpp:105
Definition: skidding.hpp:39
Definition: kart_control.hpp:29
virtual void adjustSpeed(float f)=0
Multiplies the velocity of the kart by a factor f (both linear and angular).
virtual const Powerup * getPowerup() const =0
Returns the current powerup.
const KartControl & getControls() const
Returns all controls of this kart - const version.
Definition: abstract_kart.hpp:135
virtual int getBlockedByPlungerTicks() const =0
Returns true if the kart has a plunger attached to its face.
virtual const Vec3 & getPreviousXYZ() const =0
Returns the position 0.25s before.
virtual void kartIsInRestNow()
Called after the kart comes to rest.
Definition: abstract_kart.cpp:178
KartControl & getControls()
Returns all controls of this kart.
Definition: abstract_kart.hpp:132
virtual const TerrainInfo * getTerrainInfo() const =0
Returns the terrain info oject.
virtual void setSlipstreamEffect(float f)=0
Activates a slipstream effect, atm that is display some nitro.
virtual bool isShielded() const =0
Returns if the kart is protected by a shield.
Definition: item.hpp:323
virtual void setBoostAI(bool boosted)=0
Sets the kart AI boost state.
This class stores information about the triangle that's under an object, i.e.
Definition: terrain_info.hpp:31
virtual void startEngineSFX()=0
Starts the engine sound effect.
This class is used to display rotating stars around a kart's head.
Definition: stars.hpp:40
virtual int getPosition() const =0
Returns the current position of this kart in the race.
virtual const Skidding * getSkidding() const =0
Returns the skidding object for this kart (which can be used to query skidding related values).
virtual float getEnergy() const =0
Returns the remaining collected energy.
This class stores a 3D kart model.
Definition: kart_model.hpp:167
core::stringw m_name
Name of the kart with translation.
Definition: abstract_kart.hpp:79
virtual const Vec3 & getRecentPreviousXYZ() const =0
Returns the most recent different previous position.
float m_kart_highest_point
Coordinate on up axis.
Definition: abstract_kart.hpp:71
float m_kart_height
Height of the kart, copy of the data from KartModel.
Definition: abstract_kart.hpp:69
virtual bool isEliminated() const =0
Returns true if the kart is eliminated.
virtual Controller * getController()=0
Returns the controller of this kart.
Definition: material.hpp:46
This class stores the properties of a kart.
Definition: kart_properties.hpp:60
virtual KartGFX * getKartGFX()=0
Returns a points to this kart's graphical effects.
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 bool isGhostKart() const =0
Returns whether this kart is a ghost (replay) kart.
void setHandicap(const HandicapLevel h)
Sets the handicap.
Definition: abstract_kart.hpp:155
virtual btKart * getVehicle() const =0
Returns the bullet vehicle which represents this kart.
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.
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 PowerupManager::PowerupType getLastUsedPowerup()=0
Returns the last used powerup type.
virtual const float getRecentPreviousXYZTime() const =0
Returns the time at which the recent previous position occured.
virtual float getSpeed() const =0
Returns the speed of the kart in meters/second.
virtual bool isOnGround() const =0
True if the wheels are touching the ground.
virtual int getInitialPosition() const =0
Returns the initial position of this kart.
virtual bool getRaceResult() const =0
Returns whether this kart wins or loses.
virtual void setOnScreenText(const core::stringw &text)=0
Set a text that is displayed on top of a kart.
virtual const Vec3 & getFrontXYZ() const =0
Returns the coordinates of the front of the kart.
virtual void collectedItem(ItemState *item_state)=0
Called when an item is collected.
virtual void blockViewWithPlunger()=0
Sets that the view is blocked by a plunger.
const KartProperties * getKartProperties() const
Returns the kart properties of this kart.
Definition: abstract_kart.hpp:141
float getSteer() const
Returns the current steering value in [-1, 1].
Definition: kart_control.hpp:128
virtual void setController(Controller *controller)=0
Saves the old controller in m_saved_controller and stores a new controller.
virtual float getTimeForDistance(float distance)
Returns the time at which the kart was at a given distance.
Definition: abstract_kart.cpp:170
Definition: render_info.hpp:27
virtual void beep()=0
Plays a beep sfx.
std::unique_ptr< KartProperties > m_kart_properties
The kart properties.
Definition: abstract_kart.hpp:91
Definition: moveable.hpp:44
virtual void crashed(AbstractKart *k, bool update_attachments)=0
Called when the kart crashes against another kart.
virtual float getMaxSteerAngle() const =0
Returns the maximum steering angle for this kart, which depends on the speed.
virtual void handleZipper(const Material *m=NULL, bool play_sound=false)=0
Sets zipper time, and apply one time additional speed boost.
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:189
The base class for all kart animation, like rescue, explosion, or cannon.
Definition: abstract_kart_animation.hpp:59
virtual void showStarEffect(float t)=0
Shows the star effect for a certain time.
float m_kart_length
Length of the kart, copy of the data from KartModel.
Definition: abstract_kart.hpp:65
virtual void showZipperFire()=0
Show fire to go with a zipper.
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.
Contains the state information of an item, i.e.
Definition: item.hpp:52
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:61
virtual float getCurrentMaxSpeed() const =0
Returns the current maximum speed for this kart, this includes all bonus and maluses that are current...
virtual bool playCustomSFX(unsigned int type)=0
This function will play a particular character voice for this kart.
Attachment * getAttachment()
Returns the current attachment, non-const version.
Definition: abstract_kart.hpp:182
virtual void reset()
The reset position must be set before calling reset.
Definition: abstract_kart.cpp:59
Definition: slip_stream.hpp:47
virtual float getFinishTime() const =0
Returns the finished time for a kart.
virtual int getSpeedIncreaseTicksLeft(unsigned int category) const =0
Returns how much increased speed time is left over in the given category.