19#ifndef HEADER_SLIP_STREAM_HPP
20#define HEADER_SLIP_STREAM_HPP
25 namespace video {
class SMaterial;
class SColor; }
26 namespace scene {
class ISceneNode;
class IAnimatedMesh; }
32 class SPDynamicDrawCall;
36#include "graphics/moving_texture.hpp"
37#include "utils/no_copy.hpp"
96 int m_previous_target_id;
97 int m_speed_increase_ticks;
98 int m_speed_increase_duration;
119 scene::IAnimatedMesh*
createMesh(
unsigned material_id,
bool bonus_mesh);
123 void updateSlipstreamingTextures(
float f,
const AbstractKart* kart);
124 void updateBonusTexture();
132 void updateSpeedIncrease();
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Definition: material.hpp:48
Handles animated textures (textures that move)
Definition: moving_texture.hpp:34
Definition: sp_mesh.hpp:44
Definition: slip_stream.hpp:48
enum SlipStream::@7 m_slipstream_mode
Slipstream mode: either nothing happening, or the kart is collecting 'slipstream credits'.
MovingTexture * m_moving
The moving texture for the normal node.
Definition: slip_stream.hpp:55
int m_current_target_id
Used to trigger automatically the slipstreaming bonus.
Definition: slip_stream.hpp:95
void updateQuad()
UpdateQuad.
Definition: slip_stream.cpp:712
AbstractKart * m_target_kart
The kart from which this kart gets slipstream.
Definition: slip_stream.hpp:116
SP::SPMesh * createMeshSP(unsigned material_id, bool bonus_mesh)
Creates the mesh for the slipstream effect.
Definition: slip_stream.cpp:424
scene::ISceneNode * m_node
The scene node.
Definition: slip_stream.hpp:66
const AbstractKart * getSlipstreamTarget() const
Returns the kart from which slipstream is 'collected'.
Definition: slip_stream.hpp:139
std::shared_ptr< SP::SPDynamicDrawCall > m_debug_dc2
For debugging: a simple quad to display where inner slipstream works.
Definition: slip_stream.hpp:78
std::shared_ptr< SP::SPDynamicDrawCall > m_debug_dc
For debugging: a simple quad to display where slipstream works.
Definition: slip_stream.hpp:75
bool isSlipstreamReady() const
Returns true if enough slipstream credits have been accumulated to get a boost when leaving the slips...
Definition: slip_stream.cpp:662
void setDebugColor(const video::SColor &color, bool inner)
Sets the color of the debug mesh (which shows the area in which slipstream can be accumulated).
Definition: slip_stream.cpp:677
Quad * m_slipstream_quad
This is slipstream area if the kart is at 0,0,0 without rotation.
Definition: slip_stream.hpp:105
MovingTexture * m_moving_fast
The moving texture for the fast node.
Definition: slip_stream.hpp:59
float m_bonus_time
The remaining active time bonus.
Definition: slip_stream.hpp:88
scene::ISceneNode * m_node_fast
The fast scene node.
Definition: slip_stream.hpp:69
AbstractKart * m_kart
The kart to which this smoke belongs.
Definition: slip_stream.hpp:51
scene::IAnimatedMesh * createMesh(unsigned material_id, bool bonus_mesh)
Creates the mesh for the slipstream effect.
Definition: slip_stream.cpp:283
scene::ISceneNode * m_bonus_node
The node used when the bonus is active.
Definition: slip_stream.hpp:72
float m_length
The length of the slipstream cylinder.
Definition: slip_stream.hpp:82
bool m_bonus_active
This bool is used to know the first time we're going out of the slipstreaming area.
Definition: slip_stream.hpp:91
void reset()
Called at re-start of a race.
Definition: slip_stream.cpp:265
MovingTexture * m_moving_bonus
The moving texture for the fast node.
Definition: slip_stream.hpp:63
void update(int ticks)
Update, called once per timestep.
Definition: slip_stream.cpp:853
Quad * m_slipstream_inner_quad
This is the inner slipstream area if the kart is at 0,0,0 without rotation.
Definition: slip_stream.hpp:108
const Quad & getSlipstreamQuad() const
Returns the quad in which slipstreaming is effective for this kart.
Definition: slip_stream.hpp:136
bool inUse() const
Returns if slipstream is being used.
Definition: slip_stream.hpp:142
float m_slipstream_time
The time a kart was in slipstream.
Definition: slip_stream.hpp:85
Quad * m_slipstream_outer_quad
This is the outer slipstream area if the kart is at 0,0,0 without rotation.
Definition: slip_stream.hpp:112
~SlipStream()
Removes the node from the scene graph.
Definition: slip_stream.cpp:221