19#ifndef HEADER_KART_REWINDER_HPP
20#define HEADER_KART_REWINDER_HPP
22#include "karts/kart.hpp"
23#include "network/rewinder.hpp"
24#include "utils/cpp2011.hpp"
32 float m_prev_steering, m_steering_smoothing_dt, m_steering_smoothing_time;
34 bool m_has_server_state;
36 KartRewinder(
const std::string& ident,
unsigned int world_kart_id,
37 int position,
const btTransform& init_transform,
39 std::shared_ptr<GE::GERenderInfo> ri);
45 void reset() OVERRIDE;
48 virtual void update(
int ticks) OVERRIDE;
52 if (m_steering_smoothing_dt >= 0.0f)
55 (1.0f - m_steering_smoothing_dt) * m_prev_steering;
62 if (m_steering_smoothing_dt >= 0.0f)
64 m_steering_smoothing_dt += dt / m_steering_smoothing_time;
65 if (m_steering_smoothing_dt > 1.0f)
66 m_steering_smoothing_dt = -1.0f;
75 virtual std::function<void()> getLocalStateRestoreFunction() OVERRIDE;
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
virtual float getSteerPercent() const
Returns the current steering value for this kart.
Definition: abstract_kart.hpp:130
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
Definition: kart_rewinder.hpp:30
virtual float getSteerPercent() const OVERRIDE
Returns the current steering value for this kart.
Definition: kart_rewinder.hpp:50
virtual void restoreState(BareNetworkString *p, int count) OVERRIDE
Actually rewind to the specified state.
Definition: kart_rewinder.cpp:275
virtual void updateGraphics(float dt) OVERRIDE
Updates the graphics model.
Definition: kart_rewinder.hpp:60
virtual void computeError() OVERRIDE
Called when a rewind is finished, and is used to compute the error caused by the rewind (which is the...
Definition: kart_rewinder.cpp:101
virtual void saveTransform() OVERRIDE
This function is called immediately before a rewind is done and saves the current transform for the k...
Definition: kart_rewinder.cpp:88
virtual void undoEvent(BareNetworkString *p) OVERRIDE
Called when an event needs to be undone.
Definition: kart_rewinder.hpp:73
virtual void rewindToEvent(BareNetworkString *p) OVERRIDE
Called when an event needs to be replayed.
Definition: kart_rewinder.hpp:47
void reset() OVERRIDE
Resets status in case of a resetart.
Definition: kart_rewinder.cpp:66
virtual void update(int ticks) OVERRIDE
Called once a frame.
Definition: kart_rewinder.cpp:447
virtual void undoState(BareNetworkString *p) OVERRIDE
Undo the effects of the given state, but do not rewind to that state (which is done by rewindTo).
Definition: kart_rewinder.hpp:71
virtual BareNetworkString * saveState(std::vector< std::string > *ru) OVERRIDE
Saves all state information for a kart in a memory buffer.
Definition: kart_rewinder.cpp:165
The main kart class.
Definition: kart.hpp:69
virtual void updateGraphics(float dt) OVERRIDE
Updates the graphics model.
Definition: kart.cpp:3218
Definition: rewinder.hpp:44
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:42