Fix incorrect behavior of BBOX_3D::GetMaxDimension()

This commit is contained in:
Mikolaj Wielgus 2021-10-24 19:00:46 +02:00 committed by Jon Evans
parent afccea34a5
commit 363214d252
1 changed files with 1 additions and 10 deletions

View File

@ -166,17 +166,8 @@ unsigned int BBOX_3D::MaxDimension() const
float BBOX_3D::GetMaxDimension() const
{
unsigned int max_dimensions_idx = 0;
SFVEC3F extent = GetExtent();
if( extent.y > extent.x )
max_dimensions_idx = 1;
if( extent.z > extent.y )
max_dimensions_idx = 2;
return extent[max_dimensions_idx];
return std::max( std::max( extent.x, extent.y ), extent.z );
}