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, 锐王 <[EMAIL PROTECTED]> 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@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>

Attachment: Polytope
Description: Binary data

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to