From 363214d25262899d6043baa29c5be330570c5a22 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sun, 24 Oct 2021 19:00:46 +0200 Subject: [PATCH] Fix incorrect behavior of BBOX_3D::GetMaxDimension() --- .../3d_rendering/raytracing/shapes3D/bbox_3d.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.cpp index 8f59649458..3b310c85b5 100644 --- a/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.cpp +++ b/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.cpp @@ -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 ); }