SuperTuxKart
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GhostKart Class Reference

A ghost kart. More...

#include <ghost_kart.hpp>

Inheritance diagram for GhostKart:
Inheritance graph
[legend]

Public Member Functions

 GhostKart (const std::string &ident, unsigned int world_kart_id, int position, float color_hue)
 
virtual void update (int ticks) OVERRIDE
 Updates the current event of the ghost kart using interpolation. More...
 
virtual void updateGraphics (float dt) OVERRIDE
 Called once per rendered frame. More...
 
virtual void reset () OVERRIDE
 Reset before a new race. More...
 
virtual void applyEngineForce (float force) OVERRIDE
 No physics for ghost kart. More...
 
virtual void createPhysics () OVERRIDE
 Creates the physical representation of this kart. More...
 
const float getSuspensionLength (int index, int wheel) const
 
void addReplayEvent (float time, const btTransform &trans, const ReplayBase::PhysicInfo &pi, const ReplayBase::BonusInfo &bi, const ReplayBase::KartReplayEvent &kre)
 
virtual bool isGhostKart () const OVERRIDE
 Returns whether this kart is a ghost (replay) kart. More...
 
virtual bool isInvulnerable () const OVERRIDE
 Ghost can't be hunted. More...
 
virtual float getSpeed () const OVERRIDE
 Returns the speed of the kart in meters/second. More...
 
float getGhostFinishTime ()
 Returns the finished time for a ghost kart. More...
 
virtual float getTimeForDistance (float distance) OVERRIDE
 Returns the time at which the kart was at a given distance. More...
 
float getTimeForEggs (int egg_number)
 Returns the smallest time at which the kart had the required number of eggs Returns -1.0f if none.
 
virtual void kartIsInRestNow () OVERRIDE
 Computes the transform of the graphical kart chasses with regards to the physical chassis. More...
 
virtual void makeKartRest () OVERRIDE
 Called before go phase to make sure all karts start at the same position in case there is a slope. More...
 
- Public Member Functions inherited from Kart
 Kart (const std::string &ident, unsigned int world_kart_id, int position, const btTransform &init_transform, HandicapLevel handicap, std::shared_ptr< RenderInfo > ri)
 The kart constructor. More...
 
virtual ~Kart ()
 The destructor frees the memory of this kart, but note that the actual kart model is still stored in the kart_properties (m_kart_model variable), so it is not reloaded).
 
virtual void init (RaceManager::KartType type) OVERRIDE
 This is a second initialisation phase, necessary since in the constructor virtual functions are not called for any superclasses. More...
 
virtual bool isInRest () const OVERRIDE
 Returns true if the kart is 'resting', i.e. More...
 
virtual void flyUp () OVERRIDE
 Enter flying mode.
 
virtual void flyDown () OVERRIDE
 
virtual void startEngineSFX () OVERRIDE
 Starts the engine sound effect. More...
 
virtual void collectedItem (ItemState *item) OVERRIDE
 Called when an item is collected. More...
 
virtual float getStartupBoostFromStartTicks (int ticks) const OVERRIDE
 Called the first time a kart accelerates after 'ready'. More...
 
virtual float getStartupBoost () const OVERRIDE
 
virtual void setStartupBoost (float val) OVERRIDE
 
virtual const MaterialgetMaterial () const OVERRIDE
 Returns the current material the kart is on. More...
 
virtual const MaterialgetLastMaterial () const OVERRIDE
 Returns the previous material the kart was one (which might be the same as getMaterial() ). More...
 
virtual float getTerrainPitch (float heading) const OVERRIDE
 Returns the pitch of the terrain depending on the heading. More...
 
virtual void handleZipper (const Material *m=NULL, bool play_sound=false) OVERRIDE
 Sets zipper time, and apply one time additional speed boost. More...
 
virtual bool setSquash (float time, float slowdown) OVERRIDE
 Squashes this kart: it will scale the kart in up direction, and causes a slowdown while this kart is squashed. More...
 
void setSquashGraphics ()
 
virtual void unsetSquash () OVERRIDE
 Makes the kart unsquashed again. More...
 
virtual void crashed (AbstractKart *k, bool update_attachments) OVERRIDE
 Called when the kart crashes against another kart. More...
 
