1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:19:57 +00:00
openmw-tes3mp/components/sceneutil/visitor.cpp

35 lines
788 B
C++
Raw Normal View History

#include "visitor.hpp"
#include <osg/Geode>
#include <osgParticle/ParticleSystem>
#include <components/misc/stringops.hpp>
namespace SceneUtil
{
void FindByNameVisitor::apply(osg::Group &group)
{
if (Misc::StringUtils::ciEqual(group.getName(), mNameToFind))
{
mFoundNode = &group;
return;
}
traverse(group);
}
void DisableFreezeOnCullVisitor::apply(osg::Geode &geode)
{
for (unsigned int i=0; i<geode.getNumDrawables(); ++i)
apply(*geode.getDrawable(i));
}
void DisableFreezeOnCullVisitor::apply(osg::Drawable& drw)
{
if (osgParticle::ParticleSystem* partsys = dynamic_cast<osgParticle::ParticleSystem*>(&drw))
partsys->setFreezeOnCull(false);
}
}