diff --git a/Code/Framework/AzCore/AzCore/Math/Aabb.h b/Code/Framework/AzCore/AzCore/Math/Aabb.h index 2d2616f5de..ef7704533e 100644 --- a/Code/Framework/AzCore/AzCore/Math/Aabb.h +++ b/Code/Framework/AzCore/AzCore/Math/Aabb.h @@ -134,16 +134,16 @@ namespace AZ void MultiplyByScale(const Vector3& scale); //! Transforms an Aabb and returns the resulting Obb. - Obb GetTransformedObb(const Transform& transform) const; + [[nodiscard]] Obb GetTransformedObb(const Transform& transform) const; //! Transforms an Aabb and returns the resulting Obb. - Obb GetTransformedObb(const Matrix3x4& matrix3x4) const; + [[nodiscard]] Obb GetTransformedObb(const Matrix3x4& matrix3x4) const; //! Returns a new AABB containing the transformed AABB. - Aabb GetTransformedAabb(const Transform& transform) const; + [[nodiscard]] Aabb GetTransformedAabb(const Transform& transform) const; //! Returns a new AABB containing the transformed AABB. - Aabb GetTransformedAabb(const Matrix3x4& matrix3x4) const; + [[nodiscard]] Aabb GetTransformedAabb(const Matrix3x4& matrix3x4) const; //! Checks if this aabb is equal to another within a floating point tolerance. bool IsClose(const Aabb& rhs, float tolerance = Constants::Tolerance) const; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index f17972ab6a..c99ca7b848 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -433,8 +433,7 @@ namespace AZ if (model) { Aabb aabb = model->GetAabb(); - aabb.SetMin(aabb.GetMin() * m_cachedNonUniformScale); - aabb.SetMax(aabb.GetMax() * m_cachedNonUniformScale); + aabb.MultiplyByScale(m_cachedNonUniformScale); return aabb; } else