virtual void crashed (const Material *m, const Vec3 &normal) OVERRIDE
 Kart hits the track with a given material. More...
 
virtual float getHoT () const OVERRIDE
 Returns the height of the terrain. More...
 
virtual void finishedRace (float time, bool from_server=false) OVERRIDE
 Sets that this kart has finished the race and finishing time. More...
 
virtual void setPosition (int p) OVERRIDE
 Sets the position in race this kart has . More...
 
virtual void beep () OVERRIDE
 Plays a beep sfx.
 
virtual void showZipperFire () OVERRIDE
 Show fire to go with a zipper.
 
virtual bool playCustomSFX (unsigned int type) OVERRIDE
 This function will play a particular character voice for this kart. More...
 
virtual void setController (Controller *controller) OVERRIDE
 Saves the old controller in m_saved_controller and stores a new controller. More...
 
virtual void setXYZ (const Vec3 &a) OVERRIDE
 Sets the XYZ coordinates of the moveable. More...
 
virtual void changeKart (const std::string &new_ident, HandicapLevel handicap, std::shared_ptr< RenderInfo > ri) OVERRIDE
 Change to new kart instancely (used in network live join). More...
 
virtual void adjustSpeed (float f) OVERRIDE
 Multiplies the velocity of the kart by a factor f (both linear and angular). More...
 
virtual void increaseMaxSpeed (unsigned int category, float add_speed, float engine_force, int duration, int fade_out_time) OVERRIDE
 Sets an increased maximum speed for a category. More...
 
virtual void instantSpeedIncrease (unsigned int category, float add_max_speed, float speed_boost, float engine_force, int duration, int fade_out_time) OVERRIDE
 This adjusts the top speed using increaseMaxSpeed, but additionally causes an instant speed boost, which can be smaller than add-max-speed. More...
 
virtual void setSlowdown (unsigned int category, float max_speed_fraction, int fade_in_time) OVERRIDE
 Defines a slowdown, which is in fraction of top speed. More...
 
virtual int getSpeedIncreaseTicksLeft (unsigned int category) const OVERRIDE
 Returns how much increased speed time is left over in the given category. More...
 
virtual float getCurrentMaxSpeed () const OVERRIDE
 Returns the current maximum speed for this kart, this includes all bonus and maluses that are currently applied. More...
 
virtual void setSpeed (float s) OVERRIDE
 This is used on the client side only to set the speed of the kart from the server information. More...
 
virtual float getMaxSteerAngle () const OVERRIDE
 Returns the maximum steering angle for this kart, which depends on the speed. More...
 
virtual float getTimeFullSteer (float steer) const OVERRIDE
 Returns the time till full steering is reached for this kart. More...
 
virtual float getSpeedForTurnRadius (float radius) const OVERRIDE
 Returns the (maximum) speed for a given turn radius. More...
 
virtual float getMaxSteerAngle (float speed) const
 Returns the maximum steering angle (depending on speed). More...
 
virtual const SkiddinggetSkidding () const OVERRIDE
 Returns the skidding object for this kart (which can be used to query skidding related values). More...
 
virtual SkiddinggetSkidding () OVERRIDE
 Returns the skidding object for this kart (which can be used to query skidding related values) - non-const. More...
 
virtual float getEnergy () const OVERRIDE
 Returns the remaining collected energy. More...
 
virtual void setEnergy (float val) OVERRIDE
 Sets the energy the kart has collected. More...
 
virtual bool isOnMinNitroTime () const OVERRIDE
 Return whether nitro is being used despite the nitro button not being pressed due to minimal use time requirements.
 
virtual void setPowerup (PowerupManager::PowerupType t, int n) OVERRIDE
 Sets a new powerup. More...
 
virtual void setLastUsedPowerup (PowerupManager::PowerupType t)
 Sets the last used powerup. More...
 
virtual const PowerupgetPowerup () const OVERRIDE
 Returns the current powerup. More...
 
virtual PowerupgetPowerup () OVERRIDE
 Returns the current powerup. More...
 
virtual PowerupManager::PowerupType getLastUsedPowerup () OVERRIDE
 Returns the last used powerup. More...
 
