Hi Christain,

On Tue, Mar 10, 2009 at 2:25 PM, Christian Sam <[email protected]> wrote:
> as far as i understand every Drawable object in the scenegraph does have a 
> "_boundingBox" data member.
>
> * does the user have to manually initalize this boundingBox (with a call like 
> "myDrawableOject.computeBound()"), or has it already been set by osg to 
> nodes' geometry extent (xmin, xmax, ymin, ymax, zmin, zmax)?

The BoundingBox is computed automatically when the dirtyBound flag is
set, if you modify the geometry then you should call
drawable->dirtyBound() to force an update.


> * if the user wants to query, if a ceratin vec3 position lies inside a 
> Drawable object, can this be done with something like: 
> "myDrawableObject.getBound().contains(osg::Vec3f(...))"?

Yes, this is what the contains(Vec3) method is for ;-)


> * if the user has a non-rectangluar polygon (e.g. an area in form of 
> pentagram), will the above also work? if not, can you give me a hint how to 
> implement an adequate contains()-query?

Well there isn't a BoundingBox::contains(anyShape) method so the
answer has to be no.  You'll need to build your own test.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to