| 32 | //----------------------------------------------------------------------------- |
| 33 | |
| 34 | bool Box3F::isOverlapped( const SphereF& sphere ) const |
| 35 | { |
| 36 | // Algorithm: Real-Time Rendering, Ed. 1, p323, 10.10.1 Sphere/Box Intersection |
| 37 | |
| 38 | F32 d = 0; |
| 39 | for( U32 i = 0; i < 3; ++ i ) |
| 40 | if( sphere.center[ i ] < minExtents[ i ] ) |
| 41 | d = d + mSquared( sphere.center[ i ] - minExtents[ i ] ); |
| 42 | else if( sphere.center[ i ] > maxExtents[ i ] ) |
| 43 | d = d + mSquared( sphere.center[ i ] - maxExtents[ i ] ); |
| 44 | |
| 45 | return !( d > mSquared( sphere.radius ) ); |
| 46 | } |
| 47 | |
| 48 | //----------------------------------------------------------------------------- |
| 49 |
nothing calls this directly
no test coverage detected