Hi Marcus,
On Fri, 2005-08-26 at 13:09 +0200, Marcus Lindblom wrote:
> Hi again,
>
> The original getBounds() assumes that the axis extends in both
> directions from the position, which is wrong compared to how it is
> defined in other functions.
Good catch!
> I've written a replacement which seems to behave correctly. (At least by
> visual inspection when drawing the resulting OOBB as a box around the
> object).
>
> void myGetBounds(const CylinderVolume* vol, Pnt3f &min, Pnt3f &max)
> {
> osg::Pnt3f pos;
> osg::Vec3f dir;
> float radius = cyl->getRadius();
> cyl->getAxis(pos, dir);
>
> for(int i=0; i<3; i++) {
> min[i] = pos[i] - radius;
> max[i] = pos[i] + radius;
> ((dir[i] < 0) ? min[i] : max[i]) += dir[i];
> }
> }
Thanks for the fix, I checked it in.
In general I'm not all that happy with the Volume interface,this is
something I'm planning to change for 2.0, time permitting. As part of
that we need to write some more serious tests for the methods. So far
nobody has used them, so they weren't high on the priority list.
Yours
Dirk
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users