Re: [osg-users] cullcallback and visitor ?

2008-09-29 Thread Vincent Bourdier
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

Re: [osg-users] cullcallback and visitor ?

2008-09-29 Thread Robert Osfield
Hi Vincent, There isn't really any much of clue about what might be wrong from your email, so you are probably going to have rely on your own skills to track down what you've done wrong. The only hint I got from you email was mention of a out of memory, which could suggest many things including

Re: [osg-users] cullcallback and visitor ?

2008-09-29 Thread Vincent Bourdier
Ok, So I've some question for you : It is usefull to put a traverse() call in a cullcallback ? are there some actions we can not put in a cullcallback ? thanks, Regards Vincent 2008/9/29 Robert Osfield [EMAIL PROTECTED] Hi Vincent, There isn't really any much of clue about what might be

Re: [osg-users] cullcallback and visitor ?

2008-09-29 Thread Robert Osfield
Hi Vincent, You have to call traverse() in your callback, as node callbacks are in effect traversal callbacks, if you don't include the traversal of the subgraph nothing will happen, just make sure you don't traverse the parent otherwise you'll end up with an infinite loop. Robert. On Mon, Sep

Re: [osg-users] cullcallback and visitor ?

2008-09-26 Thread Vincent Bourdier
Hi, 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) Next, if I do a osg::drawable::Cullvisitor, I see how so implement the cull() method, but It is a

Re: [osg-users] cullcallback and visitor ?

2008-09-26 Thread Ulrich Hertlein
Hi Vincent, 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

Re: [osg-users] cullcallback and visitor ?

2008-09-26 Thread Vincent Bourdier
2008/9/26 Ulrich Hertlein [EMAIL PROTECTED] Hi Vincent, 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

Re: [osg-users] cullcallback and visitor ?

2008-09-26 Thread Ulrich Hertlein
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

Re: [osg-users] cullcallback and visitor ?

2008-09-26 Thread Vincent Bourdier
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

[osg-users] cullcallback and visitor ?

2008-09-25 Thread Vincent Bourdier
Hi, I'm looking at a way to determine if a node is visible (in the frustum) or not. I saw something about cullvisitor and isCulled() But, I do not understand how to implement that visitor. I saw a osg::Drawable::cullcallback ... Do I have to make my callbak ingerit from this class ? What

Re: [osg-users] cullcallback and visitor ?

2008-09-25 Thread Vincent Bourdier
Hi Robert, How is it possible to test directly against the view frustum ? manually ? or is there a method still implemented ? thanks. Vincent. 2008/9/25 Robert Osfield [EMAIL PROTECTED] Hi Vincent, The ways to track whether a drawable or node is in the view frustum are: 1) Attach a cull

Re: [osg-users] cullcallback and visitor ?

2008-09-25 Thread Robert Osfield
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

Re: [osg-users] cullcallback and visitor ?

2008-09-25 Thread Vincent Bourdier
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

Re: [osg-users] cullcallback and visitor ?

2008-09-25 Thread Vincent Bourdier
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 =

Re: [osg-users] cullcallback and visitor ?

2008-09-25 Thread Ulrich Hertlein
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);