Pārlūkot izejas kodu

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 6 gadi atpakaļ
vecāks
revīzija
07e6671794

+ 1 - 0
dist/preview release/what's new.md

@@ -90,6 +90,7 @@
 - VR helper would rotate non vr camera while in VR ([TrevorDev](https://github.com/TrevorDev))
 - PointerDragBahavior using Mesh as base type, causing type-checking problems with AbstractMesh ([Poolminer](https://github.com/Poolminer/))
 - TransformNode lookAt not working in world space when node's parent has rotation ([TrevorDev](https://github.com/TrevorDev))
+- MakeNotPickableAndWrapInBoundingBox had unexpected behavior when input had scaling of 0 on an axis ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

+ 12 - 0
src/Gizmos/babylon.boundingBoxGizmo.ts

@@ -506,6 +506,18 @@ module BABYLON {
 
             // Reverse parenting
             mesh.removeChild(box);
+
+            // Adjust scale to avoid undefined behavior when adding child
+            if (box.scaling.y === 0) {
+                box.scaling.y = BABYLON.Epsilon;
+            }
+            if (box.scaling.x === 0) {
+                box.scaling.x = BABYLON.Epsilon;
+            }
+            if (box.scaling.z === 0) {
+                box.scaling.z = BABYLON.Epsilon;
+            }
+
             box.addChild(mesh);
             box.visibility = 0;
             return box;