Explorar o código

EditorControls: pass target for getCenter / getBoundingSphere

Kevin Ngo %!s(int64=6) %!d(string=hai) anos
pai
achega
12b89819d4
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      examples/js/controls/EditorControls.js

+ 3 - 2
examples/js/controls/EditorControls.js

@@ -32,6 +32,7 @@ THREE.EditorControls = function ( object, domElement ) {
 	var pointer = new THREE.Vector2();
 	var pointer = new THREE.Vector2();
 	var pointerOld = new THREE.Vector2();
 	var pointerOld = new THREE.Vector2();
 	var spherical = new THREE.Spherical();
 	var spherical = new THREE.Spherical();
+	var sphere = new THREE.Sphere();
 
 
 	// events
 	// events
 
 
@@ -45,8 +46,8 @@ THREE.EditorControls = function ( object, domElement ) {
 
 
 		if ( box.isEmpty() === false ) {
 		if ( box.isEmpty() === false ) {
 
 
-			center.copy( box.getCenter() );
-			distance = box.getBoundingSphere().radius;
+			box.getCenter( center );
+			distance = box.getBoundingSphere( sphere ).radius;
 
 
 		} else {
 		} else {