![]() |
SAGE
A Simple Academic Game Engine
|
The 2D particle engine. More...
#include <SageParticleEngine.h>


Public Member Functions | |
| CParticleEngine2D (CSpriteRenderer *) | |
| Constructor. | |
| void | Draw () |
| Draw particles. | |
Public Member Functions inherited from Sage::CParticleEngine< CParticle2D, CParticleDesc2D, Vector2 > | |
| CParticleEngine () | |
| Constructor. | |
| virtual | ~CParticleEngine () |
| Destructor. | |
| void | Create (const CParticleDesc2D &d) |
| Create particle. | |
| void | Step () |
| Animation step. | |
| void | Clear (float=0.1f) |
| Fade out all particles. | |
| void | Clear (UINT) |
| Clear out a particular kind of particle. | |
| void | Translate (const Vector2 &) |
| Translate all particles. | |
| void | TranslateTo (const Vector2 &) |
| Translate all particles to a point. | |
| void | SetOrigin (const Vector2 &) |
| Set origin. | |
Private Attributes | |
| CSpriteRenderer * | m_pRenderer = nullptr |
| Pointer to a 2D renderer. | |
Additional Inherited Members | |
Protected Member Functions inherited from Sage::CParticleEngine< CParticle2D, CParticleDesc2D, Vector2 > | |
| void | Move () |
| Move all particles. | |
| const float | GetLifeFraction (const CParticle2D *) const |
| Get life fraction. | |
| void | Cull () |
| Cull old dead particles. | |
| void | Rescale () |
| Compute new particle scales. | |
| void | Fade () |
| Compute new particle alpha channel. | |
Protected Attributes inherited from Sage::CParticleEngine< CParticle2D, CParticleDesc2D, Vector2 > | |
| std::list< CParticle2D * > | m_stdList |
| Particle list. | |
| Vector2 | m_vOrigin |
| Origin in world space. | |
Static Protected Attributes inherited from Sage::CComponent | |
| static std::unique_ptr< CTimer > | m_pTimer = std::make_unique<CTimer>() |
| Pointer to a timer. | |
| static std::unique_ptr< CRandom > | m_pRandom = std::make_unique<CRandom>() |
| Pointer to a PRNG. | |
| static std::unique_ptr< CSound > | m_pSound = std::make_unique<CSound>() |
| Pointer to sound manager. | |
| static std::unique_ptr< CKeyboard > | m_pKeyboard |
| Pointer to a keyboard handler. | |
| static std::unique_ptr< CMouse > | m_pMouse = std::make_unique<CMouse>() |
| Pointer to a mouse handler. | |
| static std::unique_ptr< CController > | m_pController |
| Pointer to a controller. | |
The 2D particle engine needs a pointer to a 2D renderer and will use this to draw particles.
| CParticleEngine2D::CParticleEngine2D | ( | CSpriteRenderer * | p | ) |
Save a pointer to the 2D renderer so that particles can be drawn on command.
| p | Pointer to the 2D renderer. |
| void CParticleEngine2D::Draw | ( | ) |
Draw all particles using the 2D renderer supplied in the constructor.
