[osg-users] Is there a BUG in osg::Polytope::setToBoundingBox ?
Robert Osfield
robert.osfield at gmail.com
Sat Dec 1 06:59:07 PST 2007
Hi Wangray,
You were correct, there was a bug in Polytope::setBoundingBox, I
created a unit test in osgunittests and reproduced the bug you
illustrated, then reviewed the relevant code, fixed it and it now
passes the test. The fix is now checked into SVN. File also
attached.
Robert.
On Dec 1, 2007 4:16 AM, 锐王 <wangray84 at gmail.com> wrote:
> Hi all,
>
> I'm new here. Please don't mind of my ignorant and rudeness :)
>
> While reading the source code of osgUtil, I find that in the implement code
> of osg::Polytope::setToBoundingBox(...):
> ...
> _planeList.push_back(Plane(0.0,0.0,-1.0,bb.zMin())); // near plane
> _planeList.push_back(Plane(0.0,0.0,1.0,bb.zMax())); // far plane
> ...
>
> That means when Zmin=-1000 and Zmax=1000, The near and far plane of the
> plane list of Polytope will be the same except their normals. And a bug
> appeared when I write:
> ...
> osg::Polytope pt;
> pt.setToBoundingBox(osg::BoundingBox(-1000, -1000, -1000, 1000, 1000,
> 1000));
> bool bContain = pt.contains(osg::Vec3(0, 0, 0));
> ...
> bContain will be set to false.
>
> Is there a bug in setToBoundingBox, or I just made a silly mistake myself?
> :P
> I'm using OSG 2.2 and VS2005.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Polytope
Type: application/octet-stream
Size: 14851 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071201/0bff9a28/attachment.obj
More information about the osg-users
mailing list