mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #570 from eightyeight/box3f-overlap
Fixed Box3F::overlap
This commit is contained in:
commit
e906865a56
1 changed files with 8 additions and 0 deletions
|
|
@ -334,10 +334,18 @@ inline Box3F Box3F::getOverlap( const Box3F& otherBox ) const
|
||||||
Box3F overlap;
|
Box3F overlap;
|
||||||
|
|
||||||
for( U32 i = 0; i < 3; ++ i )
|
for( U32 i = 0; i < 3; ++ i )
|
||||||
|
{
|
||||||
if( minExtents[ i ] > otherBox.maxExtents[ i ] || otherBox.minExtents[ i ] > maxExtents[ i ] )
|
if( minExtents[ i ] > otherBox.maxExtents[ i ] || otherBox.minExtents[ i ] > maxExtents[ i ] )
|
||||||
|
{
|
||||||
overlap.minExtents[ i ] = 0.f;
|
overlap.minExtents[ i ] = 0.f;
|
||||||
|
overlap.maxExtents[ i ] = 0.f;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
overlap.minExtents[ i ] = getMax( minExtents[ i ], otherBox.minExtents[ i ] );
|
overlap.minExtents[ i ] = getMax( minExtents[ i ], otherBox.minExtents[ i ] );
|
||||||
|
overlap.maxExtents[ i ] = getMin( maxExtents[ i ], otherBox.maxExtents[ i ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return overlap;
|
return overlap;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue