Pārlūkot izejas kodu

allow THREE.Box3 as an input of Boxhelper (#8609)

This helps when when the bounding box is not computed from an object, but comes from elsewhere
Sébastien Valette 9 gadi atpakaļ
vecāks
revīzija
5d89278952
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 1
      src/extras/helpers/BoxHelper.js

+ 9 - 1
src/extras/helpers/BoxHelper.js

@@ -30,7 +30,15 @@ THREE.BoxHelper.prototype.update = ( function () {
 
 	return function ( object ) {
 
-		box.setFromObject( object );
+		if ( object instanceof THREE.Box3 ) {
+
+			box.copy( object );
+
+		} else {
+
+			box.setFromObject( object );
+
+		}
 
 		if ( box.isEmpty() ) return;