i hit something, the billboard is removed, and so was the ParticleSystem, thus, the tail
the rocket produced vanished immediately. Now i want to keep the tail another second or so.
Well, i didn't succeded with that. The following code is inside my WeaponAnimator::animateNode
method and is executed, as soon as the rocket hits something:
Code: Select all
// let the tail be another second
for (core::list<scene::ISceneNode*>::ConstIterator iter = node->getChildren().begin();
iter != node->getChildren().end(); iter++)
if ((*iter)->getType() == scene::ESNT_PARTICLE_SYSTEM)
{
scene::IParticleSystemSceneNode* ps = static_cast<scene::IParticleSystemSceneNode*>(*iter);
scene::ISceneNodeAnimator* ani = SceneManager->createDeleteAnimator(1000);
ps->addAnimator(ani);
ani->drop();
}
SceneManager->addToDeletionQueue(node);
return;
and is actually the billboard.
Sadly, the tail still vanishes immediatly. I tried to remove the ParticleSystem from the node,
but that only results in a segmentation fault.
Code: Select all
scene::IParticleSystemSceneNode* ps = static_cast<scene::IParticleSystemSceneNode*>(*iter);
scene::ISceneNodeAnimator* ani = SceneManager->createDeleteAnimator(1000);
ps->addAnimator(ani);
ani->drop();
node->removeChild(ps);
but still, the tail just vanishes immediately.
Code: Select all
scene::IParticleSystemSceneNode* ps = static_cast<scene::IParticleSystemSceneNode*>(*iter);
ps->grab();
node->removeChild(ps);
scene::ISceneNodeAnimator* ani = SceneManager->createDeleteAnimator(1000);
ps->addAnimator(ani);
ani->drop();