Browse Source

Fix bounds box display when scale is 0 in one dimension

Garrett Johnson 4 years ago
parent
commit
826299d669
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/three/DebugTilesRenderer.js

+ 3 - 1
src/three/DebugTilesRenderer.js

@@ -356,9 +356,11 @@ export class DebugTilesRenderer extends TilesRenderer {
 					const cachedBoxMat = cached.boxTransform;
 
 					// Create debug bounding box
+					// In some cases the bounding box may have a scale of 0 in one dimension resulting
+					// in the NaNs in an extracted rotation so we disable matrix updates instead.
 					const boxHelperGroup = new Group();
 					boxHelperGroup.matrix.copy( cachedBoxMat );
-					boxHelperGroup.matrix.decompose( boxHelperGroup.position, boxHelperGroup.quaternion, boxHelperGroup.scale );
+					boxHelperGroup.matrixAutoUpdate = false;
 
 					const boxHelper = new Box3Helper( cachedBox );
 					boxHelper.raycast = emptyRaycast;