[osg-users] View Frutrum Culling
Kaiser, Hagen (CT)
hagen.kaiser at siemens.com
Wed Jul 30 05:19:40 PDT 2008
I did the following:
class CullCallback : public osg::NodeCallback
{
public:
bool isVisible;
CullCallback():isVisible(false){}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
traverse(node,nv);
if (!((osgUtil::CullVisitor*) nv)->isCulled(*node))
this->isVisible=true;
}
};
I installed this to every node where I want to know if its currently
visible or not with setCullCallback
Then I question somewhere else the flag like this:
return ((CullCallback*)this->node->getCullCallback())->isVisible;
Even if my camera is far away and facing somewhere, where nothing is
visible.
Everything is said to be visible.
Please help me. I really don't get it.
Greeting
Hagen
More information about the osg-users
mailing list