20 friend void Particle::Update(
const GameTime *pGameTime);
21 friend void Particle::Draw(
SpriteBatch *pSpriteBatch);
67 m_it = m_particles.begin();
68 for (; m_it != m_particles.end(); ++m_it)
70 bool active = (*m_it)->IsActive();
71 if (!active)
return (
T *)(*m_it);
74 if (m_poolExpands)
return GenerateParticles<T>();
86 for (
int i = 0; i < count; ++i)
91 m_particles.push_back(pParticle);
102 float m_pParticleLifespan;
104 std::vector<Particle *> m_particles;
105 std::vector<Particle *>::iterator m_it;
Represents a 2D grid of texels.
Definition: Texture.h:17
virtual void SetParticleLifespan(const float seconds)
Sets the lifespan of the particle in seconds.
Definition: ParticleTemplate.h:51
virtual void UpdateParticle(Particle *pParticle, const GameTime *pGameTime)
Updates a particle.
Definition: ParticleTemplate.h:60
virtual void SetTexture(Texture *pTexture)
Sets the texture.
Definition: ParticleTemplate.h:40
ParticleTemplate(const bool poolExpands=true)
Instantiates a new particle template object.
Definition: ParticleTemplate.cpp:16
virtual void InitializeParticle(Particle *pParticle)
Initializes a particle.
Definition: ParticleTemplate.cpp:28
T * GetInactiveParticleOfType()
Gets a particle of a specific type.
Definition: ParticleTemplate.h:65
Contains timing values for game updates and rendering.
Definition: GameTime.h:17
Base class for particle templates which are used to control the updating of a corresponding particle ...
Definition: ParticleTemplate.h:17
T * GenerateParticles(const int count=1)
Generates particles of a specific type.
Definition: ParticleTemplate.h:82
virtual Texture * GetTexture()
Gets the texture to render.
Definition: ParticleTemplate.h:47
virtual Particle * GetInactiveParticle()=0
Get the next available particle.
Enables a group of sprites to be drawn using the same settings.
Definition: SpriteBatch.h:44
A single component of a particle system.
Definition: Particle.h:19
virtual void SetTemplate(ParticleTemplate *pTemplate)
Sets template responsible for updating the particle.
Definition: Particle.h:42
virtual void Update(const GameTime *pGameTime)
Called when the game has determined that game logic needs to be processed.
Definition: Emitter.cpp:32
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition: Animation.cpp:14