[osg-submissions] Fix for CustomPolytope in OverlayNode.cpp +minor tweaks for osg::Plane
Wojciech Lewandowski
lewandowski at ai.com.pl
Mon Feb 25 06:09:15 PST 2008
Thank You,
Wojtek
----- Original Message -----
From: "Robert Osfield" <robert.osfield at gmail.com>
To: "OpenSceneGraph Submissions" <osg-submissions at lists.openscenegraph.org>
Sent: Monday, February 25, 2008 2:26 PM
Subject: Re: [osg-submissions] Fix for CustomPolytope in OverlayNode.cpp
+minor tweaks for osg::Plane
> Thanks Wojciech, all the changes look sound and now merged and submitted
> to SVN.
>
> On Thu, Feb 7, 2008 at 10:37 AM, Wojciech Lewandowski
> <lewandowski at ai.com.pl> wrote:
>>
>>
>> Hi,
>>
>> ----1----
>>
>> Attached is a fixed version of OverlayNode.cpp. I fixed
>> CustomPolytope::cut(
>> osg::Plane ) method. Bug was apparent in such scenario:
>>
>> Let P1 be some random frustum polytope
>> Let P2 be the polytope that was created from P1 bounding box (P2 contains
>> P1
>> entirely)
>>
>> Then ignoring precision errors: P1.cut( P2 ) == P2.cut( P1 ) == P1. But
>> this condition was not always met. Cut failed when some of the polytope
>> reference points happened to lie exactly on some intersecting planes in
>> both
>> P1 & P2 (plane distance was = 0).
>>
>> I only use CustomPolytope for my shadowing stuff so I did not test how
>> this
>> affects rest of OverlayNode.cpp.
>>
>> ----2----
>>
>> Also attached is a minor precision improvement for osg::Plane intersect
>> method (double version).
>>
>> ----3----
>>
>> I have also one observation regarding osg::Plane - There are two
>> intersect
>> vertices methods (float and double flavour):
>>
>>
>> inline int intersect(const std::vector<Vec3>& vertices) const
>> inline int intersect(const std::vector<Vec3d>& vertices) const
>>
>> I guess osg::Plane won't compile when someone changes default vec3
>> typedef
>> to vec3d. Shouldn't the first method be changed to use vec3f explicitly ?
>> Ie:
>>
>> inline int intersect(const std::vector<Vec3f>& vertices) const
>>
>> ----
>>
>>
>> Modifications are based on latest SVN code.
>>
>> Cheers,
>> Wojtek Lewandowski
>>
>> _______________________________________________
>> osg-submissions mailing list
>> osg-submissions at lists.openscenegraph.org
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
More information about the osg-submissions
mailing list