NWengine 0.9
Loading...
Searching...
No Matches
ParticleSystem Class Reference

Represents a particle system component that can be attached to a game object. More...

#include <Components.h>

Inheritance diagram for ParticleSystem:
GameComponent Serialized

Public Member Functions

 ParticleSystem (GameObject *attachedObj)
 
void Update ()
 Updates the particle system.
 
void UpdateParticle (int index)
 Updates a particle.
 
void Emit ()
 Emits particles.
 
void Init ()
 Initializes the particle system.
 
void InitParticle ()
 Initializes a particle.
 
int Serialize (std::fstream *data, int offset) override
 Serializes the particle system.
 
int Deserialize (std::fstream *data, int offset) override
 Deserializes the particle system.
 
- Public Member Functions inherited from GameComponent
virtual void Start ()
 Start the game component.
 
virtual void SetGameObject (void *go)
 Set the GameObject associated with the game component.
 
virtual voidGetGameObject ()
 Get the GameObject associated with the game component.
 
virtual ~GameComponent ()
 Destructor for the game component.
 
- Public Member Functions inherited from Serialized
 Serialized ()
 Default constructor for Serialized class.
 

Static Public Member Functions

static std::string GetType ()
 
- Static Public Member Functions inherited from GameComponent
static std::string GetType ()
 Get the type of the game component.
 

Public Attributes

GameObjectattachedObj = nullptr
 
bool isActive = true
 
std::deque< Particlepool
 
std::deque< intdisabled
 
std::deque< intenabled
 
int maxParticles = 100
 
double emissionFrequency = 1.0
 
uint16 emissionQuantity = 1
 
int initNum = 5
 
ParticleProperties prop
 
bool recycle = 1
 
std::string shader = SHADER_PARTICLES_DEFAULT
 
std::string texture = TEXTURE_PARTICLES_DEFAULT
 

Static Public Attributes

static std::map< GameObject *, ParticleSystemcomponentList
 

Detailed Description

Represents a particle system component that can be attached to a game object.

Represents a particle system.

Member Function Documentation

◆ Deserialize()

int ParticleSystem::Deserialize ( std::fstream * data,
int offset )
overridevirtual

Deserializes the particle system.

Parameters
dataThe data stream to deserialize from.
offsetThe offset in the data stream.
Returns
The deserialized size.

Reimplemented from Serialized.

◆ Serialize()

int ParticleSystem::Serialize ( std::fstream * data,
int offset )
overridevirtual

Serializes the particle system.

Parameters
dataThe data stream to serialize to.
offsetThe offset in the data stream.
Returns
The serialized size.

Reimplemented from Serialized.

◆ Update()

void ParticleSystem::Update ( )
virtual

Updates the particle system.

Reimplemented from GameComponent.

◆ UpdateParticle()

void ParticleSystem::UpdateParticle ( int index)

Updates a particle.

Parameters
indexThe index of the particle to update.

Member Data Documentation

◆ attachedObj

GameObject* ParticleSystem::attachedObj = nullptr

The attached game object

◆ componentList

std::map< GameObject *, ParticleSystem > ParticleSystem::componentList
static

The list of particle systems

◆ disabled

std::deque<int> ParticleSystem::disabled

The disabled particles

◆ emissionFrequency

double ParticleSystem::emissionFrequency = 1.0

The emission frequency

◆ emissionQuantity

uint16 ParticleSystem::emissionQuantity = 1

The emission quantity

◆ enabled

std::deque<int> ParticleSystem::enabled

The enabled particles

◆ initNum

int ParticleSystem::initNum = 5

The initial number of particles

◆ isActive

bool ParticleSystem::isActive = true

Indicates if the particle system is active

◆ maxParticles

int ParticleSystem::maxParticles = 100

The maximum number of particles

◆ pool

std::deque<Particle> ParticleSystem::pool

The pool of particles

◆ prop

ParticleProperties ParticleSystem::prop

The properties of the particle system

◆ recycle

bool ParticleSystem::recycle = 1

Indicates if particles should be recycled

◆ shader

std::string ParticleSystem::shader = SHADER_PARTICLES_DEFAULT

The shader for the particle system

◆ texture

std::string ParticleSystem::texture = TEXTURE_PARTICLES_DEFAULT

The texture for the particle system


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