Hi
I make a little UP because I go now a strange problem :
My Cullcallback seem to engender some other problems in my application. When
I put it, the application can crash or freeze, pretending sometimes "not
enough memory" (false, I've checked) or some other error messages with no
relation with that. I suppose my cull callback is not good and randomly
engender unstable states in the application...
This is what I do, to check visible elements or not :
Callback :
tileVisibleCallback::tileVisibleCallback(Tile* tile)
> : osg::NodeCallback(){
> _tile = tile;
> };
>
> void tileVisibleCallback::operator()(osg::Node* node, osg::NodeVisitor*
> nv){
>
> if(!_tile.valid()){
> osg::notify(osg::WARN)<<"Tile callback error : tile not
> recognized!\n";
> return;
> }
>
> //This method is called so the tile is visible
> // Its name is added to the visible Tile list.
> _tile->_stack->_cullList.push_back(_tile->getName());
>
>
> traverse(node, nv);
> };
>
and the Set :
osg::ref_ptr<tileVisibleCallback> tvc = new tileVisibleCallback(this);
> if(_mainChild->getCullCallback())
> _mainChild->getCullCallback()->setNestedCallback(tvc.get());
> else
> _mainChild->setCullCallback(tvc.get());
>
Do you see something not clear ? unstable ? what can engender problems ?
Thanks a lot.
Regards,
Vincent
2008/9/26 Vincent Bourdier <[EMAIL PROTECTED]>
> Hi,
>
> I found an other solution using a vector to store the visible elements and
> clearing this list each render loop. I is the more simple solution I think.
>
> thanks for your help.
> Regards,
> Vincent.
>
> 2008/9/26 Ulrich Hertlein <[EMAIL PROTECTED]>
>
>> Hi Vincent,
>>
>>
>> Vincent Bourdier wrote:
>> >> Vincent Bourdier wrote:
>> >>> If if do a nodevisitior, I've the problem that the operator() takes a
>> >>> nodevisitor in parameter and so I can't obtain the cull state with
>> that.
>> >>> (method isCulled() not aviable from a node visitor)
>> >> The way I understood Robert, the fact that your operator() is called
>> means
>> >> the node in
>> >> question is *not* culled so you could simple set your _isCulled=true.
>> And
>> >> don't forget to call traverse().
>> >
>> > Ok, this is a simple and good way to have the result, but not sufficient
>> :
>> > cull = true when operator() is called, but if the operator is not
>> called,
>> > cull still = true and will never be false...
>>
>> Yes it will never be reset by the cull traversal so you have to do that
>> yourself e.g. just
>> before cull or maybe after you've read the cull state from your class.
>>
>> Cheers,
>> /ulrich
>>
>> _______________________________________________
>> 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