mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Handle the particle node's AutoPlay flag (Bug #3390)
This commit is contained in:
parent
3b31e8f66e
commit
e30bb31a79
@ -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…
x
Reference in New Issue
Block a user