Vincent Bourdier wrote:
> _mainChild->getDrawable(0)->setCullCallback(new tileVisibleCallback());
>
> ***
> tileVisibleCallback::tileVisibleCallback(){
> _cull = false;
> };
>
> void tileVisibleCallback::operator()(osg::Node* node, osgUtil::CullVisitor*
> nv){
> _cull = nv->isCulled(*node);
> osg::notify(osg::NOTICE)<<"Cull "<<_cull<<"\n";
>
> };
>
> bool tileVisibleCallback::isCulled(){
> return _cull;
> };
You're mixing up osg::Drawable::CullCallback and osg::NodeCallback and
consequently
osg::Node::setCullCallback and osg::Drawable::setCullCallback.
osg::Drawable::CullCallback has a virtual cull() function that tells if the
Drawable
*should* be culled by returning true or false.
osg::NodeCallback has a virtual operator() that does what you want.
You need to derive your callback from osg::NodeCallback, implement operator()
(as you
already do), and call:
_mainChild->setCullCallback(...)
instead of
_mainChild->getDrawable(0)->setCullCallback(...)
Hope this helps,
/ulrich
> 2008/9/25 Vincent Bourdier <[EMAIL PROTECTED]>
>> class tileVisibleCallback : public osg::Drawable::CullCallback{
>> public:
>> tileVisibleCallback();
>> virtual void operator()(osg::Node* node, osgUtil::CullVisitor* nv);
>> bool isCulled();
>>
>> private:
>> bool _cull;
>>
>> };
>>
>> Does it sound good for you ?
>> (the mix between Cullcallback and osgUtil looks strange for me... but...)
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org