virtual int getNumPowerup () const OVERRIDE
 Returns the number of powerups. More...
 
virtual void setInvulnerableTicks (int ticks) OVERRIDE
 Makes a kart invulnerable for a certain amount of time. More...
 
virtual int getBlockedByPlungerTicks () const OVERRIDE
 Returns true if the kart has a plunger attached to its face. More...
 
virtual void blockViewWithPlunger () OVERRIDE
 Sets the view to blocked by a plunger. More...
 
virtual void setShieldTime (float t) OVERRIDE
 Enables a kart shield protection for a certain amount of time. More...
 
virtual bool isShielded () const OVERRIDE
 Returns if the kart is protected by a shield. More...
 
virtual float getShieldTime () const OVERRIDE
 Returns the remaining time the kart is protected by a shield. More...
 
virtual void decreaseShieldTime () OVERRIDE
 Decreases the kart's shield time. More...
 
virtual bool isSquashed () const OVERRIDE
 Returns if the kart is currently being squashed. More...
 
virtual void setBoostAI (bool boosted) OVERRIDE
 Sets the kart AI boost state. More...
 
virtual bool getBoostAI () const OVERRIDE
 Returns the kart AI boost state. More...
 
virtual ControllergetController () OVERRIDE
 Returns the controller of this kart. More...
 
const ControllergetController () const OVERRIDE
 Returns the controller of this kart (const version). More...
 
virtual const Vec3getFrontXYZ () const OVERRIDE
 Returns the coordinates of the front of the kart. More...
 
virtual btTransform getAlignedTransform (const float customPitch=-1) OVERRIDE
 Returns a bullet transform object located at the kart's position and oriented in the direction the kart is going. More...
 
const btTransform & getResetTransform () const
 Returns the start transform, i.e. More...
 
virtual bool isOnGround () const OVERRIDE
 True if the wheels are touching the ground. More...
 
bool isNearGround () const
 Returns true if the kart is close to the ground, used to dis/enable the upright constraint to allow for more realistic explosions. More...
 
virtual const Vec3getNormal () const OVERRIDE
 Returns the normal of the terrain the kart is over atm. More...
 
virtual const Vec3getPreviousXYZ () const OVERRIDE
 Returns the position 0.25s before.
 
virtual const Vec3getRecentPreviousXYZ () const OVERRIDE
 Returns a more recent different previous position.
 
virtual const float getRecentPreviousXYZTime () const OVERRIDE
 Returns the time at which the recent previous position occured.
 
bool isFlying () const
 For debugging only: check if a kart is flying. More...
 
virtual bool isJumping () const OVERRIDE
 Returns whether this kart is jumping. More...
 
virtual const TerrainInfogetTerrainInfo () const OVERRIDE
 Returns the terrain info oject. More...
 
virtual KartGFXgetKartGFX () OVERRIDE
 Returns a pointer to this kart's graphical effects. More...
 
virtual int getPosition () const OVERRIDE
 Returns the current position of this kart in the race. More...
 
virtual int getInitialPosition () const OVERRIDE
 Returns the initial position of this kart. More...
 
virtual float getFinishTime () const OVERRIDE
 Returns the finished time for a kart. More...
 
virtual bool hasFinishedRace () const OVERRIDE
 Returns true if this kart has finished the race. More...
 
const irr::video::SColor & getColor () const
 Returns the color used for this kart. More...
 
virtual RaceManager::KartType getType () const OVERRIDE
 
virtual btKartgetVehicle () const OVERRIDE
 Returns the bullet vehicle which represents this kart. More...
 
virtual btQuaternion getVisualRotation () const OVERRIDE
 
virtual const SlipStreamgetSlipstream () const OVERRIDE
 Returns the slipstream object of this kart. More...
 
virtual SlipStreamgetSlipstream () OVERRIDE
 Returns the slipstream object of this kart. More...
 
virtual void setSlipstreamEffect (float f) OVERRIDE
 Activates a slipstream effect, atm that is display some nitro. More...
 
virtual bool isEliminated () const OVERRIDE
 Returns true if the kart is eliminated. More...
 
virtual void eliminate () OVERRIDE
 Marks this kart to be eliminated. More...
 
