Replace redundant asCullVisitor usage with a type check
This commit is contained in:
parent
da16693b4a
commit
35f256a9a1
@ -59,12 +59,8 @@ void osgParticle::ParticleProcessor::setParticleSystem(ParticleSystem* ps)
|
||||
|
||||
void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
// typecast the NodeVisitor to CullVisitor
|
||||
osgUtil::CullVisitor* cv = nv.asCullVisitor();
|
||||
|
||||
// continue only if the visitor actually is a cull visitor
|
||||
if (cv) {
|
||||
|
||||
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) {
|
||||
// continue only if the particle system is valid
|
||||
if (_ps.valid())
|
||||
{
|
||||
|
@ -22,8 +22,7 @@ osgParticle::ParticleSystemUpdater::ParticleSystemUpdater(const ParticleSystemUp
|
||||
|
||||
void osgParticle::ParticleSystemUpdater::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
osgUtil::CullVisitor* cv = nv.asCullVisitor();
|
||||
if (cv)
|
||||
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
if (nv.getFrameStamp())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user