Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
5d89278952
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  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 ) {
 	return function ( object ) {
 
 
-		box.setFromObject( object );
+		if ( object instanceof THREE.Box3 ) {
+
+			box.copy( object );
+
+		} else {
+
+			box.setFromObject( object );
+
+		}
 
 
 		if ( box.isEmpty() ) return;
 		if ( box.isEmpty() ) return;