virtual void setOnScreenText (const core::stringw &text) OVERRIDE
 Sets a text that is being displayed on top of a kart. More...
 
virtual bool getRaceResult () const OVERRIDE
 Returns whether this kart wins or loses. More...
 
void setRaceResult ()
 Set this kart race result. More...
 
SFXBasegetNextEmitter ()
 
virtual void playSound (SFXBuffer *buffer) OVERRIDE
 
virtual bool isVisible () const OVERRIDE
 
virtual void showStarEffect (float t) OVERRIDE
 Shows the star effect for a certain time. More...
 
virtual StarsgetStarsEffect () const OVERRIDE
 
int getNetworkConfirmedFinishTicks () const OVERRIDE
 Return the confirmed finish ticks (sent by the server) indicating that this kart has really finished the race. More...
 
- Public Member Functions inherited from AbstractKart
 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. More...
 
const core::stringw & getName () const
 Returns a name to be displayed for this kart. More...
 
virtual float getSteerPercent () const
 Returns the current steering value for this kart. More...
 
KartControlgetControls ()
 Returns all controls of this kart. More...
 
const KartControlgetControls () const
 Returns all controls of this kart - const version. More...
 
const KartPropertiesgetKartProperties () const
 Returns the kart properties of this kart. More...
 
const HandicapLevel getHandicap () const
 Returns the handicap of this kart. More...
 
void setHandicap (const HandicapLevel h)
 Sets the handicap. More...
 
virtual const std::string & getIdent () const
 Returns a unique identifier for this kart (name of the directory the kart was loaded from). More...
 
const AttachmentgetAttachment () const
 Returns the current attachment. More...
 
AttachmentgetAttachment ()
 Returns the current attachment, non-const version. More...
 
KartModelgetKartModel () const
 Returns this kart's kart model. More...
 
float getKartLength () const
 Returns the length of the kart. More...
 
float getKartHeight () const
 Returns the height of the kart. More...
 
float getKartWidth () const
 Returns the width of the kart. More...
 
float getHighestPoint () const
 Returns the highest point of the kart (coordinate on up axis)
 
bool isWheeless () const
 Returns true if this kart has no wheels. More...
 
const Vec3getWheelGraphicsPosition (int i) const
 Returns the position of a wheel relative to the kart. More...
 
AbstractKartAnimationgetKartAnimation ()
 Returns a kart animation (if any), or NULL if currently no kart animation is being shown. More...
 
const AbstractKartAnimationgetKartAnimation () const
 
virtual void setKartAnimation (AbstractKartAnimation *ka)
 Sets a new kart animation. More...
 
unsigned int getWorldKartId () const
 Returns the index of this kart in world. More...
 
int getLiveJoinUntilTicks () const
 
void setLiveJoinKart (int util_ticks)
 
- Public Member Functions inherited from Moveable
scene::ISceneNode * getNode () const
 Returns the scene node of this moveable. More...
 
void setNode (scene::ISceneNode *n)
 Sets the mesh for this model. More...
 
virtual const btVector3 & getVelocity () const
 
const btVector3 & getVelocityLC () const
 
virtual void setVelocity (const btVector3 &v)
 
const Vec3getXYZ () const
 
float getHeading () const
 Returns the heading between -pi and pi. More...
 
float getPitch () const
 Returns the pitch of the kart, restricted to between -pi/2 and pi/2. More...
 
float getRoll () const
 Returns the roll of the kart between -pi and pi. More...
 
const btQuaternion getRotation () const
 
virtual void stopFlying ()
 
void setRotation (const btMatrix3x3 &m)
 Sets the rotation of the physical body this moveable. More...
 
void setRotation (const btQuaternion &q)
 Sets the rotation of the physical body this moveable. More...
 
btRigidBody * getBody () const
 
void createBody (float mass, btTransform &trans, btCollisionShape *shape, float restitution)
 Creates the bullet rigid body for this moveable. More...
 
const btTransform & getTrans () const
 
void setTrans (const btTransform &t)
 Places this moveable at a certain location and stores this transform in this Moveable, so that it can be accessed easily. More...
 
void updatePosition ()
 Updates the current position and rotation. More...
 
void prepareSmoothing ()
 
