SuperTuxKart
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. More...
 
 MovingTexture (core::matrix4 *matrix, float dx, float dy)
 Constructor for an animated texture, specifying the speed of the animation directly. More...
 
 MovingTexture (float dx, float dy)
 
virtual ~MovingTexture ()
 Destructor for an animated texture.
 
void setSpeed (float dx, float dy)
 Sets the speed of the animation. More...
 
void setTextureMatrix (core::matrix4 *matrix)
 Sets the texture matrix. More...
 
void setSPTM (float *sp_tm)
 
virtual void update (float dt)
 Updates the transform of an animated texture. More...
 
virtual void reset ()
 Resets at (re)start of a race.
 

Private Attributes

float m_dx
 Translation increment per second. More...
 
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. More...
 
float m_y
 
core::matrix4 * m_matrix
 The texture matrix of this texture. More...
 
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

◆ setSpeed()

void MovingTexture::setSpeed ( float  dx,
float  dy 
)
inline

Sets the speed of the animation.

◆ setTextureMatrix()

void MovingTexture::setTextureMatrix ( core::matrix4 *  matrix)
inline

Sets the texture matrix.

◆ update()

void MovingTexture::update ( float  dt)
virtual

Updates the transform of an animated texture.

Parameters
dtTime step size.

Member Data Documentation

◆ m_dx

float MovingTexture::m_dx
private

Translation increment per second.

◆ m_matrix

core::matrix4* MovingTexture::m_matrix
private

The texture matrix of this texture.

◆ m_x

float MovingTexture::m_x
private

Current x,y position.


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