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

Handles animated textures (textures that move) More...

#include <moving_texture.hpp>

Inheritance diagram for MovingTexture:
Inheritance graph
[legend]

Public Member Functions

 MovingTexture (core::matrix4 *matrix, const XMLNode &node)
 Constructor for an animated texture.
 
 MovingTexture (core::matrix4 *matrix, float dx, float dy)
 Constructor for an animated texture, specifying the speed of the animation directly.
 
 MovingTexture (float dx, float dy)
 
virtual ~MovingTexture ()
 Destructor for an animated texture.
 
void setSpeed (float dx, float dy)
 Sets the speed of the animation.
 
void setTextureMatrix (core::matrix4 *matrix)
 Sets the texture matrix.
 
void setSPTM (float *sp_tm)
 
virtual void update (float dt)
 Updates the transform of an animated texture.
 
virtual void reset ()
 Resets at (re)start of a race.
 

Private Attributes

float m_dx
 Translation increment per second.
 
float m_dy
 
float m_dt
 Delta set by user and count.
 
float m_count
 
bool m_isAnimatedByStep
 
float m_x
 Current x,y position.
 
float m_y
 
core::matrix4 * m_matrix
 The texture matrix of this texture.
 
float * m_sp_tm
 

Detailed Description

Handles animated textures (textures that move)

Constructor & Destructor Documentation

◆ MovingTexture() [1/2]

MovingTexture::MovingTexture ( core::matrix4 *  matrix,
const XMLNode node 
)

Constructor for an animated texture.

Parameters
matrixThe texture matrix to modify.
nodeAn XML node containing dx and dy attributes to set the speed of the animation.

◆ MovingTexture() [2/2]

MovingTexture::MovingTexture ( core::matrix4 *  matrix,
float  dx,
float  dy 
)

Constructor for an animated texture, specifying the speed of the animation directly.

Parameters
matrixThe texture matrix to modify.
dxSpeed of the animation in X direction.
dySpeed of the animation in Y direction.

Member Function Documentation

◆ update()

void MovingTexture::update ( float  dt)
virtual

Updates the transform of an animated texture.

Parameters
dtTime step size.

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