From: <pat...@us...> - 2013-07-05 20:59:17
|
Revision: 1283 http://sourceforge.net/p/ggt/code/1283 Author: patrickh Date: 2013-07-05 20:59:14 +0000 (Fri, 05 Jul 2013) Log Message: ----------- >From the patch submission: This patch fixes an issue with extending a base sphere around a second sphere, in the specific case where the second sphere already completely contains the base sphere. The fix trivially sets the base sphere to the second sphere and returns. In fact, the code without this fix is broken. Consider an initialized base sphere with radious 0.0, and a second sphere with radius R, with both spheres having the same center. The unmodified code will incorrectly set the base sphere radius to R/2.0, which doesn't enclose the second sphere (obviously). The attached patch fixes this issue so that the base sphere will have the correct radius. Submitted by: Paul Martz Modified Paths: -------------- trunk/gmtl/Containment.h Modified: trunk/gmtl/Containment.h =================================================================== --- trunk/gmtl/Containment.h 2012-10-26 21:30:13 UTC (rev 1282) +++ trunk/gmtl/Containment.h 2013-07-05 20:59:14 UTC (rev 1283) @@ -135,6 +135,11 @@ { return; } + if ( isInVolume( sphere, container ) ) + { + container = sphere; + return; + } // make a vector pointing from the center of container to sphere. this is the // direction in which we need to move container's center This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |