Pyrogenesis  trunk
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
CParticleEmitterType Class Reference

Particle emitter type - stores the common state data for all emitters of that type, and uses that data to update the emitter states. More...

#include <ParticleEmitterType.h>

Collaboration diagram for CParticleEmitterType:
Collaboration graph
[legend]

Public Member Functions

 CParticleEmitterType (const VfsPath &path, CParticleManager &manager)
 

Private Types

enum  {
  VAR_EMISSIONRATE, VAR_LIFETIME, VAR_POSITION_X, VAR_POSITION_Y,
  VAR_POSITION_Z, VAR_ANGLE, VAR_VELOCITY_X, VAR_VELOCITY_Y,
  VAR_VELOCITY_Z, VAR_VELOCITY_ANGLE, VAR_SIZE, VAR_SIZE_GROWTHRATE,
  VAR_COLOR_R, VAR_COLOR_G, VAR_COLOR_B, VAR__MAX
}
 
enum  BlendMode { BlendMode::ADD, BlendMode::SUBTRACT, BlendMode::OVERLAY, BlendMode::MULTIPLY }
 
typedef std::shared_ptr< IParticleVarIParticleVarPtr
 
typedef std::shared_ptr< IParticleEffectorIParticleEffectorPtr
 

Private Member Functions

 NONCOPYABLE (CParticleEmitterType)
 
int GetVariableID (const std::string &name)
 
bool LoadXML (const VfsPath &path)
 
void UpdateEmitter (CParticleEmitter &emitter, float dt)
 Update the state of an emitter's particles, by a potentially long time dt. More...
 
void UpdateEmitterStep (CParticleEmitter &emitter, float dt)
 Update the state of an emitter's particles, by a short time dt that can be computed in a single step. More...
 
CBoundingBoxAligned CalculateBounds (CVector3D emitterPos, CBoundingBoxAligned emittedBounds)
 

Private Attributes

CTexturePtr m_Texture
 
BlendMode m_BlendMode = BlendMode::ADD
 
bool m_StartFull
 
bool m_UseRelativeVelocity
 
float m_MaxLifetime
 
u16 m_MaxParticles
 
CBoundingBoxAligned m_MaxBounds
 
std::vector< IParticleVarPtrm_Variables
 
std::vector< IParticleEffectorPtrm_Effectors
 
CParticleManagerm_Manager
 

Friends

class CModelParticleEmitter
 
class CParticleEmitter
 
class CParticleVarConstant
 
class CParticleVarUniform
 
class CParticleVarCopy
 
class ParticleRenderer
 

Detailed Description

Particle emitter type - stores the common state data for all emitters of that type, and uses that data to update the emitter states.

The data is initialised from XML files.

Most of the emitter type data is represented as subclasses of IParticleVar, which will typically return a constant value or a random value each time it's evaluated. New subclasses can be added to support different random distributions, etc.

Member Typedef Documentation

◆ IParticleEffectorPtr

◆ IParticleVarPtr

typedef std::shared_ptr<IParticleVar> CParticleEmitterType::IParticleVarPtr
private

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
VAR_EMISSIONRATE 
VAR_LIFETIME 
VAR_POSITION_X 
VAR_POSITION_Y 
VAR_POSITION_Z 
VAR_ANGLE 
VAR_VELOCITY_X 
VAR_VELOCITY_Y 
VAR_VELOCITY_Z 
VAR_VELOCITY_ANGLE 
VAR_SIZE 
VAR_SIZE_GROWTHRATE 
VAR_COLOR_R 
VAR_COLOR_G 
VAR_COLOR_B 
VAR__MAX 

◆ BlendMode

enum CParticleEmitterType::BlendMode
strongprivate
Enumerator
ADD 
SUBTRACT 
OVERLAY 
MULTIPLY 

Constructor & Destructor Documentation

◆ CParticleEmitterType()

CParticleEmitterType::CParticleEmitterType ( const VfsPath path,
CParticleManager manager 
)

Member Function Documentation

◆ CalculateBounds()

CBoundingBoxAligned CParticleEmitterType::CalculateBounds ( CVector3D  emitterPos,
CBoundingBoxAligned  emittedBounds 
)
private

◆ GetVariableID()

int CParticleEmitterType::GetVariableID ( const std::string &  name)
private

◆ LoadXML()

bool CParticleEmitterType::LoadXML ( const VfsPath path)
private

◆ NONCOPYABLE()

CParticleEmitterType::NONCOPYABLE ( CParticleEmitterType  )
private

◆ UpdateEmitter()

void CParticleEmitterType::UpdateEmitter ( CParticleEmitter emitter,
float  dt 
)
private

Update the state of an emitter's particles, by a potentially long time dt.

◆ UpdateEmitterStep()

void CParticleEmitterType::UpdateEmitterStep ( CParticleEmitter emitter,
float  dt 
)
private

Update the state of an emitter's particles, by a short time dt that can be computed in a single step.

Friends And Related Function Documentation

◆ CModelParticleEmitter

friend class CModelParticleEmitter
friend

◆ CParticleEmitter

friend class CParticleEmitter
friend

◆ CParticleVarConstant

friend class CParticleVarConstant
friend

◆ CParticleVarCopy

friend class CParticleVarCopy
friend

◆ CParticleVarUniform

friend class CParticleVarUniform
friend

◆ ParticleRenderer

friend class ParticleRenderer
friend

Member Data Documentation

◆ m_BlendMode

BlendMode CParticleEmitterType::m_BlendMode = BlendMode::ADD
private

◆ m_Effectors

std::vector<IParticleEffectorPtr> CParticleEmitterType::m_Effectors
private

◆ m_Manager

CParticleManager& CParticleEmitterType::m_Manager
private

◆ m_MaxBounds

CBoundingBoxAligned CParticleEmitterType::m_MaxBounds
private

◆ m_MaxLifetime

float CParticleEmitterType::m_MaxLifetime
private

◆ m_MaxParticles

u16 CParticleEmitterType::m_MaxParticles
private

◆ m_StartFull

bool CParticleEmitterType::m_StartFull
private

◆ m_Texture

CTexturePtr CParticleEmitterType::m_Texture
private

◆ m_UseRelativeVelocity

bool CParticleEmitterType::m_UseRelativeVelocity
private

◆ m_Variables

std::vector<IParticleVarPtr> CParticleEmitterType::m_Variables
private

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