Hi Leandro,

Am 25.11.2011 12:47, schrieb Leandro Motta Barros:
> Hello,
> 
> In a project I am working on, I need to use intersectors
> (PolytopeIntersectors, in particular) with double precision floating
> point, but with the intersectors provided by OSG (using 3.0.1 here), I
> get only single precision.
> 
> I noticed that osgUtil::PolytopeIntersector already contains code
> intended to make it use osg::Vec3f or osg::Vec3d depending whether
> OSG_USE_FLOAT_PLANE is defined or not -- but there are one or two
> places in which a osg::Vec3 is used -- which ends up as floats.

The code that does is wrong is probably from me.

> osgUtil::LineSegmentIntersector, on the other hand, uses osg::Vec3
> (i.e., floats) everywhere.
> 
> So, I am ready to change the few bits of osgUtil::PolytopeIntersector
> still using hardcoded osg::Vec3 and to modify
> osgUtil::LineSegmentIntersector so that it uses a similar approach
> (that is, use osg::Vec3f and float if OSG_USE_FLOAT_PLANE is defined,
> otherwise use osg::Vec3d and double) and send this to osg-submissions.
> (I did some successful experiments with a fully-double
> osgUtil::PolytopeIntersector already.)

Fixing the missing bits in PolytopeIntersector should be
done in any case.

The LineSegmentIntersector is a bit more complicated
as it uses the KdTree-class is float-only for now
and which also would have to me adjusted (it does
not look to complicated to do that through a typedef
and/or templates).

But for LineSegementIntersector I would not make it all depend on
OSG_USE_FLOAT_PLANE. That makes sense for PolytopeIntesector as it
practically only uses plane calculations. I would suggest
something like OSG_USE_FLOAT_LINE_INTERSECTIONS (default ON).

> Would this be OK? Am am missing something? Would some different
> approach be preferable? Do you have any other feedback?

I like your idea and I think it would be an improvement.

In the long run - as an application developer - I would
like the have the ability to have both options in
the same build. Usually I have raw data in double format
and build a float-scenegraph. But for some algorithms
I would like to use the original double data.


> Cheers,
> 
> LMB

Cheers, looking forward to see your submmission

Peter
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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

Reply via email to