Browse Source

remove add + multiplyScalar.

Ben Houston 9 years ago
parent
commit
68ae47daaa
2 changed files with 4 additions and 21 deletions
  1. 4 2
      examples/js/controls/OrbitControls.js
  2. 0 19
      src/math/Spherical.js

+ 4 - 2
examples/js/controls/OrbitControls.js

@@ -141,7 +141,8 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 			}
 
-			spherical.add( sphericalDelta );
+			spherical.theta += sphericalDelta.theta;
+			spherical.phi += sphericalDelta.phi;
 
 			// restrict theta to be between desired limits
 			spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) );
@@ -171,7 +172,8 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 			if ( scope.enableDamping === true ) {
 
-				sphericalDelta.multiplyScalar( 1 - scope.dampingFactor );
+				spherical.theta *= ( 1 - scope.dampingFactor );
+				spherical.phi *= ( 1 - scope.dampingFactor );
 
 			} else {
 

+ 0 - 19
src/math/Spherical.js

@@ -47,25 +47,6 @@ THREE.Spherical.prototype = {
 
 	},
 
-  add: function ( other ) {
-
-		this.radius += other.radius;
-    this.phi += other.phi;
-    this.theta += other.theta;
-
-    return this;
-
-  },
-
-  multiplyScalar: function( scalar ) {
-
-		this.radius *= scalar;
-    this.phi *= scalar;
-    this.theta *= scalar;
-
-    return this;
-  },
-
 	// restrict phi to be betwee EPS and PI-EPS
 	makeSafe: function() {