Remove no longer needed apply(Geode&) in SetFilterSettingsVisitor and NodeToShapeVisitor

In OSG 3.4 (which is now a requirement), Drawables are normal Nodes attached in the scene graph. Geode is still provided for backwards compatibility, but does not need to be specially handled here because it now functions just like a normal Group node.
move
scrawl 9 years ago
parent e8caafa190
commit 24ae9f4ac1

@ -1,8 +1,9 @@
#include "bulletshapemanager.hpp" #include "bulletshapemanager.hpp"
#include <osg/NodeVisitor> #include <osg/NodeVisitor>
#include <osg/Geode>
#include <osg/TriangleFunctor> #include <osg/TriangleFunctor>
#include <osg/Transform>
#include <osg/Drawable>
#include <BulletCollision/CollisionShapes/btTriangleMesh.h> #include <BulletCollision/CollisionShapes/btTriangleMesh.h>
@ -62,12 +63,6 @@ public:
} }
virtual void apply(osg::Geode& geode)
{
for (unsigned int i=0; i<geode.getNumDrawables(); ++i)
apply(*geode.getDrawable(i));
}
virtual void apply(osg::Drawable &drawable) virtual void apply(osg::Drawable &drawable)
{ {
if (!mTriangleMesh) if (!mTriangleMesh)

@ -2,7 +2,6 @@
#include <iostream> #include <iostream>
#include <osg/Node> #include <osg/Node>
#include <osg/Geode>
#include <osg/UserDataContainer> #include <osg/UserDataContainer>
#include <osgParticle/ParticleSystem> #include <osgParticle/ParticleSystem>
@ -51,7 +50,6 @@ namespace
&& partsys->getUserDataContainer()->getDescriptions()[0] == "worldspace"); && partsys->getUserDataContainer()->getDescriptions()[0] == "worldspace");
} }
// in OSG 3.3 and up Drawables can be directly in the scene graph without a Geode decorating them.
void apply(osg::Drawable& drw) void apply(osg::Drawable& drw)
{ {
if (osgParticle::ParticleSystem* partsys = dynamic_cast<osgParticle::ParticleSystem*>(&drw)) if (osgParticle::ParticleSystem* partsys = dynamic_cast<osgParticle::ParticleSystem*>(&drw))
@ -145,21 +143,6 @@ namespace Resource
traverse(node); traverse(node);
} }
virtual void apply(osg::Geode& geode)
{
osg::StateSet* stateset = geode.getStateSet();
if (stateset)
applyStateSet(stateset);
for (unsigned int i=0; i<geode.getNumDrawables(); ++i)
{
osg::Drawable* drw = geode.getDrawable(i);
stateset = drw->getStateSet();
if (stateset)
applyStateSet(stateset);
}
}
void applyStateSet(osg::StateSet* stateset) void applyStateSet(osg::StateSet* stateset)
{ {
const osg::StateSet::TextureAttributeList& texAttributes = stateset->getTextureAttributeList(); const osg::StateSet::TextureAttributeList& texAttributes = stateset->getTextureAttributeList();

Loading…
Cancel
Save