Selaa lähdekoodia

use tab instead of whitespace

Simon Thiele 10 vuotta sitten
vanhempi
commit
aa7aac3075
2 muutettua tiedostoa jossa 46 lisäystä ja 46 poistoa
  1. 2 2
      test/unit/cameras/Camera.js
  2. 44 44
      test/unit/core/Object3D.js

+ 2 - 2
test/unit/cameras/Camera.js

@@ -5,8 +5,8 @@
 module( "Camera" );
 
 test( "lookAt", function() {
-  var obj = new THREE.Camera();
-  obj.lookAt(new THREE.Vector3(0, 1, -1));
+	var obj = new THREE.Camera();
+	obj.lookAt(new THREE.Vector3(0, 1, -1));
 
 	ok( obj.rotation.x * (180 / Math.PI) === 45 , "x is equal" );
 });

+ 44 - 44
test/unit/core/Object3D.js

@@ -7,96 +7,96 @@ module( "Object3D" );
 var RadToDeg = 180 / Math.PI;
 
 test( "rotateX", function() {
-  var obj = new THREE.Object3D();
+	var obj = new THREE.Object3D();
 
-  var angleInRad = 1.562;
-  obj.rotateX(angleInRad);
+	var angleInRad = 1.562;
+	obj.rotateX(angleInRad);
 
-  // should calculate the correct rotation on x
-  checkIfFloatsAreEqual(obj.rotation.x, angleInRad);
+	// should calculate the correct rotation on x
+	checkIfFloatsAreEqual(obj.rotation.x, angleInRad);
 });
 
 test( "rotateY", function() {
-  var obj = new THREE.Object3D();
+	var obj = new THREE.Object3D();
 
-  var angleInRad = -0.346;
-  obj.rotateY(angleInRad);
+	var angleInRad = -0.346;
+	obj.rotateY(angleInRad);
 
-  // should calculate the correct rotation on y
-  checkIfFloatsAreEqual(obj.rotation.y, angleInRad);
+	// should calculate the correct rotation on y
+	checkIfFloatsAreEqual(obj.rotation.y, angleInRad);
 });
 
 test( "rotateZ", function() {
-  var obj = new THREE.Object3D();
+	var obj = new THREE.Object3D();
 
-  var angleInRad = 1;
-  obj.rotateZ(angleInRad);
+	var angleInRad = 1;
+	obj.rotateZ(angleInRad);
 
-  // should calculate the correct rotation on y
-  checkIfFloatsAreEqual(obj.rotation.z, angleInRad);
+	// should calculate the correct rotation on y
+	checkIfFloatsAreEqual(obj.rotation.z, angleInRad);
 });
 
 test( "translateOnAxis", function() {
-  var obj = new THREE.Object3D();
+	var obj = new THREE.Object3D();
 
-  // get a reference object for comparing
+	// get a reference object for comparing
 	var reference = {x: 1, y: 1.23, z: -4.56};
-  obj.translateOnAxis(new THREE.Vector3(1, 0, 0), 1);
-  obj.translateOnAxis(new THREE.Vector3(0, 1, 0), 1.23);
-  obj.translateOnAxis(new THREE.Vector3(0, 0, 1), -4.56);
+	obj.translateOnAxis(new THREE.Vector3(1, 0, 0), 1);
+	obj.translateOnAxis(new THREE.Vector3(0, 1, 0), 1.23);
+	obj.translateOnAxis(new THREE.Vector3(0, 0, 1), -4.56);
 
-  checkIfPropsAreEqual(reference, obj.position);
+	checkIfPropsAreEqual(reference, obj.position);
 });
 
 test( "translateX", function() {
-  var obj = new THREE.Object3D();
-  obj.translateX(1.234);
+	var obj = new THREE.Object3D();
+	obj.translateX(1.234);
 
-  ok( obj.position.x === 1.234 , "x is equal" );
+	ok( obj.position.x === 1.234 , "x is equal" );
 });
 
 test( "translateY", function() {
-  var obj = new THREE.Object3D();
-  obj.translateY(1.234);
+	var obj = new THREE.Object3D();
+	obj.translateY(1.234);
 
-  ok( obj.position.y === 1.234 , "y is equal" );
+	ok( obj.position.y === 1.234 , "y is equal" );
 });
 
 test( "translateZ", function() {
-  var obj = new THREE.Object3D();
-  obj.translateZ(1.234);
+	var obj = new THREE.Object3D();
+	obj.translateZ(1.234);
 
-  ok( obj.position.z === 1.234 , "z is equal" );
+	ok( obj.position.z === 1.234 , "z is equal" );
 });
 
 test( "lookAt", function() {
-  var obj = new THREE.Object3D();
-  obj.lookAt(new THREE.Vector3(0, -1, 1));
+	var obj = new THREE.Object3D();
+	obj.lookAt(new THREE.Vector3(0, -1, 1));
 
-  ok( obj.rotation.x * RadToDeg === 45 , "x is equal" );
+	ok( obj.rotation.x * RadToDeg === 45 , "x is equal" );
 });
 
 test( "getWorldQuaternion", function() {
-  var obj = new THREE.Object3D();
+	var obj = new THREE.Object3D();
 
-  obj.lookAt(new THREE.Vector3(0, -1, 1));
-  ok( obj.getWorldRotation().x * RadToDeg === 45 , "x is equal" );
+	obj.lookAt(new THREE.Vector3(0, -1, 1));
+	ok( obj.getWorldRotation().x * RadToDeg === 45 , "x is equal" );
 
-  obj.lookAt(new THREE.Vector3(1, 0, 0));
-  ok( obj.getWorldRotation().y * RadToDeg === 90 , "y is equal" );
+	obj.lookAt(new THREE.Vector3(1, 0, 0));
+	ok( obj.getWorldRotation().y * RadToDeg === 90 , "y is equal" );
 });
 
 function checkIfPropsAreEqual(reference, obj) {
-  ok( obj.x === reference.x , "x is equal" );
-  ok( obj.y === reference.y , "y is equal!" );
-  ok( obj.z === reference.z , "z is equal!" );
+	ok( obj.x === reference.x , "x is equal" );
+	ok( obj.y === reference.y , "y is equal!" );
+	ok( obj.z === reference.z , "z is equal!" );
 }
 
 // since float equal checking is a mess in js, one solution is to cut off
 // decimal places
 function checkIfFloatsAreEqual(f1, f2) {
-  var f1Rounded = ((f1 * 1000) | 0) / 1000;
-  var f2Rounded = ((f2 * 1000) | 0) / 1000;
+	var f1Rounded = ((f1 * 1000) | 0) / 1000;
+	var f2Rounded = ((f2 * 1000) | 0) / 1000;
 
-  ok( f1Rounded === f2Rounded, "passed" );
+	ok( f1Rounded === f2Rounded, "passed" );
 }