- Add function IParticleSystemSceneNode::clearParticles
- Speedup deleting of particles git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3503 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
f6c17ba8b5
commit
cee8c4fbb5
|
@ -1,5 +1,9 @@
|
||||||
Changes in 1.8 (??.0?.2010)
|
Changes in 1.8 (??.0?.2010)
|
||||||
|
|
||||||
|
- Speedup deleting of particles
|
||||||
|
|
||||||
|
- Add function IParticleSystemSceneNode::clearParticles
|
||||||
|
|
||||||
- Add function IGUIEnvironment::removeFont
|
- Add function IGUIEnvironment::removeFont
|
||||||
|
|
||||||
- Functions in IMeshCache expecting IAnimatedMesh* parameters removed as similar functions with IMesh* can be used since a while. Fixes also problems when IAnimatedMesh* got upcasted to IMesh*. (thx @ Greenya for reporting)
|
- Functions in IMeshCache expecting IAnimatedMesh* parameters removed as similar functions with IMesh* can be used since a while. Fixes also problems when IAnimatedMesh* got upcasted to IMesh*. (thx @ Greenya for reporting)
|
||||||
|
|
|
@ -64,6 +64,9 @@ public:
|
||||||
Default is true. */
|
Default is true. */
|
||||||
virtual void setParticlesAreGlobal(bool global=true) = 0;
|
virtual void setParticlesAreGlobal(bool global=true) = 0;
|
||||||
|
|
||||||
|
//! Remove all currently visible particles
|
||||||
|
virtual void clearParticles() = 0;
|
||||||
|
|
||||||
//! Gets the particle emitter, which creates the particles.
|
//! Gets the particle emitter, which creates the particles.
|
||||||
/** \return The particle emitter. Can be 0 if none is set. */
|
/** \return The particle emitter. Can be 0 if none is set. */
|
||||||
virtual IParticleEmitter* getEmitter() =0;
|
virtual IParticleEmitter* getEmitter() =0;
|
||||||
|
|
|
@ -457,7 +457,14 @@ void CParticleSystemSceneNode::doParticleSystem(u32 time)
|
||||||
{
|
{
|
||||||
// erase is pretty expensive!
|
// erase is pretty expensive!
|
||||||
if (now > Particles[i].endTime)
|
if (now > Particles[i].endTime)
|
||||||
Particles.erase(i);
|
{
|
||||||
|
// Particle order does not seem to matter.
|
||||||
|
// So we can delete by switching with last particle and deleting that one.
|
||||||
|
// This is a lot faster and speed is very important here as the erase otherwise
|
||||||
|
// can cause noticable freezes.
|
||||||
|
Particles[i] = Particles[Particles.size()-1];
|
||||||
|
Particles.erase( Particles.size()-1 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Particles[i].pos += (Particles[i].vector * scale);
|
Particles[i].pos += (Particles[i].vector * scale);
|
||||||
|
@ -491,6 +498,11 @@ void CParticleSystemSceneNode::setParticlesAreGlobal(bool global)
|
||||||
ParticlesAreGlobal = global;
|
ParticlesAreGlobal = global;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Remove all currently visible particles
|
||||||
|
void CParticleSystemSceneNode::clearParticles()
|
||||||
|
{
|
||||||
|
Particles.set_used(0);
|
||||||
|
}
|
||||||
|
|
||||||
//! Sets the size of all particles.
|
//! Sets the size of all particles.
|
||||||
void CParticleSystemSceneNode::setParticleSize(const core::dimension2d<f32> &size)
|
void CParticleSystemSceneNode::setParticleSize(const core::dimension2d<f32> &size)
|
||||||
|
|
|
@ -190,6 +190,9 @@ public:
|
||||||
//! ignore it. Default is true.
|
//! ignore it. Default is true.
|
||||||
virtual void setParticlesAreGlobal(bool global=true);
|
virtual void setParticlesAreGlobal(bool global=true);
|
||||||
|
|
||||||
|
//! Remove all currently visible particles
|
||||||
|
virtual void clearParticles();
|
||||||
|
|
||||||
//! Writes attributes of the scene node.
|
//! Writes attributes of the scene node.
|
||||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue