Hi Daniel, On Tue, 2004-01-13 at 03:04, Daniel Grest wrote: > Hello, > > i just found a bug in the Volume intersection methods > (OSGVolumeFunctions.cpp). > > For the intersection with the CylinderVolumes/Sphere and Cyl/Box there > is missing this check: > > s1 = (apos - sphere.getCenter()).length(); > s2 = (apos + adir - sphere.getCenter()).length(); > > // to be added: > if ((s1<=DBL_EPSILON) || (s2<=DBL_EPSILON)) return true; > > otherwise u might divide by zero.
For Sphere/Cyl I can see that, but for the box the only division I see is by the cylinder axis length, which is not influenced by the above calculation. Am I missing something. Anyway, thanks for the fix. > Also i couldn't find the function which is called for > CylinderVolume.intersect(SphereVolume). > In the OSGVolumeFunctions.cpp there is a intersect(CylinderVol, Volume), > but i couldn't find a intersect(CylinderVol, SphereVol) ? > And i dont see why the intersect(SphereVol, CylinderVol) should be > called. As far as i saw the intersect(CylinderVol, Volume) should call > itself for a Sphere, which is not happening... ??? Yes, that's a little tricky. We have some inlined parameter turnaround functions in OSGVolumeFunctions.inl, like the following inline bool intersect(const CylinderVolume &cylinder, const SphereVolume &sphere) { return intersect(sphere, cylinder); } These are just to remove the symmetries and reduce the number of actual intersect functions we need. Thanks Dirk ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users