mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Fix ParticleSystem bug introduced by last commit
This commit is contained in:
parent
ad46ff7a98
commit
ec25f1da95
@ -387,14 +387,23 @@ namespace NifOsg
|
|||||||
if (node->getNumParents() && nifNode->trafo.isIdentity())
|
if (node->getNumParents() && nifNode->trafo.isIdentity())
|
||||||
{
|
{
|
||||||
osg::Group* parent = node->getParent(0);
|
osg::Group* parent = node->getParent(0);
|
||||||
osg::Node* child = node->getChild(0);
|
|
||||||
|
// can be multiple children in case of ParticleSystems, with the extra ParticleSystemUpdater node
|
||||||
|
for (unsigned int i=0; i<node->getNumChildren(); ++i)
|
||||||
|
{
|
||||||
|
osg::Node* child = node->getChild(i);
|
||||||
|
if (i == node->getNumChildren()-1) // FIXME: some nicer way to determine where our actual Drawable resides...
|
||||||
|
{
|
||||||
child->setUpdateCallback(node->getUpdateCallback());
|
child->setUpdateCallback(node->getUpdateCallback());
|
||||||
child->setStateSet(node->getStateSet());
|
child->setStateSet(node->getStateSet());
|
||||||
child->setName(node->getName());
|
child->setName(node->getName());
|
||||||
// make sure to copy the UserDataContainer with the record index, so that connections to an animated collision shape don't break
|
// make sure to copy the UserDataContainer with the record index, so that connections to an animated collision shape don't break
|
||||||
child->setUserDataContainer(node->getUserDataContainer());
|
child->setUserDataContainer(node->getUserDataContainer());
|
||||||
|
}
|
||||||
parent->addChild(child);
|
parent->addChild(child);
|
||||||
node->removeChild(child);
|
}
|
||||||
|
|
||||||
|
node->removeChildren(0, node->getNumChildren());
|
||||||
parent->removeChild(node);
|
parent->removeChild(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user