| 330 | } |
| 331 | |
| 332 | inline Box3F Box3F::getOverlap( const Box3F& otherBox ) const |
| 333 | { |
| 334 | Box3F overlap; |
| 335 | |
| 336 | for( U32 i = 0; i < 3; ++ i ) |
| 337 | { |
| 338 | if( minExtents[ i ] > otherBox.maxExtents[ i ] || otherBox.minExtents[ i ] > maxExtents[ i ] ) |
| 339 | { |
| 340 | overlap.minExtents[ i ] = 0.f; |
| 341 | overlap.maxExtents[ i ] = 0.f; |
| 342 | } |
| 343 | else |
| 344 | { |
| 345 | overlap.minExtents[ i ] = getMax( minExtents[ i ], otherBox.minExtents[ i ] ); |
| 346 | overlap.maxExtents[ i ] = getMin( maxExtents[ i ], otherBox.maxExtents[ i ] ); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | return overlap; |
| 351 | } |
| 352 | |
| 353 | inline F32 Box3F::getVolume() const |
| 354 | { |