From 3453354ee16d9d1baa5fdd42a6e29f83d01135ee Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 13 Sep 2022 13:01:00 +0300 Subject: [PATCH] 0033141: BVH_BaseBox::Transformed() returns empty box for identity matrix --- src/BVH/BVH_Box.hxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/BVH/BVH_Box.hxx b/src/BVH/BVH_Box.hxx index 6d2d01b0c8..be2af6c330 100644 --- a/src/BVH/BVH_Box.hxx +++ b/src/BVH/BVH_Box.hxx @@ -64,19 +64,18 @@ public: //! given transformation to this box. BVH_Box Transformed (const NCollection_Mat4& theTransform) const { - BVH_Box aResultBox; - + const BVH_Box *aThis = static_cast*>(this); if (theTransform.IsIdentity()) { - return aResultBox; + return *aThis; } - const BVH_Box *aThis = static_cast*>(this); if (!aThis->IsValid()) { - return aResultBox; + return *aThis; } + BVH_Box aResultBox; for (size_t aX = 0; aX <= 1; ++aX) { for (size_t aY = 0; aY <= 1; ++aY)