|
|
@ -5,6 +5,8 @@
|
|
|
|
#include <osg/Drawable>
|
|
|
|
#include <osg/Drawable>
|
|
|
|
#include <osg/NodeVisitor>
|
|
|
|
#include <osg/NodeVisitor>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <osgUtil/CullVisitor>
|
|
|
|
|
|
|
|
|
|
|
|
#include <components/debug/debuglog.hpp>
|
|
|
|
#include <components/debug/debuglog.hpp>
|
|
|
|
#include <components/resource/scenemanager.hpp>
|
|
|
|
#include <components/resource/scenemanager.hpp>
|
|
|
|
|
|
|
|
|
|
|
@ -220,6 +222,13 @@ void RigGeometryHolder::accept(osg::NodeVisitor &nv)
|
|
|
|
|
|
|
|
|
|
|
|
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR && mSourceRigGeometry.get())
|
|
|
|
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR && mSourceRigGeometry.get())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// The cull visitor won't be applied to the node itself,
|
|
|
|
|
|
|
|
// but we want to use its state to render the child geometry.
|
|
|
|
|
|
|
|
osg::StateSet* stateset = getStateSet();
|
|
|
|
|
|
|
|
osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>(&nv);
|
|
|
|
|
|
|
|
if (stateset)
|
|
|
|
|
|
|
|
cv->pushStateSet(stateset);
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int traversalNumber = nv.getTraversalNumber();
|
|
|
|
unsigned int traversalNumber = nv.getTraversalNumber();
|
|
|
|
if (mLastFrameNumber == traversalNumber)
|
|
|
|
if (mLastFrameNumber == traversalNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -255,6 +264,8 @@ void RigGeometryHolder::accept(osg::NodeVisitor &nv)
|
|
|
|
nv.apply(geom);
|
|
|
|
nv.apply(geom);
|
|
|
|
nv.popFromNodePath();
|
|
|
|
nv.popFromNodePath();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (stateset)
|
|
|
|
|
|
|
|
cv->popStateSet();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
|
|
|
else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
|
|
|
{
|
|
|
|
{
|
|
|
|