Fix particles being killed too soon
This commit is contained in:
@@ -449,21 +449,4 @@ void ParticleSystemProxy::render() {
|
||||
m_first_execution = false;
|
||||
simulate();
|
||||
draw();
|
||||
}
|
||||
|
||||
bool ParticleSystemProxy::update()
|
||||
{
|
||||
doParticleSystem(os::Timer::getTime());
|
||||
return (IsVisible && (Particles.size() != 0));
|
||||
}
|
||||
|
||||
void ParticleSystemProxy::OnRegisterSceneNode()
|
||||
{
|
||||
doParticleSystem(os::Timer::getTime());
|
||||
|
||||
if (IsVisible && (Particles.size() != 0))
|
||||
{
|
||||
SceneManager->registerNodeForRendering(this, scene::ESNRP_TRANSPARENT_EFFECT);
|
||||
ISceneNode::OnRegisterSceneNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,6 @@ public:
|
||||
|
||||
virtual void setEmitter(scene::IParticleEmitter* emitter);
|
||||
virtual void render();
|
||||
virtual void OnRegisterSceneNode();
|
||||
void setAlphaAdditive(bool val) { m_alpha_additive = val; }
|
||||
void setIncreaseFactor(float val) { size_increase_factor = val; }
|
||||
void setColorFrom(float r, float g, float b) { m_color_from[0] = r; m_color_from[1] = g; m_color_from[2] = b; }
|
||||
@@ -79,7 +78,6 @@ public:
|
||||
const float* getColorTo() const { return m_color_to; }
|
||||
void setHeightmap(const std::vector<std::vector<float> >&, float, float, float, float);
|
||||
void setFlip();
|
||||
bool update();
|
||||
};
|
||||
|
||||
#endif // GPUPARTICLES_H
|
||||
|
||||
@@ -439,7 +439,7 @@ parseSceneManager(core::list<scene::ISceneNode*> List, std::vector<scene::IScene
|
||||
|
||||
if (ParticleSystemProxy *node = dynamic_cast<ParticleSystemProxy *>(*I))
|
||||
{
|
||||
if (!isCulledPrecise(cam, *I, false) && node->update())
|
||||
if (!isCulledPrecise(cam, *I, false))
|
||||
ParticlesList::getInstance()->push_back(node);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user