19#ifndef HEADER_GHOST_KART_HPP
20#define HEADER_GHOST_KART_HPP
22#include "karts/kart.hpp"
23#include "replay/replay_play.hpp"
24#include "utils/cpp2011.hpp"
26#include "LinearMath/btTransform.h"
43 std::vector<ReplayBase::PhysicInfo> m_all_physic_info;
45 std::vector<ReplayBase::BonusInfo> m_all_bonus_info;
47 std::vector<ReplayBase::KartReplayEvent> m_all_replay_events;
51 unsigned int m_last_egg_idx;
57 GhostKart(
const std::string& ident,
unsigned int world_kart_id,
58 int position,
float color_hue,
60 virtual void update(
int ticks) OVERRIDE;
62 virtual void reset() OVERRIDE;
70 const float getSuspensionLength(
int index,
int wheel)
const
71 {
return m_all_physic_info[index].m_suspension_length[wheel]; }
73 void addReplayEvent(
float time,
74 const btTransform &trans,
86 virtual float getSpeed() const OVERRIDE;
108 {
return m_replay_data; }
A ghost kart.
Definition: ghost_kart.hpp:38
virtual bool isGhostKart() const OVERRIDE
Returns whether this kart is a ghost (replay) kart.
Definition: ghost_kart.hpp:80
float getGhostFinishTime()
Returns the finished time for a ghost kart.
Definition: ghost_kart.hpp:90
std::vector< btTransform > m_all_transform
The transforms to assume at the corresponding time in m_all_times.
Definition: ghost_kart.hpp:41
virtual void createPhysics() OVERRIDE
Creates the physical representation of this kart.
Definition: ghost_kart.hpp:68
virtual float getTimeForDistance(float distance) OVERRIDE
Returns the time at which the kart was at a given distance.
Definition: ghost_kart.cpp:279
virtual void applyEngineForce(float force) OVERRIDE
No physics for ghost kart.
Definition: ghost_kart.hpp:65
virtual bool isInvulnerable() const OVERRIDE
Ghost can't be hunted.
Definition: ghost_kart.hpp:83
float getTimeForEggs(int egg_number)
Returns the smallest time at which the kart had the required number of eggs Returns -1....
Definition: ghost_kart.cpp:357
virtual void reset() OVERRIDE
Reset before a new race.
Definition: ghost_kart.cpp:48
virtual void kartIsInRestNow() OVERRIDE
Computes the transform of the graphical kart chasses with regards to the physical chassis.
Definition: ghost_kart.hpp:103
virtual void update(int ticks) OVERRIDE
Updates the current event of the ghost kart using interpolation.
Definition: ghost_kart.cpp:107
void computeFinishTime()
Compute the time at which the ghost finished the race.
Definition: ghost_kart.cpp:258
virtual void makeKartRest() OVERRIDE
Called before go phase to make sure all karts start at the same position in case there is a slope.
Definition: ghost_kart.hpp:105
virtual void updateGraphics(float dt) OVERRIDE
Called once per rendered frame.
Definition: ghost_kart.cpp:90
virtual float getSpeed() const OVERRIDE
Returns the speed of the kart in meters/second.
Definition: ghost_kart.cpp:239
The main kart class.
Definition: kart.hpp:69
Definition: replay_play.hpp:57
Definition: replay_base.hpp:63
Records all other events.
Definition: replay_base.hpp:85
Definition: replay_base.hpp:50