void checkSmoothing ()
 
const btTransform & getSmoothedTrans () const
 
const Vec3getSmoothedXYZ () const
 
- Public Member Functions inherited from SmoothNetworkBody
 SmoothNetworkBody (bool enable=false)
 
void reset ()
 
void setEnable (bool val)
 
bool isEnabled () const
 
void setSmoothRotation (bool val)
 
void setAdjustVerticalOffset (bool val)
 
void prepareSmoothing (const btTransform &current_transform, const Vec3 &current_velocity)
 
void checkSmoothing (const btTransform &current_transform, const Vec3 &current_velocity)
 Adds a new error between graphical and physical position/rotation. More...
 
void updateSmoothedGraphics (const btTransform &current_transform, const Vec3 &current_velocity, float dt)
 
void setSmoothedTransform (const btTransform &t)
 
const btTransform & getSmoothedTrans () const
 
const Vec3getSmoothedXYZ () const
 
void setMinAdjustLength (float val)
 
void setMaxAdjustLength (float val)
 
void setMinAdjustSpeed (float val)
 
void setMaxAdjustTime (float val)
 
void setAdjustLengthThreshold (float val)
 

Private Member Functions

void computeFinishTime ()
 Compute the time at which the ghost finished the race.
 

Private Attributes

std::vector< btTransform > m_all_transform
 The transforms to assume at the corresponding time in m_all_times. More...
 
std::vector< ReplayBase::PhysicInfom_all_physic_info
 
std::vector< ReplayBase::BonusInfom_all_bonus_info
 
std::vector< ReplayBase::KartReplayEventm_all_replay_events
 
unsigned int m_last_egg_idx = 0
 

Additional Inherited Members

- Protected Member Functions inherited from Kart
void updatePhysics (int ticks)
 Updates the physics for this kart: computing the driving force, set steering, handles skidding, terrain impact on kart, ... More...
 
void handleMaterialSFX ()
 Plays any terrain specific sound effect.
 
void handleMaterialGFX (float dt)
 Handles material specific GFX, mostly particle effects. More...
 
void updateFlying ()
 Adjusts kart translation if the kart is flying (in debug mode).
 
void updateSliding ()
 Handles sliding, i.e. More...
 
void updateEnginePowerAndBrakes (int ticks)
 Sets the engine power. More...
 
void updateEngineSFX (float dt)
 Adjust the engine sound effect depending on the speed of the kart. More...
 
void updateSpeed ()
 Updates the local speed based on the current physical velocity. More...
 
void updateNitro (int ticks)
 Updates the current nitro status. More...
 
float applyAirFriction (float engine_power)
 Reduces the engine power according to speed. More...
 
float getActualWheelForce ()
 Simulates gears by adjusting the force of the engine. More...
 
void playCrashSFX (const Material *m, AbstractKart *k)
 Common code used when a kart or a material was hit. More...
 
void loadData (RaceManager::KartType type, bool animatedModel)
 Attaches the right model, creates the physics and loads all special effects (particle systems etc.) More...
 
void updateWeight ()
 This method is to be called every time the mass of the kart is updated, which includes attaching an anvil to the kart (and detaching).
 
- Protected Member Functions inherited from Moveable
void updateSmoothedGraphics (float dt)
 
virtual void updateGraphics (const Vec3 &off_xyz=Vec3(0.0f, 0.0f, 0.0f), const btQuaternion &off_rotation=btQuaternion(0.0f, 0.0f, 0.0f, 1.0f))
 Updates the graphics model. More...
 
- Protected Attributes inherited from Kart
float m_graphical_y_offset
 Offset of the graphical kart chassis from the physical chassis. More...
 
Vec3 m_xyz_front
 The coordinates of the front of the kart, used to determine when a new lap is triggered. More...
 
const float XYZ_HISTORY_TIME = 0.25f
 
int m_xyz_history_size
 
std::vector< Vec3m_previous_xyz
 The coordinates of the XYZ_HISTORY_SIZE previous positions.
 
std::vector< float > m_previous_xyz_times
 The times at which the previous positions occured. More...
 
float m_time_previous_counter
 
bool m_is_jumping
 Is time flying activated.
 
