0033141: BVH_BaseBox<T, 3, BVH_Box>::Transformed() returns empty box for identity...
authorkgv <kgv@opencascade.com>
Tue, 13 Sep 2022 10:01:00 +0000 (13:01 +0300)
committersmoskvin <smoskvin@opencascade.com>
Mon, 31 Oct 2022 15:19:37 +0000 (18:19 +0300)
src/BVH/BVH_Box.hxx

index 6d2d01b..be2af6c 100644 (file)
@@ -64,19 +64,18 @@ public:
   //! given transformation to this box.
   BVH_Box<T, 3> Transformed (const NCollection_Mat4<T>& theTransform) const
   {
-    BVH_Box<T, 3> aResultBox;
-
+    const BVH_Box<T, 3> *aThis = static_cast<const BVH_Box<T, 3>*>(this);
     if (theTransform.IsIdentity())
     {
-      return aResultBox;
+      return *aThis;
     }
 
-    const BVH_Box<T, 3> *aThis = static_cast<const BVH_Box<T, 3>*>(this);
     if (!aThis->IsValid())
     {
-      return aResultBox;
+      return *aThis;
     }
 
+    BVH_Box<T, 3> aResultBox;
     for (size_t aX = 0; aX <= 1; ++aX)
     {
       for (size_t aY = 0; aY <= 1; ++aY)