forked from teamnwah/openmw-tes3coop
Handle the particle node's AutoPlay flag (Bug #3390)
This commit is contained in:
parent
3b31e8f66e
commit
e30bb31a79
1 changed files with 10 additions and 1 deletions
|
@ -387,6 +387,15 @@ namespace NifOsg
|
|||
toSetup->setFunction(boost::shared_ptr<ControllerFunction>(new ControllerFunction(ctrl)));
|
||||
}
|
||||
|
||||
void setupParticleController(const Nif::Controller* ctrl, SceneUtil::Controller* toSetup, int particleflags)
|
||||
{
|
||||
bool autoPlay = particleflags & Nif::NiNode::ParticleFlag_AutoPlay;
|
||||
if (autoPlay)
|
||||
toSetup->setSource(boost::shared_ptr<SceneUtil::ControllerSource>(new SceneUtil::FrameTimeSource));
|
||||
|
||||
toSetup->setFunction(boost::shared_ptr<ControllerFunction>(new ControllerFunction(ctrl)));
|
||||
}
|
||||
|
||||
void optimize (const Nif::Node* nifNode, osg::Group* node, bool skipMeshes)
|
||||
{
|
||||
// For nodes with an identity transform, remove the redundant Transform node
|
||||
|
@ -984,7 +993,7 @@ namespace NifOsg
|
|||
emitterNode->addChild(emitter);
|
||||
|
||||
osg::ref_ptr<ParticleSystemController> callback(new ParticleSystemController(partctrl));
|
||||
setupController(partctrl, callback, animflags);
|
||||
setupParticleController(partctrl, callback, particleflags);
|
||||
emitter->setUpdateCallback(callback);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue