The Joe Engine
Joe's engine programming playground
JoeEngine::JEParticleSystem Class Reference

The Particle System class. More...

#include <ParticleSystem.h>

Public Member Functions

 JEParticleSystem ()=delete
 Default constructor (deleted). More...
 
 JEParticleSystem (const JEParticleSystemSettings &settings)
 Constructor. More...
 
 ~JEParticleSystem ()=default
 Destructor (default). More...
 
const std::vector< JEMeshPointVertexGetVertices ()
 Get particle vertices. More...
 
const std::vector< uint32_t > & GetIndices () const
 Get indices list. More...
 
const MeshComponentGetMeshComponent () const
 Get mesh component. More...
 
const MaterialComponentGetMaterialComponent () const
 Get material component. More...
 
std::vector< glm::vec3 > & GetPositionData ()
 Get all position data. More...
 
std::vector< glm::vec3 > & GetVelocityData ()
 Get all velocity data. More...
 
std::vector< glm::vec3 > & GetAccelData ()
 Get all acceleration data. More...
 
std::vector< float > & GetLifetimeData ()
 Get all lifetime data. More...
 
uint32_t GetNumParticles () const
 Get number of particles in system (never changes). More...
 

Friends

class JEPhysicsManager
 Physics manager can access private members. More...
 
class JEEngineInstance
 The engine instance can access private members. More...
 

Detailed Description

The Particle System class.

Class that manages the data for a particle system. Position/velocity/acceleration data are all stored in their own linear, contiguous memory containers. Also manages rendering resources like Mesh/Material Components (should change in the future).

Constructor & Destructor Documentation

◆ JEParticleSystem() [1/2]

JoeEngine::JEParticleSystem::JEParticleSystem ( )
delete

Default constructor (deleted).

◆ JEParticleSystem() [2/2]

JoeEngine::JEParticleSystem::JEParticleSystem ( const JEParticleSystemSettings settings)
inline

Constructor.

Initializes important data and populates the various particle data lists.

◆ ~JEParticleSystem()

JoeEngine::JEParticleSystem::~JEParticleSystem ( )
default

Destructor (default).

Member Function Documentation

◆ GetAccelData()

std::vector<glm::vec3>& JoeEngine::JEParticleSystem::GetAccelData ( )
inline

Get all acceleration data.

/return reference to the list of acceleration data.

◆ GetIndices()

const std::vector<uint32_t>& JoeEngine::JEParticleSystem::GetIndices ( ) const
inline

Get indices list.

/return const-reference to the list of indices.

◆ GetLifetimeData()

std::vector<float>& JoeEngine::JEParticleSystem::GetLifetimeData ( )
inline

Get all lifetime data.

/return reference to the list of lifetime data.

◆ GetMaterialComponent()

const MaterialComponent& JoeEngine::JEParticleSystem::GetMaterialComponent ( ) const
inline

Get material component.

/return const-reference to the material component.

◆ GetMeshComponent()

const MeshComponent& JoeEngine::JEParticleSystem::GetMeshComponent ( ) const
inline

Get mesh component.

/return const-reference to the mesh component.

◆ GetNumParticles()

uint32_t JoeEngine::JEParticleSystem::GetNumParticles ( ) const
inline

Get number of particles in system (never changes).

/return number of particles in the system.

◆ GetPositionData()

std::vector<glm::vec3>& JoeEngine::JEParticleSystem::GetPositionData ( )
inline

Get all position data.

/return reference to the list of position data.

◆ GetVelocityData()

std::vector<glm::vec3>& JoeEngine::JEParticleSystem::GetVelocityData ( )
inline

Get all velocity data.

/return reference to the list of velocity data.

◆ GetVertices()

const std::vector<JEMeshPointVertex> JoeEngine::JEParticleSystem::GetVertices ( )
inline

Get particle vertices.

Return an up-to-date list of particle positions for rendering. Also resets particle data if lifetime is over. Note: particles not deleted when their lifetime is over, they just reset to the origin of the system with a new lifetime.

Returns
the updated list of position data.

Friends And Related Function Documentation

◆ JEEngineInstance

friend class JEEngineInstance
friend

The engine instance can access private members.

◆ JEPhysicsManager

friend class JEPhysicsManager
friend

Physics manager can access private members.


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