bool m_bubblegum_torque_sign
 The sign of torque to apply after hitting a bubble gum. More...
 
uint8_t m_bounce_back_ticks
 A short time after a collision acceleration is disabled to allow the karts to bounce back.
 
MaxSpeedm_max_speed
 Handles speed increase and capping due to powerup, terrain, ... More...
 
TerrainInfom_terrain_info
 Stores information about the terrain the kart is on. More...
 
Powerupm_powerup
 Handles the powerup of a kart. More...
 
std::unique_ptr< btVehicleRaycaster > m_vehicle_raycaster
 
std::unique_ptr< btKartm_vehicle
 
std::unique_ptr< Skiddingm_skidding
 This object handles all skidding. More...
 
std::unique_ptr< Starsm_stars_effect
 For stars rotating around head effect.
 
std::unique_ptr< Shadowm_shadow
 The shadow of a kart. More...
 
std::unique_ptr< SkidMarksm_skidmarks
 The skidmarks object for this kart. More...
 
std::unique_ptr< KartGFXm_kart_gfx
 All particle effects. More...
 
std::unique_ptr< SlipStreamm_slipstream
 Handles all slipstreaming. More...
 
std::unique_ptr< btCompoundShape, btCompoundShapeDeleterm_kart_chassis
 
ParticleEmitterm_collision_particles
 For collisions.
 
Controllerm_controller
 The main controller of this object, used for driving. More...
 
Controllerm_saved_controller
 This saves the original controller when the end controller is used. More...
 
PowerupManager::PowerupType m_last_used_powerup
 Remember the last used powerup type of a kart for AI purposes. More...
 
bool m_flying
 True if kart is flying (for debug purposes only). More...
 
bool m_has_caught_nolok_bubblegum
 Set when hitting bubblegum.
 
bool m_race_result
 True if the kart wins, false otherwise. More...
 
bool m_eliminated
 True if the kart is eliminated. More...
 
int m_initial_position
 Initial rank of the kart. More...
 
int m_race_position
 Current race position (1-num_karts). More...
 
float m_max_gear_rpm
 Maximum engine rpm's for the current gear. More...
 
int m_brake_ticks
 How long the brake key has been pressed - the longer the harder the kart will brake. More...
 
int16_t m_invulnerable_ticks
 Time a kart is invulnerable. More...
 
int16_t m_bubblegum_ticks
 If > 0 then bubble gum effect is on. More...
 
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 the time left before removing plunger.

More...
 
float m_current_lean
 Current leaning of the kart. More...
 
int8_t m_min_nitro_ticks
 To prevent using nitro in too short bursts.
 
bool m_fire_clicked
 True if fire button was pushed and not released.
 
bool m_boosted_ai
 True if the kart has been selected to have a boosted ai.
 
bool m_finished_race
 
float m_finish_time
 
float m_collected_energy
 The amount of energy collected with nitro cans. More...
 
float m_consumption_per_tick
 
float m_energy_to_min_ratio
 
float m_startup_boost
 
float m_falling_time
 
float m_weight
 
