Pārlūkot izejas kodu

remove Euler.clamp and Math.fpModulus per @WestLangley.

Ben Houston 12 gadi atpakaļ
vecāks
revīzija
9f86edff40
3 mainītis faili ar 1 papildinājumiem un 34 dzēšanām
  1. 0 10
      src/math/Euler.js
  2. 1 17
      src/math/Math.js
  3. 0 7
      test/unit/math/Euler.js

+ 0 - 10
src/math/Euler.js

@@ -241,16 +241,6 @@ THREE.Euler.prototype = {
 
 	},
 
-	clamp: function() {
-
-		// clamps to the range [ -Math.PI, Math.PI )
-
-		this.x = THREE.Math.fpModulus( this.x + Math.PI, THREE.Math.PI2, true ) - Math.PI;
-		this.y = THREE.Math.fpModulus( this.y + Math.PI, THREE.Math.PI2, true ) - Math.PI;
-		this.z = THREE.Math.fpModulus( this.z + Math.PI, THREE.Math.PI2, true ) - Math.PI;
-		
-	},
-
 	reorder: function() {
 
 		// WARNING: this discards revolution information -bhouston

+ 1 - 17
src/math/Math.js

@@ -115,22 +115,6 @@ THREE.Math = {
 
 		};
 
-	}(),
-
-	fpModulus: function( value, divisor, upperBound ) {
-
-		if( value < 0 ) {
-
-			value += Math.ceil( (- value) / divisor ) * divisor;
-
-		}
-		else if( value >= divisor ) {
-
-			value -= Math.floor( value / divisor ) * divisor;
-
-		}
-
-		return value;
-	}
+	}()
 
 };

+ 0 - 7
test/unit/math/Euler.js

@@ -51,13 +51,6 @@ test( "set", function() {
 	ok( ! a.equals( eulerZero ), "Passed!" );
 });
 
-test( "clamp", function() {
-	var a = new THREE.Euler( Math.PI*4, -Math.PI*2, 0, 'XYZ' );
-	ok( ! a.equals( eulerZero ), "Passed!" );
-	a.clamp();
-	ok( a.equals( eulerZero ), "Passed!" );
-});
-
 test( "Quaternion.setFromEuler/Euler.fromQuaternion", function() {
 	var testValues = [ eulerZero, eulerAxyz, eulerAzyx ];
 	for( var i = 0; i < testValues.length; i ++ ) {