From: kgv Date: Tue, 13 Sep 2022 10:01:00 +0000 (+0300) Subject: 0033141: BVH_BaseBox::Transformed() returns empty box for identity... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR33141a;p=occt.git 0033141: BVH_BaseBox::Transformed() returns empty box for identity matrix --- 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)