So, ... it is not good :
I added my visitor on a drawable :
_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;
};
Nothing is return as cull state... the visitor seem do be visiting
nothing...
Any Idea ? experience ?
Thanks.
Regards,
Vincent.
2008/9/25 Vincent Bourdier <[EMAIL PROTECTED]>
> Okay, it sound more complicated ...
>
> Just to be sure :
>
> 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...)
>
> Thanks,
> Regards.
> Vincent
>
> 2008/9/25 Robert Osfield <[EMAIL PROTECTED]>
>
>> On Thu, Sep 25, 2008 at 4:23 PM, Vincent Bourdier
>>
>> <[EMAIL PROTECTED]> wrote:
>> > Hi Robert,
>> >
>> > How is it possible to test directly against the view frustum ? manually
>> ? or
>> > is there a method still implemented ?
>> > thanks.
>>
>> You create an osg::Polytope from the Camera's view and projection
>> matrix which will be your frustum, then transform by any transforms
>> in the parent path to place the frustum in local coordinate, then test
>> the objects bounding sphere/bound box against this frustum. The
>> osgUtil::PolytopeVisitor does most of this so could learn a lot form
>> this.
>>
>> Robert.
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org