float m_speed
 The current speed (i.e. More...
 
float m_last_factor_engine_sound
 For smoothing engine sound.
 
float m_default_suspension_force
 For changeKart.
 
btTransform m_reset_transform
 Reset position. More...
 
std::vector< SFXBase * > m_custom_sounds
 
int m_emitter_id = 0
 
SFXBasem_emitters [EMITTER_COUNT]
 
SFXBasem_engine_sound
 
SFXBasem_terrain_sound
 Sound to be played depending on terrain. More...
 
const Materialm_last_sound_material
 The material for which the last sound effect was played. More...
 
SFXBasem_nitro_sound
 
SFXBasem_previous_terrain_sound
 A pointer to the previous terrain sound needs to be saved so that an 'older' sfx can be finished and an abrupt end of the sfx is avoided. More...
 
SFXBasem_skid_sound
 
SFXBufferm_horn_sound
 
SFXBufferm_crash_sounds [CRASH_SOUND_COUNT]
 
SFXBufferm_goo_sound
 
SFXBufferm_boing_sound
 
int m_ticks_last_crash
 
int m_ticks_last_zipper
 
RaceManager::KartType m_type
 
- Protected Attributes inherited from AbstractKart
btTransform m_starting_transform
 
int m_live_join_util
 
std::unique_ptr< KartPropertiesm_kart_properties
 The kart properties. More...
 
HandicapLevel m_handicap
 The handicap level of this kart. More...
 
std::unique_ptr< KartModelm_kart_model
 This stores a copy of the kart model. More...
 
std::unique_ptr< Attachmentm_attachment
 Handles the attachment the kart might have. More...
 
KartControl m_controls
 The kart controls (e.g. More...
 
AbstractKartAnimationm_kart_animation
 A kart animation object to handle rescue, explosion etc. More...
 
irr::scene::IDummyTransformationSceneNode * m_wheel_box
 Node between wheels and kart. More...
 
- Protected Attributes inherited from Moveable
btTransform m_transform
 The bullet transform of this rigid body. More...
 
UserPointer m_user_pointer
 
scene::ISceneNode * m_node
 
std::unique_ptr< btRigidBody > m_body
 
std::unique_ptr< KartMotionStatem_motion_state
 
- Static Protected Attributes inherited from Kart
static const int EMITTER_COUNT = 3
 
static const int CRASH_SOUND_COUNT = 3
 

Detailed Description

A ghost kart.

It does not have a phsyics representation. It gets two transforms from the replay objects at two consecutive time steps, and will interpolate between those positions depending on the current time

Member Function Documentation

◆ applyEngineForce()

virtual void GhostKart::applyEngineForce ( float  force)
inlinevirtual

No physics for ghost kart.

Reimplemented from Kart.

◆ createPhysics()

virtual void GhostKart::createPhysics ( )
inlinevirtual

Creates the physical representation of this kart.

Atm it uses the actual extention of the kart model to determine the size of the collision body.

Reimplemented from Kart.

◆ getGhostFinishTime()

float GhostKart::getGhostFinishTime ( )
inline

Returns the finished time for a ghost kart.

◆ getSpeed()

float GhostKart::getSpeed ( ) const
virtual

Returns the speed of the kart in meters/second.

Reimplemented from Kart.

◆ getTimeForDistance()

float GhostKart::getTimeForDistance ( float  distance)
virtual

Returns the time at which the kart was at a given distance.

Returns -1.0f if none

Reimplemented from AbstractKart.

◆ isGhostKart()

virtual bool GhostKart::isGhostKart ( ) const
inlinevirtual

Returns whether this kart is a ghost (replay) kart.

Reimplemented from Kart.

◆ isInvulnerable()

virtual bool GhostKart::isInvulnerable ( ) const
inlinevirtual

Ghost can't be hunted.

Reimplemented from Kart.

◆ kartIsInRestNow()

virtual void GhostKart::kartIsInRestNow ( )
inlinevirtual

Computes the transform of the graphical kart chasses with regards to the physical chassis.

This function is called once the kart comes to rest before the race starts (see World::resetAllKarts). Based on the current physical kart position it computes an (at this stage Y-only) offset by which the graphical chassis is moved so that it appears the way it is designed in blender. This means that the distance of the wheels from the chassis (i.e. suspension) appears as in blender when karts are in rest. See updateGraphics for more details.

Reimplemented from Kart.

◆ makeKartRest()

virtual void GhostKart::makeKartRest ( )
inlinevirtual

Called before go phase to make sure all karts start at the same position in case there is a slope.

Reimplemented from AbstractKart.

◆ reset()

void GhostKart::reset ( )
virtual

Reset before a new race.

It will remove all attachments, and puts the kart back at its original start position.

Reimplemented from Kart.

◆ update()

void GhostKart::update ( int  ticks)
virtual

Updates the current event of the ghost kart using interpolation.

Parameters
dtTime step size.

Reimplemented from Kart.

◆ updateGraphics()

void GhostKart::updateGraphics ( float  dt)
virtual

Called once per rendered frame.

It is used to only update any graphical effects.

Parameters
dtTime step size (since last call).

Reimplemented from Kart.

Member Data Documentation

◆ m_all_transform

std::vector<btTransform> GhostKart::m_all_transform
private

The transforms to assume at the corresponding time in m_all_times.


The documentation for this class was generated from the following files: