SuperTuxKart
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
SkidMarks Class Reference

This class is responsible for drawing skid marks for a kart. More...

#include <skid_marks.hpp>

Inheritance diagram for SkidMarks:
Inheritance graph
[legend]

Classes

class  SkidMarkQuads
 

Public Member Functions

 SkidMarks (const AbstractKart &kart, float width=0.32f)
 Initialises empty skid marks.
 
 ~SkidMarks ()
 Removes all skid marks from the scene graph and frees the state.
 
void update (float dt, bool force_skid_marks=false, video::SColor *custom_color=NULL)
 Either adds to an existing skid mark quad, or (if the kart is skidding) starts a new skid mark quad.
 
void reset ()
 Removes all skid marks, called when a race is restarted.
 

Private Attributes

const AbstractKartm_kart
 Reference to the kart to which these skidmarks belong.
 
bool m_skid_marking
 True if the kart was skidding in the previous frame.
 
float m_width
 Reduce effect of Z-fighting.
 
Materialm_material
 Material to use for the skid marks.
 
std::shared_ptr< SP::SPShaderm_shader
 Shader(alphablend) to use for the skid marks.
 
std::vector< std::unique_ptr< SkidMarkQuads > > m_left
 Two skidmark objects for the left and right wheel.
 
std::vector< std::unique_ptr< SkidMarkQuads > > m_right
 

Static Private Attributes

static const int m_start_alpha = 200
 Initial alpha value.
 
static const int m_start_grey = 32
 Initial grey value, same for the 3 channels.
 
static float m_avoid_z_fighting = 0.005f
 Shared static so that consecutive skidmarks are at a slightly different height.
 

Detailed Description

This class is responsible for drawing skid marks for a kart.

Member Function Documentation

◆ update()

void SkidMarks::update ( float  dt,
bool  force_skid_marks = false,
video::SColor *  custom_color = NULL 
)

Either adds to an existing skid mark quad, or (if the kart is skidding) starts a new skid mark quad.

Parameters
dtTime step.

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