The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
Public Member Functions | Private Attributes | List of all members
LParticleEngine3D Class Reference

The 3D particle engine. More...

#include <ParticleEngine.h>

Inheritance diagram for LParticleEngine3D:
LParticleEngine< LParticle3D, LParticleDesc3D, Vector3 > LComponent

Public Member Functions

 LParticleEngine3D (LBaseCamera *=nullptr)
 Constructor. More...
 
void GetRenderList (std::vector< LSpriteDesc3D > &)
 Get render list. More...
 
- Public Member Functions inherited from LParticleEngine< LParticle3D, LParticleDesc3D, Vector3 >
 LParticleEngine ()
 Constructor.
 
virtual ~LParticleEngine ()
 Destructor. More...
 
void create (const LParticleDesc3D &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 Vector3 &)
 Translate. More...
 

Private Attributes

LBaseCameram_pCamera = nullptr
 Pointer to a camera.
 

Additional Inherited Members

- Protected Member Functions inherited from LParticleEngine< LParticle3D, LParticleDesc3D, Vector3 >
void move ()
 Move all particles. More...
 
float GetLifeFraction (const LParticle3D *)
 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...
 
- Protected Attributes inherited from LParticleEngine< LParticle3D, LParticleDesc3D, Vector3 >
std::list< LParticle3D * > m_stdList
 Particle list.
 
- Static Protected Attributes inherited from LComponent
static LTimerm_pTimer = &cTimer
 Pointer to a timer. More...
 
static LRandomm_pRandom = &cRandom
 Pointer to a PRNG. More...
 
static LKeyboardm_pKeyboard = &cKeyboard
 Pointer to a keyboard handler. More...
 
static LXBoxControllerm_pController = &cController
 Pointer to a XBox controller. More...
 
static LSoundm_pAudio = &cAudio
 Pointer to an audio player. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ LParticleEngine3D()

LParticleEngine3D::LParticleEngine3D ( LBaseCamera pCamera = nullptr)
Parameters
pCameraPointer to the camera, defaults to null.

Member Function Documentation

◆ GetRenderList()

void LParticleEngine3D::GetRenderList ( std::vector< LSpriteDesc3D > &  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.