SAGE
A Simple Academic Game Engine
Loading...
Searching...
No Matches
Sage::CParticleEngine3D Class Reference

The 3D particle engine. More...

#include <SageParticleEngine.h>

Inheritance diagram for Sage::CParticleEngine3D:
Collaboration diagram for Sage::CParticleEngine3D:

Public Member Functions

 CParticleEngine3D (Sage::CCamera *=nullptr)
 Constructor.
 
void GetRenderList (std::vector< CSpriteDesc3D > &)
 Get render list.
 
- Public Member Functions inherited from Sage::CParticleEngine< CParticle3D, CParticleDesc3D, Vector3 >
 CParticleEngine ()
 Constructor.
 
virtual ~CParticleEngine ()
 Destructor.
 
void Create (const CParticleDesc3D &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 Vector3 &)
 Translate all particles.
 
void TranslateTo (const Vector3 &)
 Translate all particles to a point.
 
void SetOrigin (const Vector3 &)
 Set origin.
 

Private Attributes

Sage::CCameram_pCamera = nullptr
 Pointer to a camera.
 

Additional Inherited Members

- Protected Member Functions inherited from Sage::CParticleEngine< CParticle3D, CParticleDesc3D, Vector3 >
void Move ()
 Move all particles.
 
const float GetLifeFraction (const CParticle3D *) 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< CParticle3D, CParticleDesc3D, Vector3 >
std::list< CParticle3D * > m_stdList
 Particle list.
 
Vector3 m_vOrigin
 Origin in world space.
 
- Static Protected Attributes inherited from Sage::CComponent
static std::unique_ptr< CTimerm_pTimer = std::make_unique<CTimer>()
 Pointer to a timer.
 
static std::unique_ptr< CRandomm_pRandom = std::make_unique<CRandom>()
 Pointer to a PRNG.
 
static std::unique_ptr< CSoundm_pSound = std::make_unique<CSound>()
 Pointer to sound manager.
 
static std::unique_ptr< CKeyboardm_pKeyboard
 Pointer to a keyboard handler.
 
static std::unique_ptr< CMousem_pMouse = std::make_unique<CMouse>()
 Pointer to a mouse handler.
 
static std::unique_ptr< CControllerm_pController
 Pointer to a controller.
 

Detailed Description

The 3D particle engine can deliver a vector of 3D sprite descriptors that need to be rendered.

Constructor & Destructor Documentation

◆ CParticleEngine3D()

CParticleEngine3D::CParticleEngine3D ( Sage::CCamera * pCamera = nullptr)
Parameters
pCameraPointer to the camera, defaults to null.

Member Function Documentation

◆ GetRenderList()

void CParticleEngine3D::GetRenderList ( std::vector< CSpriteDesc3D > & renderlist)

Append the sprite descriptors of all particles to the end of a render list. If a pointer to the camera was provided in the constructor, then the sprite descriptors are first rotated to face the camera.

Parameters
renderlistA vector of 3D sprite descriptors.
Here is the call graph for this function: