![]() |
The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
|
The 2D particle engine. More...
#include <ParticleEngine.h>
Public Member Functions | |
LParticleEngine2D (LSpriteRenderer *) | |
Constructor. More... | |
void | Draw () |
Draw particles. More... | |
![]() | |
LParticleEngine () | |
Constructor. | |
virtual | ~LParticleEngine () |
Destructor. More... | |
void | create (const LParticleDesc2D &d) |
Create particle. More... | |
void | step () |
Animation step. More... | |
void | clear (float=0.1f) |
Fade out all particles. More... | |
void | clear (UINT) |
Clear out a particular kind of particle. More... | |
void | translate (const Vector2 &) |
Translate. More... | |
Private Attributes | |
LSpriteRenderer * | m_pRenderer = nullptr |
Pointer to a 2D renderer. | |
Additional Inherited Members | |
![]() | |
void | move () |
Move all particles. More... | |
float | GetLifeFraction (const LParticle2D *) |
Get life fraction. More... | |
void | cull () |
Cull old dead particles. More... | |
void | rescale () |
Compute new particle scales. More... | |
void | fade () |
Compute new particle alpha channel. More... | |
![]() | |
std::list< LParticle2D * > | m_stdList |
Particle list. | |
![]() | |
static LTimer * | m_pTimer = &cTimer |
Pointer to a timer. More... | |
static LRandom * | m_pRandom = &cRandom |
Pointer to a PRNG. More... | |
static LKeyboard * | m_pKeyboard = &cKeyboard |
Pointer to a keyboard handler. More... | |
static LXBoxController * | m_pController = &cController |
Pointer to a XBox controller. More... | |
static LSound * | m_pAudio = &cAudio |
Pointer to an audio player. More... | |
The 2D particle engine needs a pointer to a 2D renderer and will use this to draw particles.
LParticleEngine2D::LParticleEngine2D | ( | LSpriteRenderer * | p | ) |
Save a pointer to the 2D renderer so that particles can be drawn on command.
p | Pointer to the 2D renderer. |
void LParticleEngine2D::Draw | ( | ) |
Draw all particles using the 2D renderer supplied in the constructor.