ComputeBoundsVisitor only computes bounds for drawables. ie geometry. 2009/2/11 Engvall Åsa <asa.engv...@saabgroup.com>: > Hi osg-users! > > I want to use a ComputeBoundsVisitor for finding the bounds of an object. > The object belongs to the class GroundObject, which is derived from > osg::Node. > > Please have a look at this short function. The visitor is probably not > executed, and the resulting bounding box is not valid. > > void GroundObject::calculateDistanceToGround(void) > { > // Calculate distance from local origin to ground. > osg::ComputeBoundsVisitor cbv; > accept(cbv); > osg::BoundingBox box = cbv.getBoundingBox(); > if (!box.valid()) ssPrintf("Bounding box is not valid!\n"); > _distanceToGround = osg::absolute(box.zMin()); > } > > What is wrong here? > Thanks in advance, > > Åsa Engvall > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
-- The truth is out there. Usually in header files. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org