Jelajahi Sumber

Remove ( in fact just move and update ) existing unit test files

Tristan VALCKE 8 tahun lalu
induk
melakukan
ee856ebe1e
69 mengubah file dengan 0 tambahan dan 6966 penghapusan
  1. 0 107
      test/unit/animation/AnimationObjectGroup.js
  2. 0 25
      test/unit/cameras/Camera.js
  3. 0 41
      test/unit/cameras/OrthographicCamera.js
  4. 0 50
      test/unit/cameras/PerspectiveCamera.js
  5. 0 117
      test/unit/core/BufferAttribute.js
  6. 0 311
      test/unit/core/BufferGeometry.js
  7. 0 38
      test/unit/core/Clock.js
  8. 0 76
      test/unit/core/EventDispatcher.js
  9. 0 58
      test/unit/core/Face3.js
  10. 0 107
      test/unit/core/Geometry.js
  11. 0 29
      test/unit/core/InstancedBufferAttribute.js
  12. 0 53
      test/unit/core/InstancedBufferGeometry.js
  13. 0 20
      test/unit/core/InstancedInterleavedBuffer.js
  14. 0 46
      test/unit/core/InterleavedBuffer.js
  15. 0 36
      test/unit/core/InterleavedBufferAttribute.js
  16. 0 102
      test/unit/core/Object3D.js
  17. 0 119
      test/unit/core/Raycaster.js
  18. 0 87
      test/unit/extras/ImageUtils.test.js
  19. 0 125
      test/unit/extras/curves/CatmullRomCurve3.js
  20. 0 36
      test/unit/extras/helpers/BoxHelper.tests.js
  21. 0 38
      test/unit/geometries/BoxGeometry.tests.js
  22. 0 38
      test/unit/geometries/CircleBufferGeometry.tests.js
  23. 0 38
      test/unit/geometries/CircleGeometry.tests.js
  24. 0 46
      test/unit/geometries/CylinderGeometry.tests.js
  25. 0 34
      test/unit/geometries/DodecahedronGeometry.tests.js
  26. 0 274
      test/unit/geometries/EdgesGeometry.js
  27. 0 1
      test/unit/geometries/ExtrudeGeometry.tests.js
  28. 0 34
      test/unit/geometries/IcosahedronGeometry.tests.js
  29. 0 1
      test/unit/geometries/LatheGeometry.tests.js
  30. 0 34
      test/unit/geometries/OctahedronGeometry.tests.js
  31. 0 1
      test/unit/geometries/ParametricGeometry.tests.js
  32. 0 38
      test/unit/geometries/PlaneBufferGeometry.tests.js
  33. 0 38
      test/unit/geometries/PlaneGeometry.tests.js
  34. 0 1
      test/unit/geometries/PolyhedronGeometry.tests.js
  35. 0 42
      test/unit/geometries/RingGeometry.tests.js
  36. 0 1
      test/unit/geometries/ShapeGeometry.tests.js
  37. 0 44
      test/unit/geometries/SphereBufferGeometry.tests.js
  38. 0 44
      test/unit/geometries/SphereGeometry.tests.js
  39. 0 34
      test/unit/geometries/TetrahedronGeometry.tests.js
  40. 0 1
      test/unit/geometries/TextGeometry.tests.js
  41. 0 40
      test/unit/geometries/TorusGeometry.tests.js
  42. 0 41
      test/unit/geometries/TorusKnotGeometry.tests.js
  43. 0 1
      test/unit/geometries/TubeGeometry.tests.js
  44. 0 1
      test/unit/geometries/WireframeGeometry.tests.js
  45. 0 27
      test/unit/lights/AmbientLight.tests.js
  46. 0 28
      test/unit/lights/DirectionalLight.tests.js
  47. 0 35
      test/unit/lights/HemisphereLight.tests.js
  48. 0 27
      test/unit/lights/PointLight.tests.js
  49. 0 38
      test/unit/lights/RectAreaLight.tests.js
  50. 0 41
      test/unit/lights/SpotLight.tests.js
  51. 0 246
      test/unit/math/Box2.js
  52. 0 313
      test/unit/math/Box3.js
  53. 0 280
      test/unit/math/Color.js
  54. 0 22
      test/unit/math/Constants.js
  55. 0 134
      test/unit/math/Euler.js
  56. 0 156
      test/unit/math/Frustum.js
  57. 0 387
      test/unit/math/Interpolant.js
  58. 0 69
      test/unit/math/Line3.js
  59. 0 35
      test/unit/math/Math.js
  60. 0 212
      test/unit/math/Matrix3.js
  61. 0 328
      test/unit/math/Matrix4.js
  62. 0 197
      test/unit/math/Plane.js
  63. 0 350
      test/unit/math/Quaternion.js
  64. 0 331
      test/unit/math/Ray.js
  65. 0 112
      test/unit/math/Sphere.js
  66. 0 191
      test/unit/math/Triangle.js
  67. 0 262
      test/unit/math/Vector2.js
  68. 0 379
      test/unit/math/Vector3.js
  69. 0 318
      test/unit/math/Vector4.js

+ 0 - 107
test/unit/animation/AnimationObjectGroup.js

@@ -1,107 +0,0 @@
-/**
- * @author tschw
- */
-
-module( "AnimationObjectGroup" );
-
-var ObjectA = new THREE.Object3D(),
-	ObjectB = new THREE.Object3D(),
-	ObjectC = new THREE.Object3D(),
-
-	PathA = 'object.position',
-	PathB = 'object.rotation',
-	PathC = 'object.scale',
-
-	ParsedPathA = THREE.PropertyBinding.parseTrackName( PathA ),
-	ParsedPathB = THREE.PropertyBinding.parseTrackName( PathB ),
-	ParsedPathC = THREE.PropertyBinding.parseTrackName( PathC );
-
-
-test( "smoke test", function() {
-
-	var expect = function expect( testIndex, group, bindings, path, cached, roots ) {
-
-		var rootNodes = [], pathsOk = true, nodesOk = true;
-
-		for ( var i = group.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {
-
-			if ( bindings[ i ].path !== path ) pathsOk = false;
-			rootNodes.push( bindings[ i ].rootNode );
-
-		}
-
-		for ( var i = 0, n = roots.length; i !== n; ++ i ) {
-
-			if ( rootNodes.indexOf( roots[ i ] ) === -1 ) nodesOk = false;
-
-		}
-
-		ok( pathsOk, testIndex + " paths" );
-		ok( nodesOk, testIndex + " nodes");
-		ok( group.nCachedObjects_ === cached, testIndex + " cache size" );
-		ok( bindings.length - group.nCachedObjects_ === roots.length, testIndex + " object count" );
-
-	};
-
-	// initial state
-
-	var groupA = new THREE.AnimationObjectGroup();
-	ok( groupA instanceof THREE.AnimationObjectGroup, "constructor (w/o args)" );
-
-	var bindingsAA = groupA.subscribe_( PathA, ParsedPathA );
-	expect( 0, groupA, bindingsAA, PathA, 0, [] );
-
-	var groupB = new THREE.AnimationObjectGroup( ObjectA, ObjectB );
-	ok( groupB instanceof THREE.AnimationObjectGroup, "constructor (with args)" );
-
-	var bindingsBB = groupB.subscribe_( PathB, ParsedPathB );
-	expect( 1, groupB, bindingsBB, PathB, 0, [ ObjectA, ObjectB ] );
-
-	// add
-
-	groupA.add( ObjectA, ObjectB );
-	expect( 2, groupA, bindingsAA, PathA, 0, [ ObjectA, ObjectB ] );
-
-	groupB.add( ObjectC );
-	expect( 3, groupB, bindingsBB, PathB, 0, [ ObjectA, ObjectB, ObjectC ] );
-
-	// remove
-
-	groupA.remove( ObjectA, ObjectC );
-	expect( 4, groupA, bindingsAA, PathA, 1, [ ObjectB ] );
-
-	groupB.remove( ObjectA, ObjectB, ObjectC );
-	expect( 5, groupB, bindingsBB, PathB, 3, [] );
-
-	// subscribe after re-add
-
-	groupA.add( ObjectC );
-	expect( 6, groupA, bindingsAA, PathA, 1, [ ObjectB, ObjectC ] );
-	var bindingsAC = groupA.subscribe_( PathC, ParsedPathC );
-	expect( 7, groupA, bindingsAC, PathC, 1, [ ObjectB, ObjectC ] );
-
-	// re-add after subscribe
-
-	var bindingsBC = groupB.subscribe_( PathC, ParsedPathC );
-	groupB.add( ObjectA, ObjectB );
-	expect( 8, groupB, bindingsBB, PathB, 1, [ ObjectA, ObjectB ] );
-
-	// unsubscribe
-
-	var copyOfBindingsBC = bindingsBC.slice();
-	groupB.unsubscribe_( PathC );
-	groupB.add( ObjectC );
-	deepEqual( bindingsBC, copyOfBindingsBC, "no more update after unsubscribe" );
-
-	// uncache active
-
-	groupB.uncache( ObjectA );
-	expect( 9, groupB, bindingsBB, PathB, 0, [ ObjectB, ObjectC ] );
-
-	// uncache cached
-
-	groupA.uncache( ObjectA );
-	expect( 10, groupA, bindingsAC, PathC, 0, [ ObjectB, ObjectC ] );
-
-} );
-

+ 0 - 25
test/unit/cameras/Camera.js

@@ -1,25 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "Camera" );
-
-test( "lookAt", function() {
-	var cam = new THREE.Camera();
-	cam.lookAt(new THREE.Vector3(0, 1, -1));
-
-	ok( cam.rotation.x * (180 / Math.PI) === 45 , "x is equal" );
-});
-
-test( "clone", function() {
-	var cam = new THREE.Camera();
-
-	// fill the matrices with any nonsense values just to see if they get copied
-	cam.matrixWorldInverse.set( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );
-	cam.projectionMatrix.set( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );
-
-	var clonedCam = cam.clone();
-
-	ok( cam.matrixWorldInverse.equals(clonedCam.matrixWorldInverse) , "matrixWorldInverse is equal" );
-	ok( cam.projectionMatrix.equals(clonedCam.projectionMatrix) , "projectionMatrix is equal" );
-});

+ 0 - 41
test/unit/cameras/OrthographicCamera.js

@@ -1,41 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "OrthographicCamera" );
-
-test( "updateProjectionMatrix", function() {
-	var left = -1, right = 1, top = 1, bottom = -1, near = 1, far = 3;
-	var cam = new THREE.OrthographicCamera(left, right, top, bottom, near, far);
-
-	// updateProjectionMatrix is called in contructor
-	var pMatrix = cam.projectionMatrix.elements;
-
-	// orthographic projection is given my the 4x4 Matrix
-	// 2/r-l		0			 0		-(l+r/r-l)
-	//   0		2/t-b		 0		-(t+b/t-b)
-	//   0			0		-2/f-n	-(f+n/f-n)
-	//   0			0			 0				1
-
-	ok( pMatrix[0] === 2 / ( right - left ), "m[0,0] === 2 / (r - l)" );
-	ok( pMatrix[5] === 2 / ( top - bottom ), "m[1,1] === 2 / (t - b)" );
-	ok( pMatrix[10] === -2 / ( far - near ), "m[2,2] === -2 / (f - n)" );
-	ok( pMatrix[12] === - ( ( right + left ) / ( right - left ) ), "m[3,0] === -(r+l/r-l)" );
-	ok( pMatrix[13] === - ( ( top + bottom ) / ( top - bottom ) ), "m[3,1] === -(t+b/b-t)" );
-	ok( pMatrix[14] === - ( ( far + near ) / ( far - near ) ), "m[3,2] === -(f+n/f-n)" );
-});
-
-test( "clone", function() {
-	var left = -1.5, right = 1.5, top = 1, bottom = -1, near = 0.1, far = 42;
-	var cam = new THREE.OrthographicCamera(left, right, top, bottom, near, far);
-
-	var clonedCam = cam.clone();
-
-	ok( cam.left === clonedCam.left , "left is equal" );
-	ok( cam.right === clonedCam.right , "right is equal" );
-	ok( cam.top === clonedCam.top , "top is equal" );
-	ok( cam.bottom === clonedCam.bottom , "bottom is equal" );
-	ok( cam.near === clonedCam.near , "near is equal" );
-	ok( cam.far === clonedCam.far , "far is equal" );
-	ok( cam.zoom === clonedCam.zoom , "zoom is equal" );
-});

+ 0 - 50
test/unit/cameras/PerspectiveCamera.js

@@ -1,50 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "PerspectiveCamera" );
-
-test( "updateProjectionMatrix", function() {
-
-	var cam = new THREE.PerspectiveCamera( 75, 16 / 9, 0.1, 300.0 );
-
-	// updateProjectionMatrix is called in contructor
-	var m = cam.projectionMatrix;
-
-	// perspective projection is given my the 4x4 Matrix
-	// 2n/r-l		0			l+r/r-l				 0
-	//   0		2n/t-b	t+b/t-b				 0
-	//   0			0		-(f+n/f-n)	-(2fn/f-n)
-	//   0			0				-1					 0
-
-	// this matrix was calculated by hand via glMatrix.perspective(75, 16 / 9, 0.1, 300.0, pMatrix)
-	// to get a reference matrix from plain WebGL
-	var reference = new THREE.Matrix4().set(
-		0.7330642938613892, 0, 0, 0,
-		0, 1.3032253980636597, 0, 0,
-		0, 0, -1.000666856765747, -0.2000666856765747,
-		0, 0, -1, 0
-	);
-
-	ok( reference.equals(m) );
-});
-
-test( "clone", function() {
-	var near = 1,
-			far = 3,
-			bottom = -1,
-			top = 1,
-			aspect = 16 / 9,
-			fov = 90;
-
-	var cam = new THREE.PerspectiveCamera( fov, aspect, near, far );
-
-	var clonedCam = cam.clone();
-
-	ok( cam.fov === clonedCam.fov , "fov is equal" );
-	ok( cam.aspect === clonedCam.aspect , "aspect is equal" );
-	ok( cam.near === clonedCam.near , "near is equal" );
-	ok( cam.far === clonedCam.far , "far is equal" );
-	ok( cam.zoom === clonedCam.zoom , "zoom is equal" );
-	ok( cam.projectionMatrix.equals(clonedCam.projectionMatrix) , "projectionMatrix is equal" );
-});

+ 0 - 117
test/unit/core/BufferAttribute.js

@@ -1,117 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "BufferAttribute" );
-
-test( "count", function() {
-	ok(
-		new THREE.BufferAttribute( new Float32Array( [1, 2, 3, 4, 5, 6] ), 3 ).count === 2,
-		'count is equal to the number of chunks'
-	);
-});
-
-test( "copy", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array( [1, 2, 3, 4, 5, 6] ), 3 );
-	attr.setDynamic( true );
-	attr.needsUpdate = true;
-
-	var attrCopy = new THREE.BufferAttribute().copy( attr );
-
-	ok( attr.count === attrCopy.count, 'count is equal' );
-	ok( attr.itemSize === attrCopy.itemSize, 'itemSize is equal' );
-	ok( attr.dynamic === attrCopy.dynamic, 'dynamic is equal' );
-	ok( attr.array.length === attrCopy.array.length, 'array length is equal' );
-	ok( attr.version === 1 && attrCopy.version === 0, 'version is not copied which is good' );
-});
-
-test( "copyAt", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array( [1, 2, 3, 4, 5, 6, 7, 8, 9] ), 3 );
-	var attr2 = new THREE.BufferAttribute( new Float32Array(9), 3 );
-
-	attr2.copyAt( 1, attr, 2 );
-	attr2.copyAt( 0, attr, 1 );
-	attr2.copyAt( 2, attr, 0 );
-
-	var i = attr.array;
-	var i2 = attr2.array; // should be [4, 5, 6, 7, 8, 9, 1, 2, 3]
-
-	ok( i2[0] === i[3] && i2[1] === i[4] && i2[2] === i[5], 'chunck copied to correct place' );
-	ok( i2[3] === i[6] && i2[4] === i[7] && i2[5] === i[8], 'chunck copied to correct place' );
-	ok( i2[6] === i[0] && i2[7] === i[1] && i2[8] === i[2], 'chunck copied to correct place' );
-});
-
-test( "copyColorsArray", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array(6), 3 );
-
-	attr.copyColorsArray( [
-		new THREE.Color( 0, 0.5, 1 ),
-		new THREE.Color( 0.25, 1, 0 )
-	]);
-
-	var i = attr.array;
-	ok( i[0] === 0 && i[1] === 0.5 && i[2] === 1, 'first color was copied correctly' );
-	ok( i[3] === 0.25 && i[4] === 1 && i[5] === 0, 'second color was copied correctly' );
-});
-
-test( "copyIndicesArray", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array(6), 3 );
-
-	attr.copyIndicesArray( [
-		{a: 1, b: 2, c: 3},
-		{a: 4, b: 5, c: 6}
-	]);
-
-	var i = attr.array;
-	ok( i[0] === 1 && i[1] === 2 && i[2] === 3, 'first indices were copied correctly' );
-	ok( i[3] === 4 && i[4] === 5 && i[5] === 6, 'second indices were copied correctly' );
-});
-
-test( "copyVector2sArray", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array(4), 2 );
-
-	attr.copyVector2sArray( [
-		new THREE.Vector2(1, 2),
-		new THREE.Vector2(4, 5)
-	]);
-
-	var i = attr.array;
-	ok( i[0] === 1 && i[1] === 2, 'first vector was copied correctly' );
-	ok( i[2] === 4 && i[3] === 5, 'second vector was copied correctly' );
-});
-
-test( "copyVector3sArray", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array(6), 2 );
-
-	attr.copyVector3sArray( [
-		new THREE.Vector3(1, 2, 3),
-		new THREE.Vector3(10, 20, 30)
-	]);
-
-	var i = attr.array;
-	ok( i[0] === 1 && i[1] === 2 && i[2] === 3, 'first vector was copied correctly' );
-	ok( i[3] === 10 && i[4] === 20 && i[5] === 30, 'second vector was copied correctly' );
-});
-
-test( "copyVector4sArray", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array(8), 2 );
-
-	attr.copyVector4sArray( [
-		new THREE.Vector4(1, 2, 3, 4),
-		new THREE.Vector4(10, 20, 30, 40)
-	]);
-
-	var i = attr.array;
-	ok( i[0] === 1 && i[1] === 2 && i[2] === 3 && i[3] === 4, 'first vector was copied correctly' );
-	ok( i[4] === 10 && i[5] === 20 && i[6] === 30 && i[7] === 40, 'second vector was copied correctly' );
-});
-
-test( "clone", function() {
-	var attr = new THREE.BufferAttribute( new Float32Array([1, 2, 3, 4, 0.12, -12]), 2 );
-	var attrCopy = attr.clone();
-
-	ok( attr.array.length === attrCopy.array.length, 'attribute was cloned' );
-	for ( var i = 0; i < attr.array.length; i++ ) {
-		ok( attr.array[i] === attrCopy.array[i], 'array item is equal' );
-	}
-});

+ 0 - 311
test/unit/core/BufferGeometry.js

@@ -1,311 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "BufferGeometry" );
-
-var DegToRad = Math.PI / 180;
-
-test( "add / delete Attribute", function() {
-	var geometry = new THREE.BufferGeometry();
-	var attributeName = "position";
-
-	ok ( geometry.attributes[attributeName] === undefined , 'no attribute defined' );
-
-	geometry.addAttribute( attributeName, new THREE.BufferAttribute( new Float32Array( [1, 2, 3], 1 ) ) );
-
-	ok ( geometry.attributes[attributeName] !== undefined , 'attribute is defined' );
-
-	geometry.removeAttribute( attributeName );
-
-	ok ( geometry.attributes[attributeName] === undefined , 'no attribute defined' );
-});
-
-test( "applyMatrix", function() {
-	var geometry = new THREE.BufferGeometry();
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array(6), 3 ) );
-
-	var matrix = new THREE.Matrix4().set(
-		1, 0, 0, 1.5,
-		0, 1, 0, -2,
-		0, 0, 1, 3,
-		0, 0, 0, 1
-	);
-	geometry.applyMatrix(matrix);
-
-	var position = geometry.attributes.position.array;
-	var m = matrix.elements;
-	ok( position[0] === m[12] && position[1] === m[13] && position[2] === m[14], "position was extracted from matrix" );
-	ok( position[3] === m[12] && position[4] === m[13] && position[5] === m[14], "position was extracted from matrix twice" );
-	ok( geometry.attributes.position.version === 1, "version was increased during update" );
-});
-
-test( "rotateX/Y/Z", function() {
-	var geometry = new THREE.BufferGeometry();
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array([1, 2, 3, 4, 5, 6]), 3 ) );
-
-	var pos = geometry.attributes.position.array;
-
-	geometry.rotateX( 180 * DegToRad );
-
-	// object was rotated around x so all items should be flipped but the x ones
-	ok( pos[0] === 1 && pos[1] === -2 && pos[2] === -3 &&
-			pos[3] === 4 && pos[4] === -5 && pos[5] === -6, "vertices were rotated around x by 180 degrees" );
-
-
-	geometry.rotateY( 180 * DegToRad );
-
-	// vertices were rotated around y so all items should be flipped again but the y ones
-	ok( pos[0] === -1 && pos[1] === -2 && pos[2] === 3 &&
-			pos[3] === -4 && pos[4] === -5 && pos[5] === 6, "vertices were rotated around y by 180 degrees" );
-
-
-	geometry.rotateZ( 180 * DegToRad );
-
-	// vertices were rotated around z so all items should be flipped again but the z ones
-	ok( pos[0] === 1 && pos[1] === 2 && pos[2] === 3 &&
-			pos[3] === 4 && pos[4] === 5 && pos[5] === 6, "vertices were rotated around z by 180 degrees" );
-});
-
-
-test( "translate", function() {
-	var geometry = new THREE.BufferGeometry();
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array([1, 2, 3, 4, 5, 6]), 3 ) );
-
-	var pos = geometry.attributes.position.array;
-
-	geometry.translate( 10, 20, 30 );
-
-	ok( pos[0] === 11 && pos[1] === 22 && pos[2] === 33 &&
-			pos[3] === 14 && pos[4] === 25 && pos[5] === 36, "vertices were translated" );
-});
-
-test( "scale", function() {
-	var geometry = new THREE.BufferGeometry();
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array([-1, -1, -1, 2, 2, 2]), 3 ) );
-
-	var pos = geometry.attributes.position.array;
-
-	geometry.scale( 1, 2, 3 );
-
-	ok( pos[0] === -1 && pos[1] === -2 && pos[2] === -3 &&
-			pos[3] === 2 && pos[4] === 4 && pos[5] === 6, "vertices were scaled" );
-});
-
-test( "center", function() {
-	var geometry = new THREE.BufferGeometry();
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array([
-		-1, -1, -1,
-		1, 1, 1,
-		4, 4, 4
-	]), 3 ) );
-
-	geometry.center();
-
-	var pos = geometry.attributes.position.array;
-	var bb = geometry.boundingBox;
-
-	// the boundingBox should go from (-1, -1, -1) to (4, 4, 4) so it has a size of (5, 5, 5)
-	// after centering it the vertices should be placed between (-2.5, -2.5, -2.5) and (2.5, 2.5, 2.5)
-	ok( pos[0] === -2.5 && pos[1] === -2.5 && pos[2] === -2.5 &&
-			pos[3] === -0.5 && pos[4] === -0.5 && pos[5] === -0.5 &&
-			pos[6] === 2.5 && pos[7] === 2.5 && pos[8] === 2.5, "vertices were replaced by boundingBox dimensions" );
-});
-
-test( "setFromObject", function() {
-	var lineGeo = new THREE.Geometry();
-	lineGeo.vertices.push(
-		new THREE.Vector3( -10, 0, 0 ),
-		new THREE.Vector3( 0, 10, 0 ),
-		new THREE.Vector3( 10, 0, 0 )
-	);
-
-	lineGeo.colors.push(
-		new THREE.Color(1, 0, 0 ),
-		new THREE.Color(0, 1, 0 ),
-		new THREE.Color(0, 0, 1 )
-	);
-
-	var line = new THREE.Line( lineGeo, null );
-	var geometry = new THREE.BufferGeometry().setFromObject( line );
-
-	var pos = geometry.attributes.position.array;
-	var col = geometry.attributes.color.array;
-	var v = lineGeo.vertices;
-	var c = lineGeo.colors;
-
-	ok(
-		 // position exists
-			pos !== undefined &&
-
-			// vertex arrays have the same size
-			v.length * 3 === pos.length &&
-
-			// there are three complete vertices (each vertex contains three values)
-			geometry.attributes.position.count === 3 &&
-
-			// check if both arrays contains the same data
-			pos[0] === v[0].x && pos[1] === v[0].y && pos[2] === v[0].z &&
-			pos[3] === v[1].x && pos[4] === v[1].y && pos[5] === v[1].z &&
-			pos[6] === v[2].x && pos[7] === v[2].y && pos[8] === v[2].z
-			, "positions are equal" );
-
-	ok(
-		 // color exists
-			col !== undefined &&
-
-			// color arrays have the same size
-			c.length * 3 === col.length &&
-
-			// there are three complete colors (each color contains three values)
-			geometry.attributes.color.count === 3 &&
-
-			// check if both arrays contains the same data
-			col[0] === c[0].r && col[1] === c[0].g && col[2] === c[0].b &&
-			col[3] === c[1].r && col[4] === c[1].g && col[5] === c[1].b &&
-			col[6] === c[2].r && col[7] === c[2].g && col[8] === c[2].b
-			, "colors are equal" );
-});
-
-test( "computeBoundingBox", function() {
-	var bb = getBBForVertices( [-1, -2, -3, 13, -2, -3.5, -1, -20, 0, -4, 5, 6] );
-
-	ok( bb.min.x === -4 && bb.min.y === -20 && bb.min.z === -3.5, "min values are set correctly" );
-	ok( bb.max.x === 13 && bb.max.y === 5 && bb.max.z === 6, "max values are set correctly" );
-
-
-	bb = getBBForVertices( [-1, -1, -1] );
-
-	ok( bb.min.x === bb.max.x && bb.min.y === bb.max.y && bb.min.z === bb.max.z, "since there is only one vertex, max and min are equal" );
-	ok( bb.min.x === -1 && bb.min.y === -1 && bb.min.z === -1, "since there is only one vertex, min and max are this vertex" );
-});
-
-test( "computeBoundingSphere", function() {
-	var bs = getBSForVertices( [-10, 0, 0, 10, 0, 0] );
-
-	ok( bs.radius === (10 + 10) / 2, "radius is equal to deltaMinMax / 2" )
-	ok( bs.center.x === 0 && bs.center.y === 0 && bs.center.y === 0, "bounding sphere is at ( 0, 0, 0 )" )
-
-
-	var bs = getBSForVertices( [-5, 11, -3, 5, -11, 3] );
-	var radius = new THREE.Vector3(5, 11, 3).length();
-
-	ok( bs.radius === radius, "radius is equal to directionLength" )
-	ok( bs.center.x === 0 && bs.center.y === 0 && bs.center.y === 0, "bounding sphere is at ( 0, 0, 0 )" )
-});
-
-function getBBForVertices(vertices) {
-	var geometry = new THREE.BufferGeometry();
-
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array(vertices), 3 ) );
-	geometry.computeBoundingBox();
-
-	return geometry.boundingBox;
-}
-
-function getBSForVertices(vertices) {
-	var geometry = new THREE.BufferGeometry();
-
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array(vertices), 3 ) );
-	geometry.computeBoundingSphere();
-
-	return geometry.boundingSphere;
-}
-
-test( "computeVertexNormals", function() {
-	// get normals for a counter clockwise created triangle
-	var normals = getNormalsForVertices([-1, 0, 0, 1, 0, 0, 0, 1, 0]);
-
-	ok( normals[0] === 0 && normals[1] === 0 && normals[2] === 1,
-		"first normal is pointing to screen since the the triangle was created counter clockwise" );
-
-	ok( normals[3] === 0 && normals[4] === 0 && normals[5] === 1,
-		"second normal is pointing to screen since the the triangle was created counter clockwise" );
-
-	ok( normals[6] === 0 && normals[7] === 0 && normals[8] === 1,
-		"third normal is pointing to screen since the the triangle was created counter clockwise" );
-
-
-	// get normals for a clockwise created triangle
-	var normals = getNormalsForVertices([1, 0, 0, -1, 0, 0, 0, 1, 0]);
-
-	ok( normals[0] === 0 && normals[1] === 0 && normals[2] === -1,
-		"first normal is pointing to screen since the the triangle was created clockwise" );
-
-	ok( normals[3] === 0 && normals[4] === 0 && normals[5] === -1,
-		"second normal is pointing to screen since the the triangle was created clockwise" );
-
-	ok( normals[6] === 0 && normals[7] === 0 && normals[8] === -1,
-		"third normal is pointing to screen since the the triangle was created clockwise" );
-
-
-	var normals = getNormalsForVertices([0, 0, 1, 0, 0, -1, 1, 1, 0]);
-
-	// the triangle is rotated by 45 degrees to the right so the normals of the three vertices
-	// should point to (1, -1, 0).normalized(). The simplest solution is to check against a normalized
-	// vector (1, -1, 0) but you will get calculation errors because of floating calculations so another
-	// valid technique is to create a vector which stands in 90 degrees to the normals and calculate the
-	// dot product which is the cos of the angle between them. This should be < floating calculation error
-	// which can be taken from Number.EPSILON
-	var direction = new THREE.Vector3(1, 1, 0).normalize(); // a vector which should have 90 degrees difference to normals
-	var difference = direction.dot( new THREE.Vector3( normals[0], normals[1], normals[2] ) );
-	ok( difference < Number.EPSILON, "normal is equal to reference vector");
-
-
-	// get normals for a line should be NAN because you need min a triangle to calculate normals
-	var normals = getNormalsForVertices([1, 0, 0, -1, 0, 0]);
-	for (var i = 0; i < normals.length; i++) {
-		ok ( !normals[i], "normals can't be calculated which is good");
-	}
-});
-
-function getNormalsForVertices(vertices) {
-	var geometry = new THREE.BufferGeometry();
-
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array(vertices), 3 ) );
-
-	geometry.computeVertexNormals();
-
-	ok( geometry.attributes.normal !== undefined, "normal attribute was created" );
-
-	return geometry.attributes.normal.array;
-}
-
-test( "merge", function() {
-	var geometry1 = new THREE.BufferGeometry();
-	geometry1.addAttribute( "attrName", new THREE.BufferAttribute( new Float32Array([1, 2, 3, 0, 0, 0]), 3 ) );
-
-	var geometry2 = new THREE.BufferGeometry();
-	geometry2.addAttribute( "attrName", new THREE.BufferAttribute( new Float32Array([4, 5, 6]), 3 ) );
-
-	var attr = geometry1.attributes.attrName.array;
-
-	geometry1.merge(geometry2, 1);
-
-	// merged array should be 1, 2, 3, 4, 5, 6
-	for (var i = 0; i < attr.length; i++) {
-	  ok( attr[i] === i + 1, "");
-	}
-
-	geometry1.merge(geometry2);
-	ok( attr[0] === 4 && attr[1] === 5 && attr[2] === 6, "copied the 3 attributes without offset" );
-});
-
-test( "copy", function() {
-	var geometry = new THREE.BufferGeometry();
-	geometry.addAttribute( "attrName", new THREE.BufferAttribute( new Float32Array([1, 2, 3, 4, 5, 6]), 3 ) );
-	geometry.addAttribute( "attrName2", new THREE.BufferAttribute( new Float32Array([0, 1, 3, 5, 6]), 1 ) );
-
-	var copy = new THREE.BufferGeometry().copy(geometry);
-
-	ok( copy !== geometry && geometry.id !== copy.id, "new object was created" );
-
-	Object.keys(geometry.attributes).forEach(function(key) {
-		var attribute = geometry.attributes[key];
-		ok( attribute !== undefined, "all attributes where copied");
-
-		for (var i = 0; i < attribute.array.length; i++) {
-			ok( attribute.array[i] === copy.attributes[key].array[i], "values of the attribute are equal" );
-		}
-	});
-});

+ 0 - 38
test/unit/core/Clock.js

@@ -1,38 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "Clock" );
-
-function mockPerformance() {
-	self.performance = {
-		deltaTime: 0,
-
-		next: function( delta ) {
-			this.deltaTime += delta;
-		},
-
-		now: function() {
-			return this.deltaTime;
-		}
-	};
-}
-
-test( "clock with performance", function() {
-	mockPerformance();
-
-	var clock = new THREE.Clock();
-
-	clock.start();
-
-	self.performance.next(123);
-	ok( clock.getElapsedTime() === 0.123 , "okay");
-
-	self.performance.next(100);
-	ok( clock.getElapsedTime() === 0.223 , "okay");
-
-	clock.stop();
-
-	self.performance.next(1000);
-	ok( clock.getElapsedTime() === 0.223 , "don't update time if the clock was stopped");
-});

+ 0 - 76
test/unit/core/EventDispatcher.js

@@ -1,76 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "EventDispatcher" );
-
-test( "addEventListener", function() {
-	var eventDispatcher = new THREE.EventDispatcher();
-
-	var listener = {};
-	eventDispatcher.addEventListener( 'anyType', listener );
-
-	ok( eventDispatcher._listeners.anyType.length === 1, "listener with unknown type was added" );
-	ok( eventDispatcher._listeners.anyType[0] === listener, "listener with unknown type was added" );
-
-	eventDispatcher.addEventListener( 'anyType', listener );
-
-	ok( eventDispatcher._listeners.anyType.length === 1, "can't add one listener twice to same type" );
-	ok( eventDispatcher._listeners.anyType[0] === listener, "listener is still there" );
-});
-
-test( "hasEventListener", function() {
-	var eventDispatcher = new THREE.EventDispatcher();
-
-	var listener = {};
-	eventDispatcher.addEventListener( 'anyType', listener );
-
-	ok( eventDispatcher.hasEventListener( 'anyType', listener ), "listener was found" );
-	ok( !eventDispatcher.hasEventListener( 'anotherType', listener ), "listener was not found which is good" );
-});
-
-test( "removeEventListener", function() {
-	var eventDispatcher = new THREE.EventDispatcher();
-
-	var listener = {};
-
-	ok ( eventDispatcher._listeners === undefined, "there are no listeners by default" );
-
-	eventDispatcher.addEventListener( 'anyType', listener );
-	ok ( Object.keys( eventDispatcher._listeners ).length === 1 &&
-		eventDispatcher._listeners.anyType.length === 1, "if a listener was added, there is a new key" );
-
-	eventDispatcher.removeEventListener( 'anyType', listener );
-	ok ( eventDispatcher._listeners.anyType.length === 0, "listener was deleted" );
-
-	eventDispatcher.removeEventListener( 'unknownType', listener );
-	ok ( eventDispatcher._listeners.unknownType === undefined, "unknown types will be ignored" );
-
-	eventDispatcher.removeEventListener( 'anyType', undefined );
-	ok ( eventDispatcher._listeners.anyType.length === 0, "undefined listeners are ignored" );
-});
-
-test( "dispatchEvent", function() {
-	var eventDispatcher = new THREE.EventDispatcher();
-
-	var callCount = 0;
-	var listener = function() { callCount++; };
-
-	eventDispatcher.addEventListener( 'anyType', listener );
-	ok( callCount === 0, "no event, no call" );
-
-	eventDispatcher.dispatchEvent( { type: 'anyType' } );
-	ok( callCount === 1, "one event, one call" );
-
-	eventDispatcher.dispatchEvent( { type: 'anyType' } );
-	ok( callCount === 2, "two events, two calls" );
-});
-
-
-
-
-
-
-
-
-//

+ 0 - 58
test/unit/core/Face3.js

@@ -1,58 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "Face3" );
-
-test( "copy", function() {
-	var instance = new THREE.Face3(0, 1, 2, new THREE.Vector3(0, 1, 0), new THREE.Color(0.25, 0.5, 0.75), 2);
-	var copiedInstance = instance.copy(instance);
-
-	checkCopy(copiedInstance);
-	checkVertexAndColors(copiedInstance);
-});
-
-test( "copy", function() {
-	var instance = new THREE.Face3(0, 1, 2,
-		[new THREE.Vector3(0, 1, 0), new THREE.Vector3(1, 0, 1)],
-		[new THREE.Color(0.25, 0.5, 0.75), new THREE.Color(1, 0, 0.4)],
-		2);
-	var copiedInstance = instance.copy(instance);
-
-	checkCopy(copiedInstance);
-	checkVertexAndColorArrays(copiedInstance);
-});
-
-test( "clone", function() {
-	var instance = new THREE.Face3(0, 1, 2, new THREE.Vector3(0, 1, 0), new THREE.Color(0.25, 0.5, 0.75), 2);
-	var copiedInstance = instance.clone();
-
-	checkCopy(copiedInstance);
-	checkVertexAndColors(copiedInstance);
-});
-
-function checkCopy(copiedInstance) {
-	ok( copiedInstance instanceof THREE.Face3, "copy created the correct type" );
-	ok(
-		copiedInstance.a === 0 &&
-		copiedInstance.b === 1 &&
-		copiedInstance.c === 2 &&
-		copiedInstance.materialIndex === 2
-		,"properties where copied" );
-}
-
-function checkVertexAndColors(copiedInstance) {
-	ok(
-		copiedInstance.normal.x === 0 && copiedInstance.normal.y === 1 && copiedInstance.normal.z === 0 &&
-		copiedInstance.color.r === 0.25 && copiedInstance.color.g === 0.5 && copiedInstance.color.b === 0.75
-		,"properties where copied" );
-}
-
-function checkVertexAndColorArrays(copiedInstance) {
-	ok(
-		copiedInstance.vertexNormals[0].x === 0 && copiedInstance.vertexNormals[0].y === 1 && copiedInstance.vertexNormals[0].z === 0 &&
-		copiedInstance.vertexNormals[1].x === 1 && copiedInstance.vertexNormals[1].y === 0 && copiedInstance.vertexNormals[1].z === 1 &&
-		copiedInstance.vertexColors[0].r === 0.25 && copiedInstance.vertexColors[0].g === 0.5 && copiedInstance.vertexColors[0].b === 0.75 &&
-		copiedInstance.vertexColors[1].r === 1 && copiedInstance.vertexColors[1].g === 0 && copiedInstance.vertexColors[1].b === 0.4
-		,"properties where copied" );
-}

+ 0 - 107
test/unit/core/Geometry.js

@@ -1,107 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "Geometry" );
-
-test( "rotateX", function() {
-	var geometry = getGeometry();
-
-	var matrix = new THREE.Matrix4();
-	matrix.makeRotationX( Math.PI / 2 ); // 90 degree
-
-	geometry.applyMatrix( matrix );
-
-	var v0 = geometry.vertices[0], v1 = geometry.vertices[1], v2 = geometry.vertices[2];
-	ok ( v0.x === -0.5 && v0.y === 0 && v0.z === 0, "first vertex was rotated" );
-	ok ( v1.x === 0.5 && v1.y === 0 && v1.z === 0, "second vertex was rotated" );
-	ok ( v2.x === 0 && v2.y < Number.EPSILON && v2.z === 1, "third vertex was rotated" );
-});
-
-
-test( "rotateY", function() {
-	var geometry = getGeometry();
-
-	var matrix = new THREE.Matrix4();
-	matrix.makeRotationY( Math.PI ); // 180 degrees
-
-	geometry.applyMatrix( matrix );
-
-	var v0 = geometry.vertices[0], v1 = geometry.vertices[1], v2 = geometry.vertices[2];
-	ok ( v0.x === 0.5 && v0.y === 0 && v0.z < Number.EPSILON, "first vertex was rotated" );
-	ok ( v1.x === -0.5 && v1.y === 0 && v1.z < Number.EPSILON, "second vertex was rotated" );
-	ok ( v2.x === 0 && v2.y === 1 && v2.z === 0, "third vertex was rotated" );
-});
-
-test( "rotateZ", function() {
-	var geometry = getGeometry();
-
-	var matrix = new THREE.Matrix4();
-	matrix.makeRotationZ( Math.PI / 2 * 3 ); // 270 degrees
-
-	geometry.applyMatrix( matrix );
-
-	var v0 = geometry.vertices[0], v1 = geometry.vertices[1], v2 = geometry.vertices[2];
-	ok ( v0.x < Number.EPSILON && v0.y === 0.5 && v0.z === 0, "first vertex was rotated" );
-	ok ( v1.x < Number.EPSILON && v1.y === -0.5 && v1.z === 0, "second vertex was rotated" );
-	ok ( v2.x === 1 && v2.y < Number.EPSILON && v2.z === 0, "third vertex was rotated" );
-});
-
-test( "fromBufferGeometry", function() {
-	var bufferGeometry = new THREE.BufferGeometry();
-	bufferGeometry.addAttribute('position', new THREE.BufferAttribute(new Float32Array( [1, 2, 3, 4, 5, 6, 7, 8, 9] ), 3 ) );
-	bufferGeometry.addAttribute('color', new THREE.BufferAttribute(new Float32Array( [0, 0, 0, 0.5, 0.5, 0.5, 1, 1, 1] ), 3 ) );
-	bufferGeometry.addAttribute('normal', new THREE.BufferAttribute(new Float32Array( [0, 1, 0, 1, 0, 1, 1, 1, 0] ), 3 ) );
-	bufferGeometry.addAttribute('uv', new THREE.BufferAttribute(new Float32Array( [0, 0, 0, 1, 1, 1] ), 2 ) );
-	bufferGeometry.addAttribute('uv2', new THREE.BufferAttribute(new Float32Array( [0, 0, 0, 1, 1, 1] ), 2 ) );
-
-	var geometry = new THREE.Geometry().fromBufferGeometry( bufferGeometry );
-
-	var colors = geometry.colors;
-	ok (
-		colors[0].r === 0 && colors[0].g === 0 && colors[0].b === 0 &&
-		colors[1].r === 0.5 && colors[1].g === 0.5 && colors[1].b === 0.5 &&
-		colors[2].r === 1 && colors[2].g === 1 && colors[2].b === 1
-		, "colors were created well" );
-
-	var vertices = geometry.vertices;
-	ok (
-		vertices[0].x === 1 && vertices[0].y === 2 && vertices[0].z === 3 &&
-		vertices[1].x === 4 && vertices[1].y === 5 && vertices[1].z === 6 &&
-		vertices[2].x === 7 && vertices[2].y === 8 && vertices[2].z === 9
-		, "vertices were created well" );
-
-	var vNormals = geometry.faces[0].vertexNormals;
-	ok (
-		vNormals[0].x === 0 && vNormals[0].y === 1 && vNormals[0].z === 0 &&
-		vNormals[1].x === 1 && vNormals[1].y === 0 && vNormals[1].z === 1 &&
-		vNormals[2].x === 1 && vNormals[2].y === 1 && vNormals[2].z === 0
-		, "vertex normals were created well" );
-});
-
-test( "normalize", function() {
-	var geometry = getGeometry();
-	geometry.computeLineDistances();
-
-	var distances = geometry.lineDistances;
-	ok( distances[0] === 0, "distance to the 1st point is 0" );
-	ok( distances[1] === 1 + distances[0], "distance from the 1st to the 2nd is sqrt(2nd - 1st) + distance - 1" );
-	ok( distances[2] === Math.sqrt( 0.5 * 0.5 + 1 ) + distances[1], "distance from the 1st to the 3nd is sqrt(3rd - 2nd) + distance - 1" );
-});
-
-function getGeometryByParams( x1, y1, z1, x2, y2, z2, x3, y3, z3 ) {
-	var geometry = new THREE.Geometry();
-
-	// a triangle
-	geometry.vertices = [
-		new THREE.Vector3( x1, y1, z1 ),
-		new THREE.Vector3( x2, y2, z2 ),
-		new THREE.Vector3( x3, y3, z3 )
-	];
-
-	return geometry;
-}
-
-function getGeometry() {
-	return getGeometryByParams( -0.5, 0, 0, 0.5, 0, 0, 0, 1, 0 );
-}

+ 0 - 29
test/unit/core/InstancedBufferAttribute.js

@@ -1,29 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "InstancedBufferAttribute" );
-
-test( "can be created", function() {
-	var instance = new THREE.InstancedBufferAttribute(new Float32Array(10), 2);
-	ok( instance.meshPerAttribute === 1, "ok" );
-
-	instance = new THREE.InstancedBufferAttribute(new Float32Array(10), 2, 123);
-	ok( instance.meshPerAttribute === 123, "ok" );
-
-});
-
-test( "copy", function() {
-	var array = new Float32Array( [1, 2, 3, 7, 8, 9] );
-	var instance = new THREE.InstancedBufferAttribute( array, 2, 123 );
-	var copiedInstance = instance.copy( instance );
-
-	ok( copiedInstance instanceof THREE.InstancedBufferAttribute, "the clone has the correct type" );
-	ok( copiedInstance.itemSize === 2, "itemSize was copied" );
-	ok( copiedInstance.meshPerAttribute === 123, "meshPerAttribute was copied" );
-
-	for (var i = 0; i < array.length; i++) {
-		ok( copiedInstance.array[i] === array[i], "array was copied" );
-	}
-
-});

+ 0 - 53
test/unit/core/InstancedBufferGeometry.js

@@ -1,53 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "InstancedBufferGeometry" );
-
-function createClonableMock() {
-	return {
-		callCount: 0,
-
-		clone: function() {
-			this.callCount++;
-
-			return this;
-		}
-	}
-}
-
-test( "copy", function() {
-	var instanceMock1 = {};
-	var instanceMock2 = {};
-	var indexMock = createClonableMock();
-	var defaultAttribute1 = new THREE.BufferAttribute([1]);
-	var defaultAttribute2 = new THREE.BufferAttribute([2]);
-
-	var instance = new THREE.InstancedBufferGeometry();
-
-	instance.addGroup( 0, 10, instanceMock1 );
-	instance.addGroup( 10, 5, instanceMock2 );
-	instance.setIndex( indexMock );
-	instance.addAttribute( 'defaultAttribute1', defaultAttribute1 );
-	instance.addAttribute( 'defaultAttribute2', defaultAttribute2 );
-
-	var copiedInstance = instance.copy( instance );
-
-	ok( copiedInstance instanceof THREE.InstancedBufferGeometry, "the clone has the correct type" );
-
-	ok( copiedInstance.index === indexMock, "index was copied" );
-	ok( copiedInstance.index.callCount === 1, "index.clone was called once" );
-
-	ok( copiedInstance.attributes['defaultAttribute1'] instanceof THREE.BufferAttribute, "attribute was created" );
-	// the given attribute mock was passed to the array property of the created buffer attribute
-	ok( copiedInstance.attributes['defaultAttribute1'].array[0] === defaultAttribute1.array, "attribute was copied" );
-	ok( copiedInstance.attributes['defaultAttribute2'].array[0] === defaultAttribute2.array, "attribute was copied" );
-
-	ok( copiedInstance.groups[0].start === 0, "group was copied" );
-	ok( copiedInstance.groups[0].count === 10, "group was copied" );
-	ok( copiedInstance.groups[0].instances === instanceMock1, "group was copied" );
-
-	ok( copiedInstance.groups[1].start === 10, "group was copied" );
-	ok( copiedInstance.groups[1].count === 5, "group was copied" );
-	ok( copiedInstance.groups[1].instances === instanceMock2, "group was copied" );
-});

+ 0 - 20
test/unit/core/InstancedInterleavedBuffer.js

@@ -1,20 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "InstancedInterleavedBuffer" );
-
-test( "can be created", function() {
-	var array = new Float32Array( [1, 2, 3, 7, 8, 9] );
-	var instance = new THREE.InstancedInterleavedBuffer( array, 3 );
-
-	ok( instance.meshPerAttribute === 1, "ok" );
-});
-
-test( "copy", function() {
-	var array = new Float32Array( [1, 2, 3, 7, 8, 9] );
-	var instance = new THREE.InstancedInterleavedBuffer( array, 3 );
-	var copiedInstance = instance.copy( instance );
-
-	ok( copiedInstance.meshPerAttribute === 1, "additional attribute was copied" );
-});

+ 0 - 46
test/unit/core/InterleavedBuffer.js

@@ -1,46 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "InterleavedBuffer" );
-
-function checkInstanceAgainstCopy( instance, copiedInstance ) {
-	ok( copiedInstance instanceof THREE.InterleavedBuffer, "the clone has the correct type" );
-
-	for ( var i = 0; i < instance.array.length; i++ ) {
-		ok( copiedInstance.array[i] === instance.array[i], "array was copied" );
-	}
-
-	ok( copiedInstance.stride === instance.stride, "stride was copied" );
-	ok( copiedInstance.dynamic === true, "dynamic was copied" );
-}
-
-test( "length and count", function() {
-	var instance = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-
-	ok( instance.length === 6, "length is calculated via array length" );
-	ok( instance.count === 2, "count is calculated via array length / stride" );
-});
-
-test( "copy", function() {
-	var array = new Float32Array( [1, 2, 3, 7, 8 ,9] );
-	var instance = new THREE.InterleavedBuffer( array, 3 );
-	instance.setDynamic( true );
-
-	checkInstanceAgainstCopy(instance, instance.copy( instance ) );
-});
-
-test( "clone", function() {
-	var array = new Float32Array( [1, 2, 3, 7, 8 ,9] );
-	var instance = new THREE.InterleavedBuffer( array, 3 );
-	instance.setDynamic( true );
-
-	checkInstanceAgainstCopy( instance, instance.clone() );
-});
-
-test( "set", function() {
-	var instance = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-
-	instance.set( [0, -1] );
-	ok( instance.array[0] === 0 && instance.array[1] === -1, "replace at first by default" );
-});

+ 0 - 36
test/unit/core/InterleavedBufferAttribute.js

@@ -1,36 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "InterleavedBufferAttribute" );
-
-test( "length and count", function() {
-	var buffer = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-	var instance = new THREE.InterleavedBufferAttribute( buffer, 2, 0 );
-
-	ok( instance.count === 2, "count is calculated via array length / stride" );
-});
-
-test( "setX", function() {
-	var buffer = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-	var instance = new THREE.InterleavedBufferAttribute( buffer, 2, 0 );
-
-	instance.setX( 0, 123 );
-	instance.setX( 1, 321 );
-
-	ok( instance.data.array[0] === 123 &&
-			instance.data.array[3] === 321, "x was calculated correct based on index and default offset" );
-
-
-	buffer = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-	instance = new THREE.InterleavedBufferAttribute( buffer, 2, 1 );
-
-	instance.setX( 0, 123 );
-	instance.setX( 1, 321 );
-
-	// the offset was defined as 1, so go one step futher in the array
-	ok( instance.data.array[1] === 123 &&
-			instance.data.array[4] === 321, "x was calculated correct based on index and default offset" );
-});
-
-// setY, setZ and setW are calculated in the same way so not testing this

+ 0 - 102
test/unit/core/Object3D.js

@@ -1,102 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "Object3D" );
-
-var RadToDeg = 180 / Math.PI;
-
-test( "rotateX", function() {
-	var obj = new THREE.Object3D();
-
-	var angleInRad = 1.562;
-	obj.rotateX(angleInRad);
-
-	// should calculate the correct rotation on x
-	checkIfFloatsAreEqual(obj.rotation.x, angleInRad);
-});
-
-test( "rotateY", function() {
-	var obj = new THREE.Object3D();
-
-	var angleInRad = -0.346;
-	obj.rotateY(angleInRad);
-
-	// should calculate the correct rotation on y
-	checkIfFloatsAreEqual(obj.rotation.y, angleInRad);
-});
-
-test( "rotateZ", function() {
-	var obj = new THREE.Object3D();
-
-	var angleInRad = 1;
-	obj.rotateZ(angleInRad);
-
-	// should calculate the correct rotation on y
-	checkIfFloatsAreEqual(obj.rotation.z, angleInRad);
-});
-
-test( "translateOnAxis", function() {
-	var obj = new THREE.Object3D();
-
-	// 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);
-
-	checkIfPropsAreEqual(reference, obj.position);
-});
-
-test( "translateX", function() {
-	var obj = new THREE.Object3D();
-	obj.translateX(1.234);
-
-	ok( obj.position.x === 1.234 , "x is equal" );
-});
-
-test( "translateY", function() {
-	var obj = new THREE.Object3D();
-	obj.translateY(1.234);
-
-	ok( obj.position.y === 1.234 , "y is equal" );
-});
-
-test( "translateZ", function() {
-	var obj = new THREE.Object3D();
-	obj.translateZ(1.234);
-
-	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));
-
-	ok( obj.rotation.x * RadToDeg === 45 , "x is equal" );
-});
-
-test( "getWorldRotation", function() {
-	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(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!" );
-}
-
-// 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;
-
-	ok( f1Rounded === f2Rounded, "passed" );
-}

+ 0 - 119
test/unit/core/Raycaster.js

@@ -1,119 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-module( "Raycaster" );
-
-test( "intersectObjects", function() {
-	var raycaster = getRaycaster();
-	var objectsToCheck = getObjectsToCheck();
-
-	ok ( raycaster.intersectObjects( objectsToCheck ).length === 1,
-		"no recursive search should lead to one hit" );
-
-	ok ( raycaster.intersectObjects( objectsToCheck, true ).length === 3,
-		"recursive search should lead to three hits" );
-
-	var intersections = raycaster.intersectObjects( objectsToCheck, true );
-	for ( var i = 0; i < intersections.length - 1; i++ ) {
-
-	  ok( intersections[ i ].distance <= intersections[ i + 1 ].distance, "intersections are sorted" );
-
-	}
-});
-
-test( "intersectObject", function() {
-	var raycaster = getRaycaster();
-	var objectsToCheck = getObjectsToCheck();
-
-	ok ( raycaster.intersectObject( objectsToCheck[ 0 ] ).length === 1,
-		"no recursive search should lead to one hit" );
-
-	ok ( raycaster.intersectObject( objectsToCheck[ 0 ], true ).length === 3,
-		"recursive search should lead to three hits" );
-
-	var intersections = raycaster.intersectObject( objectsToCheck[ 0 ], true );
-	for ( var i = 0; i < intersections.length - 1; i++ ) {
-
-	  ok( intersections[ i ].distance <= intersections[ i + 1 ].distance, "intersections are sorted" );
-
-	}
-});
-
-test( "setFromCamera", function() {
-	var raycaster = new THREE.Raycaster();
-	var rayDirection = raycaster.ray.direction;
-	var camera = new THREE.PerspectiveCamera( 90, 1, 1, 1000 );
-
-	raycaster.setFromCamera( { x : 0, y: 0 }, camera );
-	ok( rayDirection.x === 0, rayDirection.y === 0, rayDirection.z === -1,
-		"camera is looking straight to -z and so does the ray in the middle of the screen" );
-
-	var step = 0.1;
-
-	for ( var x = -1; x <= 1; x += step ) {
-
-		for ( var y = -1; y <= 1; y += step ) {
-
-			raycaster.setFromCamera( { x, y }, camera );
-
-			var refVector = new THREE.Vector3( x, y, -1 ).normalize();
-
-			checkRayDirectionAgainstReferenceVector( rayDirection, refVector );
-
-		}
-
-	}
-});
-
-function checkRayDirectionAgainstReferenceVector( rayDirection, refVector ) {
-	ok( refVector.x - rayDirection.x <= Number.EPSILON &&
-			refVector.y - rayDirection.y <= Number.EPSILON &&
-			refVector.z - rayDirection.z <= Number.EPSILON,
-			"camera is pointing to the same direction as expected" );
-}
-
-function getRaycaster() {
-	return raycaster = new THREE.Raycaster(
-		new THREE.Vector3( 0, 0, 0 ),
-		new THREE.Vector3( 0, 0, -1 ),
-		1,
-		100
-	);
-}
-
-function getObjectsToCheck() {
-	var objects = [];
-
-	var sphere1 = getSphere();
-	sphere1.position.set( 0, 0, -10 );
-	sphere1.name = 1;
-	objects.push( sphere1 );
-
-	var sphere11 = getSphere();
-	sphere11.position.set( 0, 0, 1 );
-	sphere11.name = 11;
-	sphere1.add( sphere11 );
-
-	var sphere12 = getSphere();
-	sphere12.position.set( 0, 0, -1 );
-	sphere12.name = 12;
-	sphere1.add( sphere12 );
-
-	var sphere2 = getSphere();
-	sphere2.position.set( -5, 0, -5 );
-	sphere2.name = 2;
-	objects.push( sphere2 );
-
-	for ( var i = 0; i < objects.length; i++ ) {
-
-		objects[ i ].updateMatrixWorld();
-
-	}
-
-	return objects;
-}
-
-function getSphere() {
-	return new THREE.Mesh( new THREE.SphereGeometry( 1, 100, 100 ) );
-}

+ 0 - 87
test/unit/extras/ImageUtils.test.js

@@ -1,87 +0,0 @@
-QUnit.module( "ImageLoader", {
-
-	beforeEach: function() {
-
-		THREE.Cache.clear();
-
-	}
-
-});
-
-
-var good_url = '../../examples/textures/sprite.png';
-var bad_url = 'url_not_found';
-
-
-QUnit.test( "test load handler", function( assert ) {
-
-	var done = assert.async();
-
-  new THREE.TextureLoader().load(good_url, function ( tex ) {
-
-		assert.success( "load handler should be called" );
-		assert.ok( tex, "texture is defined" );
-		assert.ok( tex.image, "texture.image is defined" );
-		done();
-
-	}, undefined, function () {
-
-		assert.fail( "error handler should not be called" );
-		done();
-
-	});
-});
-
-
-QUnit.test( "test error handler", function( assert ) {
-
-	var done = assert.async();
-
-	new THREE.TextureLoader().load(bad_url, function () {
-
-		assert.fail( "load handler should not be called" );
-		done();
-
-	},
-
-	undefined,
-
-	function ( event ) {
-
-		assert.success( "error handler should be called" );
-		assert.ok( event.type === 'error', "should have error event" );
-
-		done();
-
-	});
-
-});
-
-
-QUnit.test( "test cached texture", function( assert ) {
-
-	var done = assert.async();
-
-	var rtex1 = new THREE.TextureLoader().load(good_url, function ( tex1 ) {
-
-		assert.ok( rtex1.image !== undefined, "texture 1 image is loaded" );
-		assert.equal( rtex1, tex1, "texture 1 callback is equal to return" );
-
-		var rtex2 = new THREE.TextureLoader().load(good_url, function ( tex2 ) {
-
-			assert.ok( rtex2 !== undefined, "cached callback is async" );
-			assert.ok( rtex2.image !== undefined, "texture 2 image is loaded" );
-			assert.equal( rtex2, tex2, "texture 2 callback is equal to return" );
-
-			done();
-
-		});
-
-		assert.ok( rtex2, "texture 2 return is defined" );
-
-	});
-
-	assert.ok( rtex1, "texture 1 return is defined" );
-	assert.ok( rtex1.image === undefined, "texture 1 image is not loaded" );
-
-});

+ 0 - 125
test/unit/extras/curves/CatmullRomCurve3.js

@@ -1,125 +0,0 @@
-/**
- * @author zz85 / http://joshuakoo.com
- */
-
-module( "CatmullRomCurve3" );
-
-var positions = [
-	new THREE.Vector3( - 60, - 100,  60 ),
-	new THREE.Vector3( - 60,   20,  60 ),
-	new THREE.Vector3( - 60,  120,  60 ),
-	new THREE.Vector3(  60,   20, - 60 ),
-	new THREE.Vector3(  60, - 100, - 60 )
-];
-
-test( "catmullrom check", function() {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var catmullPoints = [
-
-		new THREE.Vector3( - 60, - 100, 60 ),
-		new THREE.Vector3( - 60, - 51.04, 60 ),
-		new THREE.Vector3( - 60, - 2.7199999999999998, 60 ),
-		new THREE.Vector3( - 61.92, 44.48, 61.92 ),
-		new THREE.Vector3( - 68.64, 95.36000000000001, 68.64 ),
-		new THREE.Vector3( - 60, 120, 60 ),
-		new THREE.Vector3( - 14.880000000000017, 95.36000000000001, 14.880000000000017 ),
-		new THREE.Vector3( 41.75999999999997, 44.48000000000003, - 41.75999999999997 ),
-		new THREE.Vector3( 67.68, - 4.640000000000025, - 67.68 ),
-		new THREE.Vector3( 65.75999999999999, - 59.68000000000002, - 65.75999999999999 ),
-		new THREE.Vector3( 60, - 100, - 60 )
-
-	];
-
-	var getPoints = curve.getPoints( 10 );
-	var error = vectorsAreEqual( getPoints, catmullPoints );
-	ok( getPoints.length == 11, 'getPoints should be equal.' );
-	var desc = error ? ' ' + error : '';
-	ok( ! error, 'Lists of Vectors3 should be equal.' + desc );
-
-} );
-
-test( "chordal basic check", function() {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-
-	curve.type = 'chordal';
-
-	var chordalPoints = [
-		new THREE.Vector3( - 60, - 100, 60 ),
-		new THREE.Vector3( - 60, - 52, 60 ),
-		new THREE.Vector3( - 60, - 4, 60 ),
-		new THREE.Vector3( - 60.656435889910924, 41.62455386421379, 60.656435889910924 ),
-		new THREE.Vector3( - 62.95396150459915, 87.31049238896205, 62.95396150459915 ),
-		new THREE.Vector3( - 60, 120, 60 ),
-		new THREE.Vector3( - 16.302568199486444, 114.1500463116312, 16.302568199486444 ),
-		new THREE.Vector3( 42.998098664956586, 54.017050116427455, - 42.998098664956586 ),
-		new THREE.Vector3( 63.542500175682434, - 3.0571533975463856, - 63.542500175682434 ),
-		new THREE.Vector3( 62.65687513176183, - 58.49286504815978, - 62.65687513176183 ),
-		new THREE.Vector3( 60.00000000000001, - 100, - 60.00000000000001 )
-	];
-
-	var getPoints = curve.getPoints( 10 );
-	var error = vectorsAreEqual( getPoints, chordalPoints );
-	ok( getPoints.length == 11, 'getPoints should be equal.' );
-	var desc = error ? ' ' + error : '';
-	ok( ! error, 'Lists of Vectors3 should be equal.' + desc );
-
-} );
-
-test( "centripetal basic check", function() {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'centripetal';
-
-	var centripetalPoints = [
-		new THREE.Vector3( - 60, - 100, 60 ),
-		new THREE.Vector3( - 60, - 51.47527724919028, 60 ),
-		new THREE.Vector3( - 60, - 3.300369665587032, 60 ),
-		new THREE.Vector3( - 61.13836565863938, 42.86306307781241, 61.13836565863938 ),
-		new THREE.Vector3( - 65.1226454638772, 90.69743905511538, 65.1226454638772 ),
-		new THREE.Vector3( - 60, 120, 60 ),
-		new THREE.Vector3( - 15.620412575504497, 103.10790870179872, 15.620412575504497 ),
-		new THREE.Vector3( 42.384384731047874, 48.35477686933143, - 42.384384731047874 ),
-		new THREE.Vector3( 65.25545512241153, - 3.5662509660683424, - 65.25545512241153 ),
-		new THREE.Vector3( 63.94159134180865, - 58.87468822455125, - 63.94159134180865 ),
-		new THREE.Vector3( 59.99999999999999, - 100, - 59.99999999999999 ),
-	];
-
-	var getPoints = curve.getPoints( 10 );
-	var error = vectorsAreEqual( getPoints, centripetalPoints );
-	ok( getPoints.length == 11, 'getPoints should be equal.' );
-	var desc = error ? ' ' + error : '';
-	ok( ! error, 'Lists of Vectors3 should be equal.' + desc );
-
-} );
-
-test( "closed catmullrom basic check", function() {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-	curve.closed = true;
-
-	var closedSplinePoints = [
-		new THREE.Vector3( - 60, - 100, 60 ),
-		new THREE.Vector3( - 67.5, - 46.25, 67.5 ),
-		new THREE.Vector3( - 60, 20, 60 ),
-		new THREE.Vector3( - 67.5, 83.75, 67.5 ),
-		new THREE.Vector3( - 60, 120, 60 ),
-		new THREE.Vector3( 0, 83.75, 0 ),
-		new THREE.Vector3( 60, 20, - 60 ),
-		new THREE.Vector3( 75, - 46.25, - 75 ),
-		new THREE.Vector3( 60, - 100, - 60 ),
-		new THREE.Vector3( 0, - 115, 0 ),
-		new THREE.Vector3( - 60, - 100, 60 ),
-	];
-
-	var getPoints = curve.getPoints( 10 );
-	var error = vectorsAreEqual( getPoints, closedSplinePoints );
-	ok( getPoints.length == 11, 'getPoints should be equal.' );
-	var desc = error ? ' ' + error : '';
-	ok( ! error, 'Lists of Vectors3 should be equal.' + desc );
-
-} );

+ 0 - 36
test/unit/extras/helpers/BoxHelper.tests.js

@@ -1,36 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		diameter: 10
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Helpers - BoxHelper", {
-
-		beforeEach: function() {
-			var greenMaterial = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
-
-			// Test with a normal cube and a box helper
-			var boxGeometry = new THREE.BoxGeometry( parameters.diameter );
-			var box = new THREE.Mesh( boxGeometry, greenMaterial );
-			var boxHelper = new THREE.BoxHelper( box );
-
-			// The same should happen with a comparable sphere
-			var sphereGeometry = new THREE.SphereGeometry( parameters.diameter / 2 );
-			var sphere = new THREE.Mesh( sphereGeometry, greenMaterial );
-			var sphereBoxHelper = new THREE.BoxHelper( sphere );
-
-			// Note that unlike what I'd like to, these doesn't check the equivalency of the two generated geometries
-			geometries = [ boxHelper.geometry, sphereBoxHelper.geometry ];
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-		runStdGeometryTests( assert, geometries );
-	});
-
-})();

+ 0 - 38
test/unit/geometries/BoxGeometry.tests.js

@@ -1,38 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		width: 10,
-		height: 20,
-		depth: 30,
-		widthSegments: 2,
-		heightSegments: 3,
-		depthSegments: 4
-	};
-
-	var geometries;
-	var box, cube, boxWithSegments;
-
-	QUnit.module( "Extras - Geometries - BoxGeometry", {
-
-		beforeEach: function() {
-
-			box = new THREE.BoxGeometry( parameters.width, parameters.height, parameters.depth );
-			cube = new THREE.CubeGeometry( parameters.width, parameters.height, parameters.depth );
-			boxWithSegments = new THREE.BoxGeometry( parameters.width, parameters.height, parameters.depth,
-													parameters.widthSegments, parameters.heightSegments, parameters.depthSegments );
-
-			geometries = [ box, cube, boxWithSegments ];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 38
test/unit/geometries/CircleBufferGeometry.tests.js

@@ -1,38 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		segments: 20,
-		thetaStart: 0.1,
-		thetaLength: 0.2
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - CircleBufferGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.CircleBufferGeometry(),
-				new THREE.CircleBufferGeometry( parameters.radius ),
-				new THREE.CircleBufferGeometry( parameters.radius, parameters.segments ),
-				new THREE.CircleBufferGeometry( parameters.radius, parameters.segments, parameters.thetaStart ),
-				new THREE.CircleBufferGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 38
test/unit/geometries/CircleGeometry.tests.js

@@ -1,38 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		segments: 20,
-		thetaStart: 0.1,
-		thetaLength: 0.2
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - CircleGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.CircleGeometry(),
-				new THREE.CircleGeometry( parameters.radius ),
-				new THREE.CircleGeometry( parameters.radius, parameters.segments ),
-				new THREE.CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart ),
-				new THREE.CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 46
test/unit/geometries/CylinderGeometry.tests.js

@@ -1,46 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radiusTop: 10,
-		radiusBottom: 20,
-		height: 30,
-		radialSegments: 20,
-		heightSegments: 30,
-		openEnded: true,
-		thetaStart: 0.1,
-		thetaLength: 2.0,
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - CylinderGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.CylinderGeometry(),
-				new THREE.CylinderGeometry( parameters.radiusTop ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ),
-				new THREE.CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 34
test/unit/geometries/DodecahedronGeometry.tests.js

@@ -1,34 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		detail: undefined
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - DodecahedronGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.DodecahedronGeometry(),
-				new THREE.DodecahedronGeometry( parameters.radius ),
-				new THREE.DodecahedronGeometry( parameters.radius, parameters.detail ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 274
test/unit/geometries/EdgesGeometry.js

@@ -1,274 +0,0 @@
-module( "EdgesGeometry" );
-
-var DEBUG = false;
-
-var vertList = [
-	new THREE.Vector3(0, 0, 0),
-	new THREE.Vector3(1, 0, 0),
-	new THREE.Vector3(1, 1, 0),
-	new THREE.Vector3(0, 1, 0),
-	new THREE.Vector3(1, 1, 1),
-];
-
-test( "singularity", function() {
-
-	testEdges( vertList, [1, 1, 1], 0 );
-
-});
-
-test( "needle", function() {
-
-	testEdges( vertList, [0, 0, 1], 0 );
-
-});
-
-test( "single triangle", function() {
-
-	testEdges( vertList, [0, 1, 2], 3 );
-
-});
-
-test( "two isolated triangles", function() {
-
-	var vertList = [
-		new THREE.Vector3(0, 0, 0),
-		new THREE.Vector3(1, 0, 0),
-		new THREE.Vector3(1, 1, 0),
-		new THREE.Vector3(0, 0, 1),
-		new THREE.Vector3(1, 0, 1),
-		new THREE.Vector3(1, 1, 1),
-	];
-
-	testEdges( vertList, [0, 1, 2, 3, 4, 5], 6 );
-
-});
-
-test( "two flat triangles", function() {
-
-	testEdges( vertList, [0, 1, 2, 0, 2, 3], 4 );
-
-});
-
-test( "two flat triangles, inverted", function() {
-
-	testEdges( vertList, [0, 1, 2, 0, 3, 2], 5 );
-
-});
-
-test( "two non-coplanar triangles", function() {
-
-	testEdges( vertList, [0, 1, 2, 0, 4, 2], 5 );
-
-});
-
-test( "three triangles, coplanar first", function() {
-
-	testEdges( vertList, [0, 1, 2, 0, 2, 3, 0, 4, 2], 7 );
-
-});
-
-test( "three triangles, coplanar last", function() {
-
-	testEdges( vertList, [0, 1, 2, 0, 4, 2, 0, 2, 3], 6 ); // Should be 7
-
-});
-
-test( "tetrahedron", function() {
-
-	testEdges( vertList, [0, 1, 2, 0, 1, 4, 0, 4, 2, 1, 2, 4], 6 );
-
-});
-
-
-
-//
-// HELPERS
-//
-
-
-function testEdges ( vertList, idxList, numAfter ) {
-
-	var geoms = createGeometries ( vertList, idxList );
-
-	for ( var i = 0 ; i < geoms.length ; i ++ ) {
-
-		var geom = geoms[i];
-
-		var numBefore = idxList.length;
-		equal( countEdges (geom), numBefore, "Edges before!" );
-
-		var egeom = new THREE.EdgesGeometry( geom );
-
-		equal( countEdges (egeom), numAfter, "Edges after!" );
-		output( geom, egeom );
-
-	}
-
-}
-
-function createGeometries ( vertList, idxList ) {
-
-	var geomIB = createIndexedBufferGeometry ( vertList, idxList );
-	var geom = new THREE.Geometry().fromBufferGeometry( geomIB );
-	var geomB = new THREE.BufferGeometry().fromGeometry( geom );
-	var geomDC = addDrawCalls( geomIB.clone() );
-	return [ geom, geomB, geomIB, geomDC ];
-
-}
-
-function createIndexedBufferGeometry ( vertList, idxList ) {
-
-	var geom = new THREE.BufferGeometry();
-
-	var indexTable = [];
-	var numTris = idxList.length / 3;
-	var numVerts = 0;
-
-	var indices = new Uint32Array( numTris * 3 );
-	var vertices = new Float32Array( vertList.length * 3 );
-
-	for ( var i = 0; i < numTris; i ++ ) {
-
-		for ( var j = 0; j < 3; j ++ ) {
-
-			var idx = idxList[ 3 * i + j ];
-			if ( indexTable[ idx ] === undefined ) {
-
-				var v = vertList[ idx ];
-				vertices[ 3 * numVerts ] = v.x;
-				vertices[ 3 * numVerts + 1 ] = v.y;
-				vertices[ 3 * numVerts + 2 ] = v.z;
-
-				indexTable[ idx ] = numVerts;
-
-				numVerts ++;
-
-			}
-
-			indices[ 3 * i + j ] = indexTable[ idx ] ;
-
-		}
-
-	}
-
-	vertices = vertices.subarray( 0, 3 * numVerts );
-
-	geom.setIndex( new THREE.BufferAttribute( indices, 1 ) );
-	geom.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
-
-	geom.computeFaceNormals();
-
-	return geom;
-
-}
-
-function addDrawCalls ( geometry ) {
-
-	var numTris = geometry.index.count / 3;
-
-	var offset = 0;
-	for ( var i = 0 ; i < numTris; i ++ ) {
-
-		var start = i * 3;
-		var count = 3;
-
-		geometry.addGroup( start, count );
-	}
-
-	return geometry;
-
-}
-
-function countEdges ( geom ) {
-
-	if ( geom instanceof THREE.EdgesGeometry ) {
-
-		return geom.getAttribute( 'position' ).count / 2;
-
-	}
-
-	if ( geom.faces !== undefined ) {
-
-		return geom.faces.length * 3;
-
-	}
-
-	var indices = geom.index;
-	if ( indices ) {
-
-		return indices.count;
-
-	}
-
-	return geom.getAttribute( 'position' ).count;
-
-}
-
-//
-// DEBUGGING
-//
-
-var renderer;
-var camera;
-var scene = new THREE.Scene();
-var xoffset = 0;
-
-function output ( geom, egeom ) {
-
-	if ( DEBUG !== true ) return;
-
-	if ( !renderer ) initDebug();
-
-	var mesh = new THREE.Mesh( geom, undefined );
-	var edges = new THREE.LineSegments( egeom, new THREE.LineBasicMaterial( { color: 'black' } ) );
-
-	mesh.position.setX( xoffset );
-	edges.position.setX( xoffset ++ );
-	scene.add(mesh);
-	scene.add(edges);
-
-	if (scene.children.length % 8 === 0) {
-
-		xoffset += 2;
-
-	}
-
-}
-
-function initDebug () {
-
-	renderer = new THREE.WebGLRenderer({
-
-		antialias: true
-
-	});
-
-	var width = 600;
-	var height = 480;
-
-	renderer.setSize(width, height);
-	renderer.setClearColor( 0xCCCCCC );
-
-	camera = new THREE.PerspectiveCamera(45, width / height, 1, 100);
-	camera.position.x = 30;
-	camera.position.z = 40;
-	camera.lookAt(new THREE.Vector3(30, 0, 0));
-
-	document.body.appendChild(renderer.domElement);
-
-	var controls = new THREE.OrbitControls( camera, renderer.domElement );
-	controls.target = new THREE.Vector3(30, 0, 0);
-
-	animate();
-
-	function animate() {
-
-		requestAnimationFrame( animate );
-
-		controls.update();
-
-		renderer.render( scene, camera );
-
-	}
-
-}

+ 0 - 1
test/unit/geometries/ExtrudeGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 34
test/unit/geometries/IcosahedronGeometry.tests.js

@@ -1,34 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		detail: undefined
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - IcosahedronGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.IcosahedronGeometry(),
-				new THREE.IcosahedronGeometry( parameters.radius ),
-				new THREE.IcosahedronGeometry( parameters.radius, parameters.detail ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 1
test/unit/geometries/LatheGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 34
test/unit/geometries/OctahedronGeometry.tests.js

@@ -1,34 +0,0 @@
-(function() {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		detail: undefined
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - OctahedronGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.OctahedronGeometry(),
-				new THREE.OctahedronGeometry( parameters.radius ),
-				new THREE.OctahedronGeometry( parameters.radius, parameters.detail ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 1
test/unit/geometries/ParametricGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 38
test/unit/geometries/PlaneBufferGeometry.tests.js

@@ -1,38 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		width: 10,
-		height: 30,
-		widthSegments: 3,
-		heightSegments: 5
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - PlaneBufferGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.PlaneBufferGeometry(),
-				new THREE.PlaneBufferGeometry( parameters.width ),
-				new THREE.PlaneBufferGeometry( parameters.width, parameters.height ),
-				new THREE.PlaneBufferGeometry( parameters.width, parameters.height, parameters.widthSegments ),
-				new THREE.PlaneBufferGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 38
test/unit/geometries/PlaneGeometry.tests.js

@@ -1,38 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		width: 10,
-		height: 30,
-		widthSegments: 3,
-		heightSegments: 5
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - PlaneGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.PlaneGeometry(),
-				new THREE.PlaneGeometry( parameters.width ),
-				new THREE.PlaneGeometry( parameters.width, parameters.height ),
-				new THREE.PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ),
-				new THREE.PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 1
test/unit/geometries/PolyhedronGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 42
test/unit/geometries/RingGeometry.tests.js

@@ -1,42 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		innerRadius: 10,
-		outerRadius: 60,
-		thetaSegments: 12,
-		phiSegments: 14,
-		thetaStart: 0.1,
-		thetaLength: 2.0
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - RingGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.RingGeometry(),
-				new THREE.RingGeometry( parameters.innerRadius ),
-				new THREE.RingGeometry( parameters.innerRadius, parameters.outerRadius ),
-				new THREE.RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments ),
-				new THREE.RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ),
-				new THREE.RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ),
-				new THREE.RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 1
test/unit/geometries/ShapeGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 44
test/unit/geometries/SphereBufferGeometry.tests.js

@@ -1,44 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		widthSegments: 20,
-		heightSegments: 30,
-		phiStart: 0.5,
-		phiLength: 1.0,
-		thetaStart: 0.4,
-		thetaLength: 2.0,
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - SphereBufferGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.SphereBufferGeometry(),
-				new THREE.SphereBufferGeometry( parameters.radius ),
-				new THREE.SphereBufferGeometry( parameters.radius, parameters.widthSegments ),
-				new THREE.SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ),
-				new THREE.SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ),
-				new THREE.SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ),
-				new THREE.SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ),
-				new THREE.SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 44
test/unit/geometries/SphereGeometry.tests.js

@@ -1,44 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		widthSegments: 20,
-		heightSegments: 30,
-		phiStart: 0.5,
-		phiLength: 1.0,
-		thetaStart: 0.4,
-		thetaLength: 2.0,
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - SphereGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.SphereGeometry(),
-				new THREE.SphereGeometry( parameters.radius ),
-				new THREE.SphereGeometry( parameters.radius, parameters.widthSegments ),
-				new THREE.SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ),
-				new THREE.SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ),
-				new THREE.SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ),
-				new THREE.SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ),
-				new THREE.SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 34
test/unit/geometries/TetrahedronGeometry.tests.js

@@ -1,34 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		detail: undefined
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - TetrahedronGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.TetrahedronGeometry(),
-				new THREE.TetrahedronGeometry( parameters.radius ),
-				new THREE.TetrahedronGeometry( parameters.radius, parameters.detail ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 1
test/unit/geometries/TextGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 40
test/unit/geometries/TorusGeometry.tests.js

@@ -1,40 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		tube: 20,
-		radialSegments: 30,
-		tubularSegments: 10,
-		arc: 2.0,
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - TorusGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.TorusGeometry(),
-				new THREE.TorusGeometry( parameters.radius ),
-				new THREE.TorusGeometry( parameters.radius, parameters.tube ),
-				new THREE.TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments ),
-				new THREE.TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ),
-				new THREE.TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 41
test/unit/geometries/TorusKnotGeometry.tests.js

@@ -1,41 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		radius: 10,
-		tube: 20,
-		tubularSegments: 30,
-		radialSegments: 10,
-		p: 3,
-		q: 2
-	};
-
-	var geometries;
-
-	QUnit.module( "Extras - Geometries - TorusKnotGeometry", {
-
-		beforeEach: function() {
-
-			geometries = [
-
-				new THREE.TorusKnotGeometry(),
-				new THREE.TorusKnotGeometry( parameters.radius ),
-				new THREE.TorusKnotGeometry( parameters.radius, parameters.tube ),
-				new THREE.TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ),
-				new THREE.TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ),
-				new THREE.TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard geometry tests", function( assert ) {
-
-		runStdGeometryTests( assert, geometries );
-
-	});
-
-})();

+ 0 - 1
test/unit/geometries/TubeGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 1
test/unit/geometries/WireframeGeometry.tests.js

@@ -1 +0,0 @@
-// TODO

+ 0 - 27
test/unit/lights/AmbientLight.tests.js

@@ -1,27 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var lights;
-
-	QUnit.module( "Lights - AmbientLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.AmbientLight( 0xaaaaaa ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 28
test/unit/lights/DirectionalLight.tests.js

@@ -1,28 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var lights;
-
-	QUnit.module( "Lights - DirectionalLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.DirectionalLight( 0xaaaaaa ),
-				new THREE.DirectionalLight( 0xaaaaaa, 0.8 ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 35
test/unit/lights/HemisphereLight.tests.js

@@ -1,35 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		skyColor: 0x123456,
-		groundColor: 0xabc012,
-		intensity: 0.6
-	};
-
-	var lights;
-
-	QUnit.module( "Lights - HemisphereLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.HemisphereLight( parameters.skyColor ),
-				new THREE.HemisphereLight( parameters.skyColor, parameters.groundColor ),
-				new THREE.HemisphereLight( parameters.skyColor, parameters.groundColor, parameters.intensity ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 27
test/unit/lights/PointLight.tests.js

@@ -1,27 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var lights;
-
-	QUnit.module( "Lights - PointLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.PointLight( 0xaaaaaa ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 38
test/unit/lights/RectAreaLight.tests.js

@@ -1,38 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		color: 0xaaaaaa,
-		intensity: 0.5,
-	};
-
-	var lights;
-
-	// TODO (abelnation): verify this works
-
-	QUnit.module( "Lights - RectAreaLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.RectAreaLight( parameters.color ),
-				new THREE.RectAreaLight( parameters.color, parameters.intensity ),
-				new THREE.RectAreaLight( parameters.color, parameters.intensity, 5.0 ),
-				new THREE.RectAreaLight( parameters.color, parameters.intensity, 5.0, 20.0 ),
-				new THREE.RectAreaLight( parameters.color, parameters.intensity, undefined, 20.0 ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 41
test/unit/lights/SpotLight.tests.js

@@ -1,41 +0,0 @@
-(function () {
-
-	'use strict';
-
-	var parameters = {
-		color: 0xaaaaaa,
-		intensity: 0.5,
-		distance: 100,
-		angle: 0.8,
-		exponent: 8,
-		decay: 2
-	};
-
-	var lights;
-
-	QUnit.module( "Lights - SpotLight", {
-
-		beforeEach: function() {
-
-			lights = [
-
-				new THREE.SpotLight( parameters.color ),
-				new THREE.SpotLight( parameters.color, parameters.intensity ),
-				new THREE.SpotLight( parameters.color, parameters.intensity, parameters.distance ),
-				new THREE.SpotLight( parameters.color, parameters.intensity, parameters.distance, parameters.angle ),
-				new THREE.SpotLight( parameters.color, parameters.intensity, parameters.distance, parameters.angle, parameters.exponent ),
-				new THREE.SpotLight( parameters.color, parameters.intensity, parameters.distance, parameters.angle, parameters.exponent, parameters.decay ),
-
-			];
-
-		}
-
-	});
-
-	QUnit.test( "standard light tests", function( assert ) {
-
-		runStdLightTests( assert, lights );
-
-	});
-
-})();

+ 0 - 246
test/unit/math/Box2.js

@@ -1,246 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Box2" );
-
-test( "constructor", function() {
-	var a = new THREE.Box2();
-	ok( a.min.equals( posInf2 ), "Passed!" );
-	ok( a.max.equals( negInf2 ), "Passed!" );
-
-	a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	ok( a.min.equals( zero2 ), "Passed!" );
-	ok( a.max.equals( zero2 ), "Passed!" );
-
-	a = new THREE.Box2( zero2.clone(), one2.clone() );
-	ok( a.min.equals( zero2 ), "Passed!" );
-	ok( a.max.equals( one2 ), "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Box2( zero2.clone(), one2.clone() );
-	var b = new THREE.Box2().copy( a );
-	ok( b.min.equals( zero2 ), "Passed!" );
-	ok( b.max.equals( one2 ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.min = zero2;
-	a.max = one2;
-	ok( b.min.equals( zero2 ), "Passed!" );
-	ok( b.max.equals( one2 ), "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Box2();
-
-	a.set( zero2, one2 );
-	ok( a.min.equals( zero2 ), "Passed!" );
-	ok( a.max.equals( one2 ), "Passed!" );
-});
-
-test( "setFromPoints", function() {
-	var a = new THREE.Box2();
-
-	a.setFromPoints( [ zero2, one2, two2 ] );
-	ok( a.min.equals( zero2 ), "Passed!" );
-	ok( a.max.equals( two2 ), "Passed!" );
-
-	a.setFromPoints( [ one2 ] );
-	ok( a.min.equals( one2 ), "Passed!" );
-	ok( a.max.equals( one2 ), "Passed!" );
-
-	a.setFromPoints( [] );
-	ok( a.isEmpty(), "Passed!" );
-});
-
-test( "empty/makeEmpty", function() {
-	var a = new THREE.Box2();
-
-	ok( a.isEmpty(), "Passed!" );
-
-	var a = new THREE.Box2( zero2.clone(), one2.clone() );
-	ok( ! a.isEmpty(), "Passed!" );
-
-	a.makeEmpty();
-	ok( a.isEmpty(), "Passed!" );
-});
-
-test( "getCenter", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-
-	ok( a.getCenter().equals( zero2 ), "Passed!" );
-
-	a = new THREE.Box2( zero2, one2 );
-	var midpoint = one2.clone().multiplyScalar( 0.5 );
-	ok( a.getCenter().equals( midpoint ), "Passed!" );
-});
-
-test( "getSize", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-
-	ok( a.getSize().equals( zero2 ), "Passed!" );
-
-	a = new THREE.Box2( zero2.clone(), one2.clone() );
-	ok( a.getSize().equals( one2 ), "Passed!" );
-});
-
-
-test( "expandByPoint", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-
-	a.expandByPoint( zero2 );
-	ok( a.getSize().equals( zero2 ), "Passed!" );
-
-	a.expandByPoint( one2 );
-	ok( a.getSize().equals( one2 ), "Passed!" );
-
-	a.expandByPoint( one2.clone().negate() );
-	ok( a.getSize().equals( one2.clone().multiplyScalar( 2 ) ), "Passed!" );
-	ok( a.getCenter().equals( zero2 ), "Passed!" );
-});
-
-test( "expandByVector", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-
-	a.expandByVector( zero2 );
-	ok( a.getSize().equals( zero2 ), "Passed!" );
-
-	a.expandByVector( one2 );
-	ok( a.getSize().equals( one2.clone().multiplyScalar( 2 ) ), "Passed!" );
-	ok( a.getCenter().equals( zero2 ), "Passed!" );
-});
-
-test( "expandByScalar", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-
-	a.expandByScalar( 0 );
-	ok( a.getSize().equals( zero2 ), "Passed!" );
-
-	a.expandByScalar( 1 );
-	ok( a.getSize().equals( one2.clone().multiplyScalar( 2 ) ), "Passed!" );
-	ok( a.getCenter().equals( zero2 ), "Passed!" );
-});
-
-test( "containsPoint", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-
-	ok( a.containsPoint( zero2 ), "Passed!" );
-	ok( ! a.containsPoint( one2 ), "Passed!" );
-
-	a.expandByScalar( 1 );
-	ok( a.containsPoint( zero2 ), "Passed!" );
-	ok( a.containsPoint( one2 ), "Passed!" );
-	ok( a.containsPoint( one2.clone().negate() ), "Passed!" );
-});
-
-test( "containsBox", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( zero2.clone(), one2.clone() );
-	var c = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.containsBox( a ), "Passed!" );
-	ok( ! a.containsBox( b ), "Passed!" );
-	ok( ! a.containsBox( c ), "Passed!" );
-
-	ok( b.containsBox( a ), "Passed!" );
-	ok( c.containsBox( a ), "Passed!" );
-	ok( ! b.containsBox( c ), "Passed!" );
-});
-
-test( "getParameter", function() {
-	var a = new THREE.Box2( zero2.clone(), one2.clone() );
-	var b = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.getParameter( new THREE.Vector2( 0, 0 ) ).equals( new THREE.Vector2( 0, 0 ) ), "Passed!" );
-	ok( a.getParameter( new THREE.Vector2( 1, 1 ) ).equals( new THREE.Vector2( 1, 1 ) ), "Passed!" );
-
-	ok( b.getParameter( new THREE.Vector2( -1, -1 ) ).equals( new THREE.Vector2( 0, 0 ) ), "Passed!" );
-	ok( b.getParameter( new THREE.Vector2( 0, 0 ) ).equals( new THREE.Vector2( 0.5, 0.5 ) ), "Passed!" );
-	ok( b.getParameter( new THREE.Vector2( 1, 1 ) ).equals( new THREE.Vector2( 1, 1 ) ), "Passed!" );
-});
-
-test( "clampPoint", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.clampPoint( new THREE.Vector2( 0, 0 ) ).equals( new THREE.Vector2( 0, 0 ) ), "Passed!" );
-	ok( a.clampPoint( new THREE.Vector2( 1, 1 ) ).equals( new THREE.Vector2( 0, 0 ) ), "Passed!" );
-	ok( a.clampPoint( new THREE.Vector2( -1, -1 ) ).equals( new THREE.Vector2( 0, 0 ) ), "Passed!" );
-
-	ok( b.clampPoint( new THREE.Vector2( 2, 2 ) ).equals( new THREE.Vector2( 1, 1 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector2( 1, 1 ) ).equals( new THREE.Vector2( 1, 1 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector2( 0, 0 ) ).equals( new THREE.Vector2( 0, 0 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector2( -1, -1 ) ).equals( new THREE.Vector2( -1, -1 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector2( -2, -2 ) ).equals( new THREE.Vector2( -1, -1 ) ), "Passed!" );
-});
-
-test( "distanceToPoint", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.distanceToPoint( new THREE.Vector2( 0, 0 ) ) == 0, "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector2( 1, 1 ) ) == Math.sqrt( 2 ), "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector2( -1, -1 ) ) == Math.sqrt( 2 ), "Passed!" );
-
-	ok( b.distanceToPoint( new THREE.Vector2( 2, 2 ) ) == Math.sqrt( 2 ), "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector2( 1, 1 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector2( 0, 0 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector2( -1, -1 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector2( -2, -2 ) ) == Math.sqrt( 2 ), "Passed!" );
-});
-
-test( "intersectsBox", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( zero2.clone(), one2.clone() );
-	var c = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.intersectsBox( a ), "Passed!" );
-	ok( a.intersectsBox( b ), "Passed!" );
-	ok( a.intersectsBox( c ), "Passed!" );
-
-	ok( b.intersectsBox( a ), "Passed!" );
-	ok( c.intersectsBox( a ), "Passed!" );
-	ok( b.intersectsBox( c ), "Passed!" );
-
-	b.translate( new THREE.Vector2( 2, 2 ) );
-	ok( ! a.intersectsBox( b ), "Passed!" );
-	ok( ! b.intersectsBox( a ), "Passed!" );
-	ok( ! b.intersectsBox( c ), "Passed!" );
-});
-
-test( "intersect", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( zero2.clone(), one2.clone() );
-	var c = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.clone().intersect( a ).equals( a ), "Passed!" );
-	ok( a.clone().intersect( b ).equals( a ), "Passed!" );
-	ok( b.clone().intersect( b ).equals( b ), "Passed!" );
-	ok( a.clone().intersect( c ).equals( a ), "Passed!" );
-	ok( b.clone().intersect( c ).equals( b ), "Passed!" );
-	ok( c.clone().intersect( c ).equals( c ), "Passed!" );
-});
-
-test( "union", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( zero2.clone(), one2.clone() );
-	var c = new THREE.Box2( one2.clone().negate(), one2.clone() );
-
-	ok( a.clone().union( a ).equals( a ), "Passed!" );
-	ok( a.clone().union( b ).equals( b ), "Passed!" );
-	ok( a.clone().union( c ).equals( c ), "Passed!" );
-	ok( b.clone().union( c ).equals( c ), "Passed!" );
-});
-
-test( "translate", function() {
-	var a = new THREE.Box2( zero2.clone(), zero2.clone() );
-	var b = new THREE.Box2( zero2.clone(), one2.clone() );
-	var c = new THREE.Box2( one2.clone().negate(), one2.clone() );
-	var d = new THREE.Box2( one2.clone().negate(), zero2.clone() );
-
-	ok( a.clone().translate( one2 ).equals( new THREE.Box2( one2, one2 ) ), "Passed!" );
-	ok( a.clone().translate( one2 ).translate( one2.clone().negate() ).equals( a ), "Passed!" );
-	ok( d.clone().translate( one2 ).equals( b ), "Passed!" );
-	ok( b.clone().translate( one2.clone().negate() ).equals( d ), "Passed!" );
-});

+ 0 - 313
test/unit/math/Box3.js

@@ -1,313 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Box3" );
-
-test( "constructor", function() {
-	var a = new THREE.Box3();
-	ok( a.min.equals( posInf3 ), "Passed!" );
-	ok( a.max.equals( negInf3 ), "Passed!" );
-
-	a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	ok( a.min.equals( zero3 ), "Passed!" );
-	ok( a.max.equals( zero3 ), "Passed!" );
-
-	a = new THREE.Box3( zero3.clone(), one3.clone() );
-	ok( a.min.equals( zero3 ), "Passed!" );
-	ok( a.max.equals( one3 ), "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Box3( zero3.clone(), one3.clone() );
-	var b = new THREE.Box3().copy( a );
-	ok( b.min.equals( zero3 ), "Passed!" );
-	ok( b.max.equals( one3 ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.min = zero3;
-	a.max = one3;
-	ok( b.min.equals( zero3 ), "Passed!" );
-	ok( b.max.equals( one3 ), "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Box3();
-
-	a.set( zero3, one3 );
-	ok( a.min.equals( zero3 ), "Passed!" );
-	ok( a.max.equals( one3 ), "Passed!" );
-});
-
-test( "setFromPoints", function() {
-	var a = new THREE.Box3();
-
-	a.setFromPoints( [ zero3, one3, two3 ] );
-	ok( a.min.equals( zero3 ), "Passed!" );
-	ok( a.max.equals( two3 ), "Passed!" );
-
-	a.setFromPoints( [ one3 ] );
-	ok( a.min.equals( one3 ), "Passed!" );
-	ok( a.max.equals( one3 ), "Passed!" );
-
-	a.setFromPoints( [] );
-	ok( a.isEmpty(), "Passed!" );
-});
-
-test( "empty/makeEmpty", function() {
-	var a = new THREE.Box3();
-
-	ok( a.isEmpty(), "Passed!" );
-
-	var a = new THREE.Box3( zero3.clone(), one3.clone() );
-	ok( ! a.isEmpty(), "Passed!" );
-
-	a.makeEmpty();
-	ok( a.isEmpty(), "Passed!" );
-});
-
-test( "getCenter", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-
-	ok( a.getCenter().equals( zero3 ), "Passed!" );
-
-	a = new THREE.Box3( zero3.clone(), one3.clone() );
-	var midpoint = one3.clone().multiplyScalar( 0.5 );
-	ok( a.getCenter().equals( midpoint ), "Passed!" );
-});
-
-test( "getSize", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-
-	ok( a.getSize().equals( zero3 ), "Passed!" );
-
-	a = new THREE.Box3( zero3.clone(), one3.clone() );
-	ok( a.getSize().equals( one3 ), "Passed!" );
-});
-
-
-test( "expandByPoint", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-
-	a.expandByPoint( zero3 );
-	ok( a.getSize().equals( zero3 ), "Passed!" );
-
-	a.expandByPoint( one3 );
-	ok( a.getSize().equals( one3 ), "Passed!" );
-
-	a.expandByPoint( one3.clone().negate() );
-	ok( a.getSize().equals( one3.clone().multiplyScalar( 2 ) ), "Passed!" );
-	ok( a.getCenter().equals( zero3 ), "Passed!" );
-});
-
-test( "expandByVector", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-
-	a.expandByVector( zero3 );
-	ok( a.getSize().equals( zero3 ), "Passed!" );
-
-	a.expandByVector( one3 );
-	ok( a.getSize().equals( one3.clone().multiplyScalar( 2 ) ), "Passed!" );
-	ok( a.getCenter().equals( zero3 ), "Passed!" );
-});
-
-test( "expandByScalar", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-
-	a.expandByScalar( 0 );
-	ok( a.getSize().equals( zero3 ), "Passed!" );
-
-	a.expandByScalar( 1 );
-	ok( a.getSize().equals( one3.clone().multiplyScalar( 2 ) ), "Passed!" );
-	ok( a.getCenter().equals( zero3 ), "Passed!" );
-});
-
-test( "containsPoint", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-
-	ok( a.containsPoint( zero3 ), "Passed!" );
-	ok( ! a.containsPoint( one3 ), "Passed!" );
-
-	a.expandByScalar( 1 );
-	ok( a.containsPoint( zero3 ), "Passed!" );
-	ok( a.containsPoint( one3 ), "Passed!" );
-	ok( a.containsPoint( one3.clone().negate() ), "Passed!" );
-});
-
-test( "containsBox", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.containsBox( a ), "Passed!" );
-	ok( ! a.containsBox( b ), "Passed!" );
-	ok( ! a.containsBox( c ), "Passed!" );
-
-	ok( b.containsBox( a ), "Passed!" );
-	ok( c.containsBox( a ), "Passed!" );
-	ok( ! b.containsBox( c ), "Passed!" );
-});
-
-test( "getParameter", function() {
-	var a = new THREE.Box3( zero3.clone(), one3.clone() );
-	var b = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.getParameter( new THREE.Vector3( 0, 0, 0 ) ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( a.getParameter( new THREE.Vector3( 1, 1, 1 ) ).equals( new THREE.Vector3( 1, 1, 1 ) ), "Passed!" );
-
-	ok( b.getParameter( new THREE.Vector3( -1, -1, -1 ) ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( b.getParameter( new THREE.Vector3( 0, 0, 0 ) ).equals( new THREE.Vector3( 0.5, 0.5, 0.5 ) ), "Passed!" );
-	ok( b.getParameter( new THREE.Vector3( 1, 1, 1 ) ).equals( new THREE.Vector3( 1, 1, 1 ) ), "Passed!" );
-});
-
-test( "clampPoint", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.clampPoint( new THREE.Vector3( 0, 0, 0 ) ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( a.clampPoint( new THREE.Vector3( 1, 1, 1 ) ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( a.clampPoint( new THREE.Vector3( -1, -1, -1 ) ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	ok( b.clampPoint( new THREE.Vector3( 2, 2, 2 ) ).equals( new THREE.Vector3( 1, 1, 1 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector3( 1, 1, 1 ) ).equals( new THREE.Vector3( 1, 1, 1 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector3( 0, 0, 0 ) ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector3( -1, -1, -1 ) ).equals( new THREE.Vector3( -1, -1, -1 ) ), "Passed!" );
-	ok( b.clampPoint( new THREE.Vector3( -2, -2, -2 ) ).equals( new THREE.Vector3( -1, -1, -1 ) ), "Passed!" );
-});
-
-test( "distanceToPoint", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.distanceToPoint( new THREE.Vector3( 0, 0, 0 ) ) == 0, "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( 1, 1, 1 ) ) == Math.sqrt( 3 ), "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( -1, -1, -1 ) ) == Math.sqrt( 3 ), "Passed!" );
-
-	ok( b.distanceToPoint( new THREE.Vector3( 2, 2, 2 ) ) == Math.sqrt( 3 ), "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( 1, 1, 1 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( 0, 0, 0 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( -1, -1, -1 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( -2, -2, -2 ) ) == Math.sqrt( 3 ), "Passed!" );
-});
-
-test( "distanceToPoint", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.distanceToPoint( new THREE.Vector3( 0, 0, 0 ) ) == 0, "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( 1, 1, 1 ) ) == Math.sqrt( 3 ), "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( -1, -1, -1 ) ) == Math.sqrt( 3 ), "Passed!" );
-
-	ok( b.distanceToPoint( new THREE.Vector3( 2, 2, 2 ) ) == Math.sqrt( 3 ), "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( 1, 1, 1 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( 0, 0, 0 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( -1, -1, -1 ) ) == 0, "Passed!" );
-	ok( b.distanceToPoint( new THREE.Vector3( -2, -2, -2 ) ) == Math.sqrt( 3 ), "Passed!" );
-});
-
-test( "intersectsBox", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.intersectsBox( a ), "Passed!" );
-	ok( a.intersectsBox( b ), "Passed!" );
-	ok( a.intersectsBox( c ), "Passed!" );
-
-	ok( b.intersectsBox( a ), "Passed!" );
-	ok( c.intersectsBox( a ), "Passed!" );
-	ok( b.intersectsBox( c ), "Passed!" );
-
-	b.translate( new THREE.Vector3( 2, 2, 2 ) );
-	ok( ! a.intersectsBox( b ), "Passed!" );
-	ok( ! b.intersectsBox( a ), "Passed!" );
-	ok( ! b.intersectsBox( c ), "Passed!" );
-});
-
-test( "intersectsSphere", function() {
-	var a = new THREE.Box3( zero3.clone(), one3.clone() );
-	var b = new THREE.Sphere( zero3.clone(), 1 );
-
-	ok( a.intersectsSphere( b ) , "Passed!" );
-
-	b.translate( new THREE.Vector3( 2, 2, 2 ) );
-	ok( ! a.intersectsSphere( b ) , "Passed!" );
-});
-
-test( "intersectsPlane", function() {
-	var a = new THREE.Box3( zero3.clone(), one3.clone() );
-	var b = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), 1 );
-	var c = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), 1.25 );
-	var d = new THREE.Plane( new THREE.Vector3( 0, -1, 0 ), 1.25 );
-
-	ok( a.intersectsPlane( b ) , "Passed!" );
-	ok( ! a.intersectsPlane( c ) , "Passed!" );
-	ok( ! a.intersectsPlane( d ) , "Passed!" );
-});
-
-test( "getBoundingSphere", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.getBoundingSphere().equals( new THREE.Sphere( zero3, 0 ) ), "Passed!" );
-	ok( b.getBoundingSphere().equals( new THREE.Sphere( one3.clone().multiplyScalar( 0.5 ), Math.sqrt( 3 ) * 0.5 ) ), "Passed!" );
-	ok( c.getBoundingSphere().equals( new THREE.Sphere( zero3, Math.sqrt( 12 ) * 0.5 ) ), "Passed!" );
-});
-
-test( "intersect", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.clone().intersect( a ).equals( a ), "Passed!" );
-	ok( a.clone().intersect( b ).equals( a ), "Passed!" );
-	ok( b.clone().intersect( b ).equals( b ), "Passed!" );
-	ok( a.clone().intersect( c ).equals( a ), "Passed!" );
-	ok( b.clone().intersect( c ).equals( b ), "Passed!" );
-	ok( c.clone().intersect( c ).equals( c ), "Passed!" );
-});
-
-test( "union", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-
-	ok( a.clone().union( a ).equals( a ), "Passed!" );
-	ok( a.clone().union( b ).equals( b ), "Passed!" );
-	ok( a.clone().union( c ).equals( c ), "Passed!" );
-	ok( b.clone().union( c ).equals( c ), "Passed!" );
-});
-
-var compareBox = function ( a, b, threshold ) {
-	threshold = threshold || 0.0001;
-	return ( a.min.distanceTo( b.min ) < threshold &&
-	a.max.distanceTo( b.max ) < threshold );
-};
-
-test( "applyMatrix4", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-	var d = new THREE.Box3( one3.clone().negate(), zero3.clone() );
-
-	var m = new THREE.Matrix4().makeTranslation( 1, -2, 1 );
-	var t1 = new THREE.Vector3( 1, -2, 1 );
-
-	ok( compareBox( a.clone().applyMatrix4( m ), a.clone().translate( t1 ) ), "Passed!" );
-	ok( compareBox( b.clone().applyMatrix4( m ), b.clone().translate( t1 ) ), "Passed!" );
-	ok( compareBox( c.clone().applyMatrix4( m ), c.clone().translate( t1 ) ), "Passed!" );
-	ok( compareBox( d.clone().applyMatrix4( m ), d.clone().translate( t1 ) ), "Passed!" );
-});
-
-test( "translate", function() {
-	var a = new THREE.Box3( zero3.clone(), zero3.clone() );
-	var b = new THREE.Box3( zero3.clone(), one3.clone() );
-	var c = new THREE.Box3( one3.clone().negate(), one3.clone() );
-	var d = new THREE.Box3( one3.clone().negate(), zero3.clone() );
-
-	ok( a.clone().translate( one3 ).equals( new THREE.Box3( one3, one3 ) ), "Passed!" );
-	ok( a.clone().translate( one3 ).translate( one3.clone().negate() ).equals( a ), "Passed!" );
-	ok( d.clone().translate( one3 ).equals( b ), "Passed!" );
-	ok( b.clone().translate( one3.clone().negate() ).equals( d ), "Passed!" );
-});

+ 0 - 280
test/unit/math/Color.js

@@ -1,280 +0,0 @@
-module( "Color" );
-
-test( "constructor", function(){
-    var c = new THREE.Color();
-    ok( c.r, "Red: " + c.r );
-    ok( c.g, "Green: " + c.g );
-    ok( c.b, "Blue: " + c.b );
-});
-
-test( "rgb constructor", function(){
-    var c = new THREE.Color( 1, 1, 1 );
-    ok( c.r == 1, "Passed" );
-    ok( c.g == 1, "Passed" );
-    ok( c.b == 1, "Passed" );
-});
-
-test( "copyHex", function(){
-    var c = new THREE.Color();
-    var c2 = new THREE.Color(0xF5FFFA);
-    c.copy(c2);
-    ok(c.getHex() == c2.getHex(), "Hex c: " + c.getHex() + " Hex c2: " + c2.getHex());
-});
-
-test( "copyColorString", function(){
-    var c = new THREE.Color();
-    var c2 = new THREE.Color('ivory');
-    c.copy(c2);
-    ok(c.getHex() == c2.getHex(), "Hex c: " + c.getHex() + " Hex c2: " + c2.getHex());
-});
-
-test( "setRGB", function(){
-    var c = new THREE.Color();
-    c.setRGB(1, 0.2, 0.1);
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g == 0.2, "Green: " + c.g );
-    ok( c.b == 0.1, "Blue: " + c.b );
-});
-
-test( "copyGammaToLinear", function(){
-    var c = new THREE.Color();
-    var c2 = new THREE.Color();
-    c2.setRGB(0.3, 0.5, 0.9);
-    c.copyGammaToLinear(c2);
-    ok( c.r == 0.09, "Red c: " + c.r + " Red c2: " + c2.r);
-    ok( c.g == 0.25, "Green c: " + c.g + " Green c2: " + c2.g);
-    ok( c.b == 0.81, "Blue c: " + c.b + " Blue c2: " + c2.b);
-});
-
-test( "copyLinearToGamma", function(){
-    var c = new THREE.Color();
-    var c2 = new THREE.Color();
-    c2.setRGB(0.09, 0.25, 0.81);
-    c.copyLinearToGamma(c2);
-    ok( c.r == 0.3, "Red c: " + c.r + " Red c2: " + c2.r);
-    ok( c.g == 0.5, "Green c: " + c.g + " Green c2: " + c2.g);
-    ok( c.b == 0.9, "Blue c: " + c.b + " Blue c2: " + c2.b);
-});
-
-
-test( "convertGammaToLinear", function(){
-    var c = new THREE.Color();
-    c.setRGB(0.3, 0.5, 0.9);
-    c.convertGammaToLinear();
-    ok( c.r == 0.09, "Red: " + c.r );
-    ok( c.g == 0.25, "Green: " + c.g );
-    ok( c.b == 0.81, "Blue: " + c.b );
-});
-
-
-test( "convertLinearToGamma", function(){
-    var c = new THREE.Color();
-    c.setRGB(4, 9, 16);
-    c.convertLinearToGamma();
-    ok( c.r == 2, "Red: " + c.r );
-    ok( c.g == 3, "Green: " + c.g );
-    ok( c.b == 4, "Blue: " + c.b );
-});
-
-test("setWithNum", function(){
-    var c = new THREE.Color();
-    c.set(0xFF0000);
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-
-test( "setWithString", function(){
-    var c = new THREE.Color();
-    c.set('silver');
-    ok(c.getHex() == 0xC0C0C0, "Hex c: " + c.getHex());
-});
-
-
-test( "clone", function(){
-    var c = new THREE.Color('teal');
-    var c2 = c.clone();
-    ok(c2.getHex() == 0x008080, "Hex c2: " + c2.getHex());
-});
-
-test( "lerp", function(){
-    var c = new THREE.Color();
-    var c2 = new THREE.Color();
-    c.setRGB(0, 0, 0);
-    c.lerp(c2, 0.2);
-    ok( c.r == 0.2, "Red: " + c.r );
-    ok( c.g == 0.2, "Green: " + c.g );
-    ok( c.b == 0.2, "Blue: " + c.b );
-    
-});
-
-
-test( "setStyleRGBRed", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgb(255,0,0)');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleRGBARed", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgba(255,0,0,0.5)');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleRGBRedWithSpaces", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgb( 255 , 0,   0 )');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleRGBARedWithSpaces", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgba( 255,  0,  0  , 1 )');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleRGBPercent", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgb(100%,50%,10%)');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g == 0.5, "Green: " + c.g );
-    ok( c.b == 0.1, "Blue: " + c.b );
-});
-
-test( "setStyleRGBAPercent", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgba(100%,50%,10%, 0.5)');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g == 0.5, "Green: " + c.g );
-    ok( c.b == 0.1, "Blue: " + c.b );
-});
-
-test( "setStyleRGBPercentWithSpaces", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgb( 100% ,50%  , 10% )');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g == 0.5, "Green: " + c.g );
-    ok( c.b == 0.1, "Blue: " + c.b );
-});
-
-test( "setStyleRGBAPercentWithSpaces", function(){
-    var c = new THREE.Color();
-    c.setStyle('rgba( 100% ,50%  ,  10%, 0.5 )');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g == 0.5, "Green: " + c.g );
-    ok( c.b == 0.1, "Blue: " + c.b );
-});
-
-test( "setStyleHSLRed", function(){
-    var c = new THREE.Color();
-    c.setStyle('hsl(360,100%,50%)');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleHSLARed", function(){
-    var c = new THREE.Color();
-    c.setStyle('hsla(360,100%,50%,0.5)');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleHSLRedWithSpaces", function(){
-    var c = new THREE.Color();
-    c.setStyle('hsl(360,  100% , 50% )');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleHSLARedWithSpaces", function(){
-    var c = new THREE.Color();
-    c.setStyle('hsla( 360,  100% , 50%,  0.5 )');
-    ok( c.r == 1, "Red: " + c.r );
-    ok( c.g === 0, "Green: " + c.g );
-    ok( c.b === 0, "Blue: " + c.b );
-});
-
-test( "setStyleHexSkyBlue", function(){
-    var c = new THREE.Color();
-    c.setStyle('#87CEEB');
-    ok(c.getHex() == 0x87CEEB, "Hex c: " + c.getHex());
-});
-
-test( "setStyleHexSkyBlueMixed", function(){
-    var c = new THREE.Color();
-    c.setStyle('#87cEeB');
-    ok(c.getHex() == 0x87CEEB, "Hex c: " + c.getHex());
-});
-
-test( "setStyleHex2Olive", function(){
-    var c = new THREE.Color();
-    c.setStyle('#F00');
-    ok(c.getHex() == 0xFF0000, "Hex c: " + c.getHex());
-});
-
-test( "setStyleHex2OliveMixed", function(){
-    var c = new THREE.Color();
-    c.setStyle('#f00');
-    ok(c.getHex() == 0xFF0000, "Hex c: " + c.getHex());
-});
-
-test( "setStyleColorName", function(){
-    var c = new THREE.Color();
-    c.setStyle('powderblue');
-    ok(c.getHex() == 0xB0E0E6, "Hex c: " + c.getHex());
-});
-
-test( "getHex", function(){
-    var c = new THREE.Color('red');
-    var res = c.getHex();
-    ok( res == 0xFF0000, "Hex: " + res );
-});
-
-test( "setHex", function(){
-    var c = new THREE.Color();
-    c.setHex(0xFA8072);
-    ok( c.getHex() == 0xFA8072, "Hex: " + c.getHex());
-});
-
-test( "getHexString", function(){
-    var c = new THREE.Color('tomato');
-    var res = c.getHexString();
-    ok( res == 'ff6347', "Hex: " + res );
-});
-
-test( "getStyle", function(){
-    var c = new THREE.Color('plum');
-    var res = c.getStyle();
-    ok( res == 'rgb(221,160,221)', "style: " + res );
-});
-
-test( "getHSL", function () {
-    var c = new THREE.Color( 0x80ffff );
-    var hsl = c.getHSL();
-
-    ok( hsl.h == 0.5, "hue: " + hsl.h );
-    ok( hsl.s == 1.0, "saturation: " + hsl.s );
-    ok( (Math.round(parseFloat(hsl.l)*100)/100) == 0.75, "lightness: " + hsl.l );
-});
-
-test( "setHSL", function () {
-    var c = new THREE.Color();
-    c.setHSL(0.75, 1.0, 0.25);
-    var hsl = c.getHSL();
-
-    ok( hsl.h == 0.75, "hue: " + hsl.h );
-    ok( hsl.s == 1.00, "saturation: " + hsl.s );
-    ok( hsl.l == 0.25, "lightness: " + hsl.l );
-});

+ 0 - 22
test/unit/math/Constants.js

@@ -1,22 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-var x = 2;
-var y = 3;
-var z = 4;
-var w = 5;
-
-var negInf2 = new THREE.Vector2( -Infinity, -Infinity );
-var posInf2 = new THREE.Vector2( Infinity, Infinity );
-
-var zero2 = new THREE.Vector2();
-var one2 = new THREE.Vector2( 1, 1 );
-var two2 = new THREE.Vector2( 2, 2 );
-
-var negInf3 = new THREE.Vector3( -Infinity, -Infinity, -Infinity );
-var posInf3 = new THREE.Vector3( Infinity, Infinity, Infinity );
-
-var zero3 = new THREE.Vector3();
-var one3 = new THREE.Vector3( 1, 1, 1 );
-var two3 = new THREE.Vector3( 2, 2, 2 );

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

@@ -1,134 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Euler" );
-
-var eulerZero = new THREE.Euler( 0, 0, 0, "XYZ" );
-var eulerAxyz = new THREE.Euler( 1, 0, 0, "XYZ" );
-var eulerAzyx = new THREE.Euler( 0, 1, 0, "ZYX" );
-
-var matrixEquals4 = function( a, b, tolerance ) {
-	tolerance = tolerance || 0.0001;
-	if( a.elements.length != b.elements.length ) {
-		return false;
-	}
-	for( var i = 0, il = a.elements.length; i < il; i ++ ) {
-		var delta = a.elements[i] - b.elements[i];
-		if( delta > tolerance ) {
-			return false;
-		}
-	}
-	return true;
-};
-
-var eulerEquals = function( a, b, tolerance ) {
-	tolerance = tolerance || 0.0001;
-	var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z );
-	return ( diff < tolerance );
-};
-
-
-var quatEquals = function( a, b, tolerance ) {
-	tolerance = tolerance || 0.0001;
-	var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z ) + Math.abs( a.w - b.w );
-	return ( diff < tolerance );
-};
-
-test( "constructor/equals", function() {
-	var a = new THREE.Euler();
-	ok( a.equals( eulerZero ), "Passed!" );
-	ok( ! a.equals( eulerAxyz ), "Passed!" );
-	ok( ! a.equals( eulerAzyx ), "Passed!" );
-});
-
-test( "clone/copy/equals", function() {
-	var a = eulerAxyz.clone();
-	ok( a.equals( eulerAxyz ), "Passed!" );
-	ok( ! a.equals( eulerZero ), "Passed!" );
-	ok( ! a.equals( eulerAzyx ), "Passed!" );
-
-	a.copy( eulerAzyx );
-	ok( a.equals( eulerAzyx ), "Passed!" );
-	ok( ! a.equals( eulerAxyz ), "Passed!" );
-	ok( ! a.equals( eulerZero ), "Passed!" );
-
-});
-
-test( "set/setFromVector3/toVector3", function() {
-	var a = new THREE.Euler();
-
-	a.set( 0, 1, 0, "ZYX" );
-	ok( a.equals( eulerAzyx ), "Passed!" );
-	ok( ! a.equals( eulerAxyz ), "Passed!" );
-	ok( ! a.equals( eulerZero ), "Passed!" );
-
-	var vec = new THREE.Vector3( 0, 1, 0 );
-
-	var b = new THREE.Euler().setFromVector3( vec, "ZYX" );
-	ok( a.equals( b ), "Passed!" );
-
-	var c = b.toVector3();
-	ok( c.equals( vec ), "Passed!" );	
-});
-
-test( "Quaternion.setFromEuler/Euler.fromQuaternion", function() {
-	var testValues = [ eulerZero, eulerAxyz, eulerAzyx ];
-	for( var i = 0; i < testValues.length; i ++ ) {
-		var v = testValues[i];
-		var q = new THREE.Quaternion().setFromEuler( v );
-
-		var v2 = new THREE.Euler().setFromQuaternion( q, v.order );
-		var q2 = new THREE.Quaternion().setFromEuler( v2 );
-		ok( eulerEquals( q, q2 ), "Passed!" );
-	}
-});
-
-
-test( "Matrix4.setFromEuler/Euler.fromRotationMatrix", function() {
-	var testValues = [ eulerZero, eulerAxyz, eulerAzyx ];
-	for( var i = 0; i < testValues.length; i ++ ) {
-		var v = testValues[i];
-		var m = new THREE.Matrix4().makeRotationFromEuler( v );
-
-		var v2 = new THREE.Euler().setFromRotationMatrix( m, v.order );
-		var m2 = new THREE.Matrix4().makeRotationFromEuler( v2 );
-		ok( matrixEquals4( m, m2, 0.0001 ), "Passed!" );
-	}
-});
-
-test( "reorder", function() {
-	var testValues = [ eulerZero, eulerAxyz, eulerAzyx ];
-	for( var i = 0; i < testValues.length; i ++ ) {
-		var v = testValues[i];
-		var q = new THREE.Quaternion().setFromEuler( v );
-
-		v.reorder( 'YZX' );
-		var q2 = new THREE.Quaternion().setFromEuler( v );
-		ok( quatEquals( q, q2 ), "Passed!" );
-
-		v.reorder( 'ZXY' );
-		var q3 = new THREE.Quaternion().setFromEuler( v );
-		ok( quatEquals( q, q3 ), "Passed!" );
-	}
-});
-
-
-test( "gimbalLocalQuat", function() {
-	// known problematic quaternions
-	var q1 = new THREE.Quaternion( 0.5207769385244341, -0.4783214164122354, 0.520776938524434, 0.47832141641223547 );
-	var q2 = new THREE.Quaternion( 0.11284905712620674, 0.6980437630368944, -0.11284905712620674, 0.6980437630368944 );
-
-	var eulerOrder = "ZYX";
-
-	// create Euler directly from a Quaternion
-	var eViaQ1 = new THREE.Euler().setFromQuaternion( q1, eulerOrder ); // there is likely a bug here
-
-	// create Euler from Quaternion via an intermediate Matrix4
-	var mViaQ1 = new THREE.Matrix4().makeRotationFromQuaternion( q1 );
-	var eViaMViaQ1 = new THREE.Euler().setFromRotationMatrix( mViaQ1, eulerOrder );
-
-	// the results here are different
-	ok( eulerEquals( eViaQ1, eViaMViaQ1 ), "Passed!" );  // this result is correct
-
-});

+ 0 - 156
test/unit/math/Frustum.js

@@ -1,156 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Frustum" );
-
-var unit3 = new THREE.Vector3( 1, 0, 0 );
-
-var planeEquals = function ( a, b, tolerance ) {
-
-	tolerance = tolerance || 0.0001;
-
-	if ( a.normal.distanceTo( b.normal ) > tolerance ) return false;
-	if ( Math.abs( a.constant - b.constant ) > tolerance ) return false;
-
-	return true;
-
-};
-
-test( "constructor", function() {
-	var a = new THREE.Frustum();
-
-	ok( a.planes !== undefined, "Passed!" );
-	ok( a.planes.length === 6, "Passed!" );
-
-	var pDefault = new THREE.Plane();
-	for( var i = 0; i < 6; i ++ ) {
-		ok( a.planes[i].equals( pDefault ), "Passed!" );
-	}
-
-	var p0 = new THREE.Plane( unit3, -1 );
-	var p1 = new THREE.Plane( unit3, 1 );
-	var p2 = new THREE.Plane( unit3, 2 );
-	var p3 = new THREE.Plane( unit3, 3 );
-	var p4 = new THREE.Plane( unit3, 4 );
-	var p5 = new THREE.Plane( unit3, 5 );
-
-	a = new THREE.Frustum( p0, p1, p2, p3, p4, p5 );
-	ok( a.planes[0].equals( p0 ), "Passed!" );
-	ok( a.planes[1].equals( p1 ), "Passed!" );
-	ok( a.planes[2].equals( p2 ), "Passed!" );
-	ok( a.planes[3].equals( p3 ), "Passed!" );
-	ok( a.planes[4].equals( p4 ), "Passed!" );
-	ok( a.planes[5].equals( p5 ), "Passed!" );
-});
-
-test( "copy", function() {
-
-	var p0 = new THREE.Plane( unit3, -1 );
-	var p1 = new THREE.Plane( unit3, 1 );
-	var p2 = new THREE.Plane( unit3, 2 );
-	var p3 = new THREE.Plane( unit3, 3 );
-	var p4 = new THREE.Plane( unit3, 4 );
-	var p5 = new THREE.Plane( unit3, 5 );
-
-	var b = new THREE.Frustum( p0, p1, p2, p3, p4, p5 );
-	var a = new THREE.Frustum().copy( b );
-	ok( a.planes[0].equals( p0 ), "Passed!" );
-	ok( a.planes[1].equals( p1 ), "Passed!" );
-	ok( a.planes[2].equals( p2 ), "Passed!" );
-	ok( a.planes[3].equals( p3 ), "Passed!" );
-	ok( a.planes[4].equals( p4 ), "Passed!" );
-	ok( a.planes[5].equals( p5 ), "Passed!" );
-
-	// ensure it is a true copy by modifying source
-	b.planes[0] = p1;
-	ok( a.planes[0].equals( p0 ), "Passed!" );
-});
-
-test( "setFromMatrix/makeOrthographic/containsPoint", function() {
-	var m = new THREE.Matrix4().makeOrthographic( -1, 1, -1, 1, 1, 100 );
-	var a = new THREE.Frustum().setFromMatrix( m );
-
-	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 0, 0, -50 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 0, 0, -1.001 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( -1, -1, -1.001 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( -1.1, -1.1, -1.001 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 1, 1, -1.001 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( 1.1, 1.1, -1.001 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 0, 0, -100 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( -1, -1, -100 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( -1.1, -1.1, -100.1 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 1, 1, -100 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( 1.1, 1.1, -100.1 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, -101 ) ), "Passed!" );
-
-});
-
-test( "setFromMatrix/makePerspective/containsPoint", function() {
-	var m = new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 100 );
-	var a = new THREE.Frustum().setFromMatrix( m );
-
-	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 0, 0, -50 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 0, 0, -1.001 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( -1, -1, -1.001 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( -1.1, -1.1, -1.001 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 1, 1, -1.001 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( 1.1, 1.1, -1.001 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 0, 0, -99.999 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( -99.999, -99.999, -99.999 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( -100.1, -100.1, -100.1 ) ), "Passed!" );
-	ok( a.containsPoint( new THREE.Vector3( 99.999, 99.999, -99.999 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( 100.1, 100.1, -100.1 ) ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, -101 ) ), "Passed!" );
-});
-
-test( "setFromMatrix/makePerspective/intersectsSphere", function() {
-	var m = new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 100 );
-	var a = new THREE.Frustum().setFromMatrix( m );
-
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, 0 ), 0 ) ), "Passed!" );
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, 0 ), 0.9 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, 0 ), 1.1 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, -50 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, -1.001 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( -1, -1, -1.001 ), 0 ) ), "Passed!" );
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( -1.1, -1.1, -1.001 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( -1.1, -1.1, -1.001 ), 0.5 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 1, 1, -1.001 ), 0 ) ), "Passed!" );
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 1.1, 1.1, -1.001 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 1.1, 1.1, -1.001 ), 0.5 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, -99.999 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( -99.999, -99.999, -99.999 ), 0 ) ), "Passed!" );
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( -100.1, -100.1, -100.1 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( -100.1, -100.1, -100.1 ), 0.5 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 99.999, 99.999, -99.999 ), 0 ) ), "Passed!" );
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 100.1, 100.1, -100.1 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 100.1, 100.1, -100.1 ), 0.2 ) ), "Passed!" );
-	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, -101 ), 0 ) ), "Passed!" );
-	ok( a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, -101 ), 1.1 ) ), "Passed!" );
-});
-
-test( "clone", function() {
-
-	var p0 = new THREE.Plane( unit3, -1 );
-	var p1 = new THREE.Plane( unit3, 1 );
-	var p2 = new THREE.Plane( unit3, 2 );
-	var p3 = new THREE.Plane( unit3, 3 );
-	var p4 = new THREE.Plane( unit3, 4 );
-	var p5 = new THREE.Plane( unit3, 5 );
-
-	var b = new THREE.Frustum( p0, p1, p2, p3, p4, p5 );
-	var a = b.clone();
-	ok( a.planes[0].equals( p0 ), "Passed!" );
-	ok( a.planes[1].equals( p1 ), "Passed!" );
-	ok( a.planes[2].equals( p2 ), "Passed!" );
-	ok( a.planes[3].equals( p3 ), "Passed!" );
-	ok( a.planes[4].equals( p4 ), "Passed!" );
-	ok( a.planes[5].equals( p5 ), "Passed!" );
-
-	// ensure it is a true copy by modifying source
-	a.planes[0].copy( p1 );
-	ok( b.planes[0].equals( p0 ), "Passed!" );
-});

+ 0 - 387
test/unit/math/Interpolant.js

@@ -1,387 +0,0 @@
-/**
- * @author tschw
- */
-
-module( "Interpolant" );
-
-// Since this is an abstract base class, we have to make it concrete in order
-// to test its functionality...
-
-function Mock( parameterPositions, sampleValues, sampleSize, resultBuffer ) {
-
-	THREE.Interpolant.call(
-			this, parameterPositions, sampleValues, sampleSize, resultBuffer );
-
-}
-
-Mock.prototype = Object.create( THREE.Interpolant.prototype );
-
-Mock.prototype.intervalChanged_ = function intervalChanged( i1, t0, t1 ) {
-
-	Mock.captureCall( arguments );
-
-};
-
-Mock.prototype.interpolate_ = function interpolate( i1, t0, t, t1 ) {
-
-	Mock.captureCall( arguments );
-	return this.copySampleValue_( i1 - 1 );
-
-};
-
-Mock.prototype.beforeStart_ = function beforeStart( i, t, t0 ) {
-
-	Mock.captureCall( arguments );
-	return this.copySampleValue_( i );
-
-};
-
-Mock.prototype.afterEnd_ = function afterEnd( i, tN, t ) {
-
-	Mock.captureCall( arguments );
-	return this.copySampleValue_( i );
-
-};
-
-// Call capturing facility
-
-Mock.calls = null;
-
-Mock.captureCall = function( args ) {
-
-	if ( Mock.calls !== null ) {
-
-		Mock.calls.push( {
-			func: Mock.captureCall.caller.name,
-			args: Array.prototype.slice.call( args )
-		} );
-
-	}
-
-};
-
-// Tests
-
-test( "copySampleValue_", function() {
-
-	var interpolant = new Mock( null, [ 1, 11, 2, 22, 3, 33 ], 2, [] );
-
-	deepEqual( interpolant.copySampleValue_( 0 ), [ 1, 11 ], "sample fetch (0)" );
-	deepEqual( interpolant.copySampleValue_( 1 ), [ 2, 22 ], "sample fetch (1)" );
-	deepEqual( interpolant.copySampleValue_( 2 ), [ 3, 33 ], "first sample (2)" );
-
-} );
-
-test( "evaluate -> intervalChanged_ / interpolate_", function() {
-
-	var actual, expect;
-
-	var interpolant = new Mock( [ 11, 22, 33, 44, 55, 66, 77, 88, 99 ], null, 0, null );
-
-	Mock.calls = [];
-	interpolant.evaluate( 11 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 1, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 12 ); // same interval
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 12, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 22 ); // step forward
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 2, 22, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 2, 22, 22, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2 );
-
-	Mock.calls = [];
-	interpolant.evaluate( 21 ); // step back
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 1, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 21, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 20 ); // same interval
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 20, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 43 ); // two steps forward
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 3, 33, 44 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 3, 33, 43, 44 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 12 ); // two steps back
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 1, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 12, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 77 ); // random access
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 7, 77, 88 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 7, 77, 77, 88 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 80 ); // same interval
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'interpolate', args: [ 7, 77, 80, 88 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 36 ); // random access
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 3, 33, 44 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 3, 33, 36, 44 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 24 ); // fast reset / loop (2nd)
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 2, 22, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 2, 22, 24, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	Mock.calls = [];
-	interpolant.evaluate( 16 ); // fast reset / loop (2nd)
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 1, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 16, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-} );
-
-test( "evaulate -> beforeStart_ [once]", function() {
-
-	var actual, expect;
-
-	var interpolant = new Mock( [ 11, 22, 33 ], null, 0, null );
-
-	Mock.calls = [];
-	interpolant.evaluate( 10 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'beforeStart', args: [ 0, 10, 11 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	// Check operation resumes normally and intervalChanged gets called
-	Mock.calls = [];
-	interpolant.evaluate( 11 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 1, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	// Back off-bounds
-	Mock.calls = [];
-	interpolant.evaluate( 10 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'beforeStart', args: [ 0, 10, 11 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-} );
-
-test( "evaluate -> beforeStart_ [twice]", function() {
-
-	var actual, expect;
-
-	var interpolant = new Mock( [ 11, 22, 33 ], null, 0, null );
-
-	Mock.calls = [];
-	interpolant.evaluate( 10 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'beforeStart', args: [ 0, 10, 11 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	Mock.calls = []; // again - consider changed state
-	interpolant.evaluate( 10 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'beforeStart', args: [ 0, 10, 11 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	// Check operation resumes normally and intervalChanged gets called
-	Mock.calls = [];
-	interpolant.evaluate( 11 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 1, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 1, 11, 11, 22 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-} );
-
-test( "evaluate -> afterEnd_ [once]", function() {
-
-	var actual, expect;
-
-	var interpolant = new Mock( [ 11, 22, 33 ], null, 0, null );
-
-	Mock.calls = [];
-	interpolant.evaluate( 33 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'afterEnd', args: [ 2, 33, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	// Check operation resumes normally and intervalChanged gets called
-	Mock.calls = [];
-	interpolant.evaluate( 32 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 2, 22, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 2, 22, 32, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-	// Back off-bounds
-	Mock.calls = [];
-	interpolant.evaluate( 33 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'afterEnd', args: [ 2, 33, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-} );
-
-test( "evaluate -> afterEnd_ [twice]", function() {
-
-	var actual, expect;
-
-	var interpolant = new Mock( [ 11, 22, 33 ], null, 0, null );
-
-	Mock.calls = [];
-	interpolant.evaluate( 33 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'afterEnd', args: [ 2, 33, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	Mock.calls = []; // again - consider changed state
-	interpolant.evaluate( 33 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'afterEnd', args: [ 2, 33, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 1, "no further calls" );
-
-	// Check operation resumes normally and intervalChanged gets called
-	Mock.calls = [];
-	interpolant.evaluate( 32 );
-
-	actual = Mock.calls[ 0 ];
-	expect = { func: 'intervalChanged', args: [ 2, 22, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	actual = Mock.calls[ 1 ];
-	expect = { func: 'interpolate', args: [ 2, 22, 32, 33 ] };
-	deepEqual( actual, expect, JSON.stringify( expect ) );
-
-	ok( Mock.calls.length === 2, "no further calls" );
-
-} );

+ 0 - 69
test/unit/math/Line3.js

@@ -1,69 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Line3" );
-
-test( "constructor/equals", function() {
-	var a = new THREE.Line3();
-	ok( a.start.equals( zero3 ), "Passed!" );
-	ok( a.end.equals( zero3 ), "Passed!" );
-
-	a = new THREE.Line3( two3.clone(), one3.clone() );
-	ok( a.start.equals( two3 ), "Passed!" );
-	ok( a.end.equals( one3 ), "Passed!" );
-});
-
-test( "copy/equals", function() {
-	var a = new THREE.Line3( zero3.clone(), one3.clone() );
-	var b = new THREE.Line3().copy( a );
-	ok( b.start.equals( zero3 ), "Passed!" );
-	ok( b.end.equals( one3 ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.start = zero3;
-	a.end = one3;
-	ok( b.start.equals( zero3 ), "Passed!" );
-	ok( b.end.equals( one3 ), "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Line3();
-
-	a.set( one3, one3 );
-	ok( a.start.equals( one3 ), "Passed!" );
-	ok( a.end.equals( one3 ), "Passed!" );
-});
-
-test( "at", function() {
-	var a = new THREE.Line3( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
-
-	ok( a.at( -1 ).distanceTo( new THREE.Vector3( 1, 1, 0 ) ) < 0.0001, "Passed!" );
-	ok( a.at( 0 ).distanceTo( one3.clone() ) < 0.0001, "Passed!" );
-	ok( a.at( 1 ).distanceTo( new THREE.Vector3( 1, 1, 2 ) ) < 0.0001, "Passed!" );
-	ok( a.at( 2 ).distanceTo( new THREE.Vector3( 1, 1, 3 ) ) < 0.0001, "Passed!" );
-});
-
-test( "closestPointToPoint/closestPointToPointParameter", function() {
-	var a = new THREE.Line3( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
-
-	// nearby the ray
-	ok( a.closestPointToPointParameter( zero3.clone(), true ) == 0, "Passed!" );
-	var b1 = a.closestPointToPoint( zero3.clone(), true );
-	ok( b1.distanceTo( new THREE.Vector3( 1, 1, 1 ) ) < 0.0001, "Passed!" );
-
-	// nearby the ray
-	ok( a.closestPointToPointParameter( zero3.clone(), false ) == -1, "Passed!" );
-	var b2 = a.closestPointToPoint( zero3.clone(), false );
-	ok( b2.distanceTo( new THREE.Vector3( 1, 1, 0 ) ) < 0.0001, "Passed!" );
-
-	// nearby the ray
-	ok( a.closestPointToPointParameter( new THREE.Vector3( 1, 1, 5 ), true ) == 1, "Passed!" );
-	var b = a.closestPointToPoint( new THREE.Vector3( 1, 1, 5 ), true );
-	ok( b.distanceTo( new THREE.Vector3( 1, 1, 2 ) ) < 0.0001, "Passed!" );
-
-	// exactly on the ray
-	ok( a.closestPointToPointParameter( one3.clone(), true ) == 0, "Passed!" );
-	var c = a.closestPointToPoint( one3.clone(), true );
-	ok( c.distanceTo( one3.clone() ) < 0.0001, "Passed!" );
-});

+ 0 - 35
test/unit/math/Math.js

@@ -1,35 +0,0 @@
-/**
- * @author humbletim / https://github.com/humbletim
- */
-
-module( "Math" );
-
-//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
-//http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign
-/* 
-20.2.2.29 Math.sign(x)
-
-Returns the sign of the x, indicating whether x is positive, negative or zero.
-
-If x is NaN, the result is NaN.
-If x is -0, the result is -0.
-If x is +0, the result is +0.
-If x is negative and not -0, the result is -1.
-If x is positive and not +0, the result is +1.
-*/
-
-test( "Math.sign/polyfill", function() {
-
-	ok( isNaN( Math.sign(NaN) ) , "If x is NaN<NaN>, the result is NaN.");
-	ok( isNaN( Math.sign(new THREE.Vector3()) ) , "If x is NaN<object>, the result is NaN.");
-	ok( isNaN( Math.sign() ) , "If x is NaN<undefined>, the result is NaN.");
-	ok( isNaN( Math.sign('--3') ) , "If x is NaN<'--3'>, the result is NaN.");
-	ok( Math.sign(-0) === -0 , "If x is -0, the result is -0.");
-	ok( Math.sign(+0) === +0 , "If x is +0, the result is +0.");
-	ok( Math.sign(-Infinity) === -1 , "If x is negative<-Infinity> and not -0, the result is -1.");
-	ok( Math.sign('-3') === -1 , "If x is negative<'-3'> and not -0, the result is -1.");
-	ok( Math.sign('-1e-10') === -1 , "If x is negative<'-1e-10'> and not -0, the result is -1.");
-	ok( Math.sign(+Infinity) === +1 , "If x is positive<+Infinity> and not +0, the result is +1.");
-	ok( Math.sign('+3') === +1 , "If x is positive<'+3'> and not +0, the result is +1.");
-
-});

+ 0 - 212
test/unit/math/Matrix3.js

@@ -1,212 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Matrix3" );
-
-var matrixEquals3 = function( a, b, tolerance ) {
-	tolerance = tolerance || 0.0001;
-	if( a.elements.length != b.elements.length ) {
-		return false;
-	}
-	for( var i = 0, il = a.elements.length; i < il; i ++ ) {
-		var delta = a.elements[i] - b.elements[i];
-		if( delta > tolerance ) {
-			return false;
-		}
-	}
-	return true;
-};
-
-
-var toMatrix4 = function( m3 ) {
-	var result = new THREE.Matrix4();
-	var re = result.elements;
-	var me = m3.elements;
-	re[0] = me[0];
-	re[1] = me[1];
-	re[2] = me[2];
-	re[4] = me[3];
-	re[5] = me[4];
-	re[6] = me[5];
-	re[8] = me[6];
-	re[9] = me[7];
-	re[10] = me[8];
-
-	return result;
-};
-
-test( "constructor", function() {
-	var a = new THREE.Matrix3();
-	ok( a.determinant() == 1, "Passed!" );
-
-	var b = new THREE.Matrix3().set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 3 );
-	ok( b.elements[2] == 6 );
-	ok( b.elements[3] == 1 );
-	ok( b.elements[4] == 4 );
-	ok( b.elements[5] == 7 );
-	ok( b.elements[6] == 2 );
-	ok( b.elements[7] == 5 );
-	ok( b.elements[8] == 8 );
-
-	ok( ! matrixEquals3( a, b ), "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Matrix3().set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	var b = new THREE.Matrix3().copy( a );
-
-	ok( matrixEquals3( a, b ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.elements[0] = 2;
-	ok( ! matrixEquals3( a, b ), "Passed!" );
-});
-
-test( "set", function() {
-	var b = new THREE.Matrix3();
-	ok( b.determinant() == 1, "Passed!" );
-
-	b.set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 3 );
-	ok( b.elements[2] == 6 );
-	ok( b.elements[3] == 1 );
-	ok( b.elements[4] == 4 );
-	ok( b.elements[5] == 7 );
-	ok( b.elements[6] == 2 );
-	ok( b.elements[7] == 5 );
-	ok( b.elements[8] == 8 );
-});
-
-test( "identity", function() {
-	var b = new THREE.Matrix3().set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 3 );
-	ok( b.elements[2] == 6 );
-	ok( b.elements[3] == 1 );
-	ok( b.elements[4] == 4 );
-	ok( b.elements[5] == 7 );
-	ok( b.elements[6] == 2 );
-	ok( b.elements[7] == 5 );
-	ok( b.elements[8] == 8 );
-
-	var a = new THREE.Matrix3();
-	ok( ! matrixEquals3( a, b ), "Passed!" );
-
-	b.identity();
-	ok( matrixEquals3( a, b ), "Passed!" );
-});
-
-test( "multiplyScalar", function() {
-	var b = new THREE.Matrix3().set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 3 );
-	ok( b.elements[2] == 6 );
-	ok( b.elements[3] == 1 );
-	ok( b.elements[4] == 4 );
-	ok( b.elements[5] == 7 );
-	ok( b.elements[6] == 2 );
-	ok( b.elements[7] == 5 );
-	ok( b.elements[8] == 8 );
-
-	b.multiplyScalar( 2 );
-	ok( b.elements[0] == 0*2 );
-	ok( b.elements[1] == 3*2 );
-	ok( b.elements[2] == 6*2 );
-	ok( b.elements[3] == 1*2 );
-	ok( b.elements[4] == 4*2 );
-	ok( b.elements[5] == 7*2 );
-	ok( b.elements[6] == 2*2 );
-	ok( b.elements[7] == 5*2 );
-	ok( b.elements[8] == 8*2 );
-});
-
-
-test( "determinant", function() {
-	var a = new THREE.Matrix3();
-	ok( a.determinant() == 1, "Passed!" );
-
-	a.elements[0] = 2;
-	ok( a.determinant() == 2, "Passed!" );
-
-	a.elements[0] = 0;
-	ok( a.determinant() == 0, "Passed!" );
-
-	// calculated via http://www.euclideanspace.com/maths/algebra/matrix/functions/determinant/threeD/index.htm
-	a.set( 2, 3, 4, 5, 13, 7, 8, 9, 11 );
-	ok( a.determinant() == -73, "Passed!" );
-});
-
-
-test( "getInverse", function() {
-	var identity = new THREE.Matrix3();
-	var identity4 = new THREE.Matrix4();
-	var a = new THREE.Matrix3();
-	var b = new THREE.Matrix3().set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
-	var c = new THREE.Matrix3().set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
-
-	b.getInverse( a, false );
-	ok( matrixEquals3( a, identity ), "Passed!" );
-
-	try { 
-		b.getInverse( c, true );
-		ok( false, "Passed!" ); // should never get here.
-	}
-	catch( err ) {
-		ok( true, "Passed!" );
-	}
-
-	var testMatrices = [
-		new THREE.Matrix4().makeRotationX( 0.3 ),
-		new THREE.Matrix4().makeRotationX( -0.3 ),
-		new THREE.Matrix4().makeRotationY( 0.3 ),
-		new THREE.Matrix4().makeRotationY( -0.3 ),
-		new THREE.Matrix4().makeRotationZ( 0.3 ),
-		new THREE.Matrix4().makeRotationZ( -0.3 ),
-		new THREE.Matrix4().makeScale( 1, 2, 3 ),
-		new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 )
-		];
-
-	for( var i = 0, il = testMatrices.length; i < il; i ++ ) {
-		var m = testMatrices[i];
-
-		a.setFromMatrix4( m );
-		var mInverse3 = b.getInverse( a );
-
-		var mInverse = toMatrix4( mInverse3 );
-
-		// the determinant of the inverse should be the reciprocal
-		ok( Math.abs( a.determinant() * mInverse3.determinant() - 1 ) < 0.0001, "Passed!" );
-		ok( Math.abs( m.determinant() * mInverse.determinant() - 1 ) < 0.0001, "Passed!" );
-
-		var mProduct = new THREE.Matrix4().multiplyMatrices( m, mInverse );
-		ok( Math.abs( mProduct.determinant() - 1 ) < 0.0001, "Passed!" );
-		ok( matrixEquals3( mProduct, identity4 ), "Passed!" );
-	}
-});
-
-test( "transpose", function() {
-	var a = new THREE.Matrix3();
-	var b = a.clone().transpose();
-	ok( matrixEquals3( a, b ), "Passed!" );
-
-	b = new THREE.Matrix3().set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	var c = b.clone().transpose();
-	ok( ! matrixEquals3( b, c ), "Passed!" ); 
-	c.transpose();
-	ok( matrixEquals3( b, c ), "Passed!" ); 
-});
-
-test( "clone", function() {
-	var a = new THREE.Matrix3().set( 0, 1, 2, 3, 4, 5, 6, 7, 8 );
-	var b = a.clone();
-
-	ok( matrixEquals3( a, b ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.elements[0] = 2;
-	ok( ! matrixEquals3( a, b ), "Passed!" );
-});

+ 0 - 328
test/unit/math/Matrix4.js

@@ -1,328 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Matrix4" );
-
-var matrixEquals4 = function( a, b, tolerance ) {
-	tolerance = tolerance || 0.0001;
-	if( a.elements.length != b.elements.length ) {
-		return false;
-	}
-	for( var i = 0, il = a.elements.length; i < il; i ++ ) {
-		var delta = a.elements[i] - b.elements[i];
-		if( delta > tolerance ) {
-			return false;
-		}
-	}
-	return true;
-};
-
-test( "constructor", function() {
-	var a = new THREE.Matrix4();
-	ok( a.determinant() == 1, "Passed!" );
-
-	var b = new THREE.Matrix4().set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 4 );
-	ok( b.elements[2] == 8 );
-	ok( b.elements[3] == 12 );
-	ok( b.elements[4] == 1 );
-	ok( b.elements[5] == 5 );
-	ok( b.elements[6] == 9 );
-	ok( b.elements[7] == 13 );
-	ok( b.elements[8] == 2 );
-	ok( b.elements[9] == 6 );
-	ok( b.elements[10] == 10 );
-	ok( b.elements[11] == 14 );
-	ok( b.elements[12] == 3 );
-	ok( b.elements[13] == 7 );
-	ok( b.elements[14] == 11 );
-	ok( b.elements[15] == 15 );
-
-	ok( ! matrixEquals4( a, b ), "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Matrix4().set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	var b = new THREE.Matrix4().copy( a );
-
-	ok( matrixEquals4( a, b ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.elements[0] = 2;
-	ok( ! matrixEquals4( a, b ), "Passed!" );
-});
-
-test( "set", function() {
-	var b = new THREE.Matrix4();
-	ok( b.determinant() == 1, "Passed!" );
-
-	b.set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 4 );
-	ok( b.elements[2] == 8 );
-	ok( b.elements[3] == 12 );
-	ok( b.elements[4] == 1 );
-	ok( b.elements[5] == 5 );
-	ok( b.elements[6] == 9 );
-	ok( b.elements[7] == 13 );
-	ok( b.elements[8] == 2 );
-	ok( b.elements[9] == 6 );
-	ok( b.elements[10] == 10 );
-	ok( b.elements[11] == 14 );
-	ok( b.elements[12] == 3 );
-	ok( b.elements[13] == 7 );
-	ok( b.elements[14] == 11 );
-	ok( b.elements[15] == 15 );
-});
-
-test( "identity", function() {
-	var b = new THREE.Matrix4().set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 4 );
-	ok( b.elements[2] == 8 );
-	ok( b.elements[3] == 12 );
-	ok( b.elements[4] == 1 );
-	ok( b.elements[5] == 5 );
-	ok( b.elements[6] == 9 );
-	ok( b.elements[7] == 13 );
-	ok( b.elements[8] == 2 );
-	ok( b.elements[9] == 6 );
-	ok( b.elements[10] == 10 );
-	ok( b.elements[11] == 14 );
-	ok( b.elements[12] == 3 );
-	ok( b.elements[13] == 7 );
-	ok( b.elements[14] == 11 );
-	ok( b.elements[15] == 15 );
-
-	var a = new THREE.Matrix4();
-	ok( ! matrixEquals4( a, b ), "Passed!" );
-
-	b.identity();
-	ok( matrixEquals4( a, b ), "Passed!" );
-});
-
-test( "multiplyScalar", function() {
-	var b = new THREE.Matrix4().set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	ok( b.elements[0] == 0 );
-	ok( b.elements[1] == 4 );
-	ok( b.elements[2] == 8 );
-	ok( b.elements[3] == 12 );
-	ok( b.elements[4] == 1 );
-	ok( b.elements[5] == 5 );
-	ok( b.elements[6] == 9 );
-	ok( b.elements[7] == 13 );
-	ok( b.elements[8] == 2 );
-	ok( b.elements[9] == 6 );
-	ok( b.elements[10] == 10 );
-	ok( b.elements[11] == 14 );
-	ok( b.elements[12] == 3 );
-	ok( b.elements[13] == 7 );
-	ok( b.elements[14] == 11 );
-	ok( b.elements[15] == 15 );
-
-	b.multiplyScalar( 2 );
-	ok( b.elements[0] == 0*2 );
-	ok( b.elements[1] == 4*2 );
-	ok( b.elements[2] == 8*2 );
-	ok( b.elements[3] == 12*2 );
-	ok( b.elements[4] == 1*2 );
-	ok( b.elements[5] == 5*2 );
-	ok( b.elements[6] == 9*2 );
-	ok( b.elements[7] == 13*2 );
-	ok( b.elements[8] == 2*2 );
-	ok( b.elements[9] == 6*2 );
-	ok( b.elements[10] == 10*2 );
-	ok( b.elements[11] == 14*2 );
-	ok( b.elements[12] == 3*2 );
-	ok( b.elements[13] == 7*2 );
-	ok( b.elements[14] == 11*2 );
-	ok( b.elements[15] == 15*2 );
-});
-
-test( "determinant", function() {
-	var a = new THREE.Matrix4();
-	ok( a.determinant() == 1, "Passed!" );
-
-	a.elements[0] = 2;
-	ok( a.determinant() == 2, "Passed!" );
-
-	a.elements[0] = 0;
-	ok( a.determinant() == 0, "Passed!" );
-
-	// calculated via http://www.euclideanspace.com/maths/algebra/matrix/functions/determinant/fourD/index.htm
-	a.set( 2, 3, 4, 5, -1, -21, -3, -4, 6, 7, 8, 10, -8, -9, -10, -12 );
-	ok( a.determinant() == 76, "Passed!" );
-});
-
-test( "getInverse", function() {
-	var identity = new THREE.Matrix4();
-
-	var a = new THREE.Matrix4();
-	var b = new THREE.Matrix4().set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
-	var c = new THREE.Matrix4().set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
-
-	ok( ! matrixEquals4( a, b ), "Passed!" );
-	b.getInverse( a, false );
-	ok( matrixEquals4( b, new THREE.Matrix4() ), "Passed!" );
-
-	try {
-		b.getInverse( c, true );
-		ok( false, "Passed!" ); // should never get here.
-	}
-	catch( err ) {
-		ok( true, "Passed!" );
-	}
-
-	var testMatrices = [
-		new THREE.Matrix4().makeRotationX( 0.3 ),
-		new THREE.Matrix4().makeRotationX( -0.3 ),
-		new THREE.Matrix4().makeRotationY( 0.3 ),
-		new THREE.Matrix4().makeRotationY( -0.3 ),
-		new THREE.Matrix4().makeRotationZ( 0.3 ),
-		new THREE.Matrix4().makeRotationZ( -0.3 ),
-		new THREE.Matrix4().makeScale( 1, 2, 3 ),
-		new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 ),
-		new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 1000 ),
-		new THREE.Matrix4().makePerspective( -16, 16, 9, -9, 0.1, 10000 ),
-		new THREE.Matrix4().makeTranslation( 1, 2, 3 )
-		];
-
-	for( var i = 0, il = testMatrices.length; i < il; i ++ ) {
-		var m = testMatrices[i];
-
-		var mInverse = new THREE.Matrix4().getInverse( m );
-		var mSelfInverse = m.clone();
-		mSelfInverse.getInverse( mSelfInverse );
-
-
-		// self-inverse should the same as inverse
-		ok( matrixEquals4( mSelfInverse, mInverse ), "Passed!" );
-
-		// the determinant of the inverse should be the reciprocal
-		ok( Math.abs( m.determinant() * mInverse.determinant() - 1 ) < 0.0001, "Passed!" );
-
-		var mProduct = new THREE.Matrix4().multiplyMatrices( m, mInverse );
-
-		// the determinant of the identity matrix is 1
-		ok( Math.abs( mProduct.determinant() - 1 ) < 0.0001, "Passed!" );
-		ok( matrixEquals4( mProduct, identity ), "Passed!" );
-	}
-});
-
-test( "makeBasis/extractBasis", function() {
-	var identityBasis = [ new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( 0, 0, 1 ) ];
-	var a = new THREE.Matrix4().makeBasis( identityBasis[0], identityBasis[1], identityBasis[2] );
-	var identity = new THREE.Matrix4();
-	ok( matrixEquals4( a, identity ), "Passed!" );
-
-	var testBases = [ [ new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( -1, 0, 0 ), new THREE.Vector3( 0, 0, 1 ) ] ];
-	for( var i = 0; i < testBases.length; i ++ ) {
-		var testBasis = testBases[i];
-		var b = new THREE.Matrix4().makeBasis( testBasis[0], testBasis[1], testBasis[2] );
-		var outBasis = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ];
-		b.extractBasis( outBasis[0], outBasis[1], outBasis[2] );
-		// check what goes in, is what comes out.
-		for( var j = 0; j < outBasis.length; j ++ ) {
-			ok( outBasis[j].equals( testBasis[j] ), "Passed!" );
-		}
-
-		// get the basis out the hard war
-		for( var j = 0; j < identityBasis.length; j ++ ) {
-			outBasis[j].copy( identityBasis[j] );
-			outBasis[j].applyMatrix4( b );
-		}
-		// did the multiply method of basis extraction work?
-		for( var j = 0; j < outBasis.length; j ++ ) {
-			ok( outBasis[j].equals( testBasis[j] ), "Passed!" );
-		}
-	}
-});
-
-test( "transpose", function() {
-	var a = new THREE.Matrix4();
-	var b = a.clone().transpose();
-	ok( matrixEquals4( a, b ), "Passed!" );
-
-	b = new THREE.Matrix4().set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	var c = b.clone().transpose();
-	ok( ! matrixEquals4( b, c ), "Passed!" );
-	c.transpose();
-	ok( matrixEquals4( b, c ), "Passed!" );
-});
-
-test( "clone", function() {
-	var a = new THREE.Matrix4().set( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 );
-	var b = a.clone();
-
-	ok( matrixEquals4( a, b ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.elements[0] = 2;
-	ok( ! matrixEquals4( a, b ), "Passed!" );
-});
-
-
-test( "compose/decompose", function() {
-	var tValues = [
-		new THREE.Vector3(),
-		new THREE.Vector3( 3, 0, 0 ),
-		new THREE.Vector3( 0, 4, 0 ),
-		new THREE.Vector3( 0, 0, 5 ),
-		new THREE.Vector3( -6, 0, 0 ),
-		new THREE.Vector3( 0, -7, 0 ),
-		new THREE.Vector3( 0, 0, -8 ),
-		new THREE.Vector3( -2, 5, -9 ),
-		new THREE.Vector3( -2, -5, -9 )
-	];
-
-	var sValues = [
-		new THREE.Vector3( 1, 1, 1 ),
-		new THREE.Vector3( 2, 2, 2 ),
-		new THREE.Vector3( 1, -1, 1 ),
-		new THREE.Vector3( -1, 1, 1 ),
-		new THREE.Vector3( 1, 1, -1 ),
-		new THREE.Vector3( 2, -2, 1 ),
-		new THREE.Vector3( -1, 2, -2 ),
-		new THREE.Vector3( -1, -1, -1 ),
-		new THREE.Vector3( -2, -2, -2 )
-	];
-
-	var rValues = [
-		new THREE.Quaternion(),
-		new THREE.Quaternion().setFromEuler( new THREE.Euler( 1, 1, 0 ) ),
-		new THREE.Quaternion().setFromEuler( new THREE.Euler( 1, -1, 1 ) ),
-		new THREE.Quaternion( 0, 0.9238795292366128, 0, 0.38268342717215614 )
-	];
-
-
-	for( var ti = 0; ti < tValues.length; ti ++ ) {
-		for( var si = 0; si < sValues.length; si ++ ) {
-			for( var ri = 0; ri < rValues.length; ri ++ ) {
-				var t = tValues[ti];
-				var s = sValues[si];
-				var r = rValues[ri];
-
-				var m = new THREE.Matrix4().compose( t, r, s );
-				var t2 = new THREE.Vector3();
-				var r2 = new THREE.Quaternion();
-				var s2 = new THREE.Vector3();
-
-				m.decompose( t2, r2, s2 );
-
-				var m2 = new THREE.Matrix4().compose( t2, r2, s2 );
-
-				var matrixIsSame = matrixEquals4( m, m2 );
-				/* debug code
-				if( ! matrixIsSame ) {
-					console.log( t, s, r );
-					console.log( t2, s2, r2 );
-					console.log( m, m2 );
-				}*/
-				ok( matrixEquals4( m, m2 ), "Passed!" );
-
-			}
-		}
-	}
-});

+ 0 - 197
test/unit/math/Plane.js

@@ -1,197 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Plane" );
-
-var comparePlane = function ( a, b, threshold ) {
-	threshold = threshold || 0.0001;
-	return ( a.normal.distanceTo( b.normal ) < threshold &&
-	Math.abs( a.constant - b.constant ) < threshold );
-};
-
-
-test( "constructor", function() {
-	var a = new THREE.Plane();
-	ok( a.normal.x == 1, "Passed!" );
-	ok( a.normal.y == 0, "Passed!" );
-	ok( a.normal.z == 0, "Passed!" );
-	ok( a.constant == 0, "Passed!" );
-
-	a = new THREE.Plane( one3.clone(), 0 );
-	ok( a.normal.x == 1, "Passed!" );
-	ok( a.normal.y == 1, "Passed!" );
-	ok( a.normal.z == 1, "Passed!" );
-	ok( a.constant == 0, "Passed!" );
-
-	a = new THREE.Plane( one3.clone(), 1 );
-	ok( a.normal.x == 1, "Passed!" );
-	ok( a.normal.y == 1, "Passed!" );
-	ok( a.normal.z == 1, "Passed!" );
-	ok( a.constant == 1, "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Plane( new THREE.Vector3( x, y, z ), w );
-	var b = new THREE.Plane().copy( a );
-	ok( b.normal.x == x, "Passed!" );
-	ok( b.normal.y == y, "Passed!" );
-	ok( b.normal.z == z, "Passed!" );
-	ok( b.constant == w, "Passed!" );
-
-	// ensure that it is a true copy
-	a.normal.x = 0;
-	a.normal.y = -1;
-	a.normal.z = -2;
-	a.constant = -3;
-	ok( b.normal.x == x, "Passed!" );
-	ok( b.normal.y == y, "Passed!" );
-	ok( b.normal.z == z, "Passed!" );
-	ok( b.constant == w, "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Plane();
-	ok( a.normal.x == 1, "Passed!" );
-	ok( a.normal.y == 0, "Passed!" );
-	ok( a.normal.z == 0, "Passed!" );
-	ok( a.constant == 0, "Passed!" );
-
-	var b = a.clone().set( new THREE.Vector3( x, y, z ), w );
-	ok( b.normal.x == x, "Passed!" );
-	ok( b.normal.y == y, "Passed!" );
-	ok( b.normal.z == z, "Passed!" );
-	ok( b.constant == w, "Passed!" );
-});
-
-test( "setComponents", function() {
-	var a = new THREE.Plane();
-	ok( a.normal.x == 1, "Passed!" );
-	ok( a.normal.y == 0, "Passed!" );
-	ok( a.normal.z == 0, "Passed!" );
-	ok( a.constant == 0, "Passed!" );
-
-	var b = a.clone().setComponents( x, y, z , w );
-	ok( b.normal.x == x, "Passed!" );
-	ok( b.normal.y == y, "Passed!" );
-	ok( b.normal.z == z, "Passed!" );
-	ok( b.constant == w, "Passed!" );
-});
-
-test( "setFromNormalAndCoplanarPoint", function() {
-	var normal = one3.clone().normalize();
-	var a = new THREE.Plane().setFromNormalAndCoplanarPoint( normal, zero3 );
-
-	ok( a.normal.equals( normal ), "Passed!" );
-	ok( a.constant == 0, "Passed!" );
-});
-
-test( "normalize", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 2, 0, 0 ), 2 );
-
-	a.normalize();
-	ok( a.normal.length() == 1, "Passed!" );
-	ok( a.normal.equals( new THREE.Vector3( 1, 0, 0 ) ), "Passed!" );
-	ok( a.constant == 1, "Passed!" );
-});
-
-test( "negate/distanceToPoint", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 2, 0, 0 ), -2 );
-
-	a.normalize();
-	ok( a.distanceToPoint( new THREE.Vector3( 4, 0, 0 ) ) === 3, "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( 1, 0, 0 ) ) === 0, "Passed!" );
-
-	a.negate();
-	ok( a.distanceToPoint( new THREE.Vector3( 4, 0, 0 ) ) === -3, "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( 1, 0, 0 ) ) === 0, "Passed!" );
-});
-
-test( "distanceToPoint", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 2, 0, 0 ), -2 );
-
-	a.normalize();
-	ok( a.distanceToPoint( a.projectPoint( zero3.clone() ) ) === 0, "Passed!" );
-	ok( a.distanceToPoint( new THREE.Vector3( 4, 0, 0 ) ) === 3, "Passed!" );
-});
-
-test( "distanceToSphere", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
-
-	var b = new THREE.Sphere( new THREE.Vector3( 2, 0, 0 ), 1 );
-
-	ok( a.distanceToSphere( b ) === 1, "Passed!" );
-
-	a.set( new THREE.Vector3( 1, 0, 0 ), 2 );
-	ok( a.distanceToSphere( b ) === 3, "Passed!" );
-	a.set( new THREE.Vector3( 1, 0, 0 ), -2 );
-	ok( a.distanceToSphere( b ) === -1, "Passed!" );
-});
-
-test( "isInterestionLine/intersectLine", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
-
-	var l1 = new THREE.Line3( new THREE.Vector3( -10, 0, 0 ), new THREE.Vector3( 10, 0, 0 ) );
-	ok( a.intersectsLine( l1 ), "Passed!" );
-	ok( a.intersectLine( l1 ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), -3 );
-
-	ok( a.intersectsLine( l1 ), "Passed!" );
-	ok( a.intersectLine( l1 ).equals( new THREE.Vector3( 3, 0, 0 ) ), "Passed!" );
-
-
-	a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), -11 );
-
-	ok( ! a.intersectsLine( l1 ), "Passed!" );
-	ok( a.intersectLine( l1 ) === undefined, "Passed!" );
-
-	a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 11 );
-
-	ok( ! a.intersectsLine( l1 ), "Passed!" );
-	ok( a.intersectLine( l1 ) === undefined, "Passed!" );
-
-});
-
-test( "projectPoint", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
-
-	ok( a.projectPoint( new THREE.Vector3( 10, 0, 0 ) ).equals( zero3 ), "Passed!" );
-	ok( a.projectPoint( new THREE.Vector3( -10, 0, 0 ) ).equals( zero3 ), "Passed!" );
-
-	a = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), -1 );
-	ok( a.projectPoint( new THREE.Vector3( 0, 0, 0 ) ).equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-	ok( a.projectPoint( new THREE.Vector3( 0, 1, 0 ) ).equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-
-});
-
-test( "orthoPoint", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
-
-	ok( a.orthoPoint( new THREE.Vector3( 10, 0, 0 ) ).equals( new THREE.Vector3( 10, 0, 0 ) ), "Passed!" );
-	ok( a.orthoPoint( new THREE.Vector3( -10, 0, 0 ) ).equals( new THREE.Vector3( -10, 0, 0 ) ), "Passed!" );
-});
-
-test( "coplanarPoint", function() {
-	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
-	ok( a.distanceToPoint( a.coplanarPoint() ) === 0, "Passed!" );
-
-	a = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), -1 );
-	ok( a.distanceToPoint( a.coplanarPoint() ) === 0, "Passed!" );
-});
-
-test( "applyMatrix4/translate", function() {
-
-	var a = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
-
-	var m = new THREE.Matrix4();
-	m.makeRotationZ( Math.PI * 0.5 );
-
-	ok( comparePlane( a.clone().applyMatrix4( m ), new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), 0 ) ), "Passed!" );
-
-	a = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), -1 );
-	ok( comparePlane( a.clone().applyMatrix4( m ), new THREE.Plane( new THREE.Vector3( -1, 0, 0 ), -1 ) ), "Passed!" );
-
-	m.makeTranslation( 1, 1, 1 );
-	ok( comparePlane( a.clone().applyMatrix4( m ), a.clone().translate( new THREE.Vector3( 1, 1, 1 ) ) ), "Passed!" );
-});

+ 0 - 350
test/unit/math/Quaternion.js

@@ -1,350 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- * @author tschw
- */
-
-module( "Quaternion" );
-
-var orders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ];
-var eulerAngles = new THREE.Euler( 0.1, -0.3, 0.25 );
-
-
-
-var qSub = function ( a, b ) {
-	var result = new THREE.Quaternion();
-	result.copy( a );
-
-	result.x -= b.x;
-	result.y -= b.y;
-	result.z -= b.z;
-	result.w -= b.w;
-
-	return result;
-
-};
-
-test( "constructor", function() {
-	var a = new THREE.Quaternion();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 1, "Passed!" );
-
-	a = new THREE.Quaternion( x, y, z, w );
-	ok( a.x === x, "Passed!" );
-	ok( a.y === y, "Passed!" );
-	ok( a.z === z, "Passed!" );
-	ok( a.w === w, "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Quaternion( x, y, z, w );
-	var b = new THREE.Quaternion().copy( a );
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-	ok( b.z == z, "Passed!" );
-	ok( b.w == w, "Passed!" );
-
-	// ensure that it is a true copy
-	a.x = 0;
-	a.y = -1;
-	a.z = 0;
-	a.w = -1;
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Quaternion();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 1, "Passed!" );
-
-	a.set( x, y, z, w );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z === z, "Passed!" );
-	ok( a.w === w, "Passed!" );
-});
-
-test( "setFromAxisAngle", function() {
-
-	// TODO: find cases to validate.
-	ok( true, "Passed!" );
-
-	var zero = new THREE.Quaternion();
-
-	var a = new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), 0 );
-	ok( a.equals( zero ), "Passed!" );
-	a = new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), 0 );
-	ok( a.equals( zero ), "Passed!" );
-	a = new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 0, 0, 1 ), 0 );
-	ok( a.equals( zero ), "Passed!" );
-
-	var b1 = new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), Math.PI );
-	ok( ! a.equals( b1 ), "Passed!" );
-	var b2 = new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI );
-	ok( ! a.equals( b2 ), "Passed!" );
-
-	b1.multiply( b2 );
-	ok( a.equals( b1 ), "Passed!" );
-});
-
-
-test( "setFromEuler/setFromQuaternion", function() {
-
-	var angles = [ new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( 0, 0, 1 ) ];
-
-	// ensure euler conversion to/from Quaternion matches.
-	for( var i = 0; i < orders.length; i ++ ) {
-		for( var j = 0; j < angles.length; j ++ ) {
-			var eulers2 = new THREE.Euler().setFromQuaternion( new THREE.Quaternion().setFromEuler( new THREE.Euler( angles[j].x, angles[j].y, angles[j].z, orders[i] ) ), orders[i] );
-			var newAngle = new THREE.Vector3( eulers2.x, eulers2.y, eulers2.z );
-			ok( newAngle.distanceTo( angles[j] ) < 0.001, "Passed!" );
-		}
-	}
-
-});
-
-test( "setFromEuler/setFromRotationMatrix", function() {
-
-	// ensure euler conversion for Quaternion matches that of Matrix4
-	for( var i = 0; i < orders.length; i ++ ) {
-		var q = new THREE.Quaternion().setFromEuler( eulerAngles, orders[i] );
-		var m = new THREE.Matrix4().makeRotationFromEuler( eulerAngles, orders[i] );
-		var q2 = new THREE.Quaternion().setFromRotationMatrix( m );
-
-		ok( qSub( q, q2 ).length() < 0.001, "Passed!" );
-	}
-
-});
-
-test( "normalize/length/lengthSq", function() {
-	var a = new THREE.Quaternion( x, y, z, w );
-	var b = new THREE.Quaternion( -x, -y, -z, -w );
-
-	ok( a.length() != 1, "Passed!");
-	ok( a.lengthSq() != 1, "Passed!");
-	a.normalize();
-	ok( a.length() == 1, "Passed!");
-	ok( a.lengthSq() == 1, "Passed!");
-
-	a.set( 0, 0, 0, 0 );
-	ok( a.lengthSq() == 0, "Passed!");
-	ok( a.length() == 0, "Passed!");
-	a.normalize();
-	ok( a.lengthSq() == 1, "Passed!");
-	ok( a.length() == 1, "Passed!");
-});
-
-test( "inverse/conjugate", function() {
-	var a = new THREE.Quaternion( x, y, z, w );
-
-	// TODO: add better validation here.
-
-	var b = a.clone().conjugate();
-
-	ok( a.x == -b.x, "Passed!" );
-	ok( a.y == -b.y, "Passed!" );
-	ok( a.z == -b.z, "Passed!" );
-	ok( a.w == b.w, "Passed!" );
-});
-
-
-test( "multiplyQuaternions/multiply", function() {
-
-	var angles = [ new THREE.Euler( 1, 0, 0 ), new THREE.Euler( 0, 1, 0 ), new THREE.Euler( 0, 0, 1 ) ];
-
-	var q1 = new THREE.Quaternion().setFromEuler( angles[0], "XYZ" );
-	var q2 = new THREE.Quaternion().setFromEuler( angles[1], "XYZ" );
-	var q3 = new THREE.Quaternion().setFromEuler( angles[2], "XYZ" );
-
-	var q = new THREE.Quaternion().multiplyQuaternions( q1, q2 ).multiply( q3 );
-
-	var m1 = new THREE.Matrix4().makeRotationFromEuler( angles[0], "XYZ" );
-	var m2 = new THREE.Matrix4().makeRotationFromEuler( angles[1], "XYZ" );
-	var m3 = new THREE.Matrix4().makeRotationFromEuler( angles[2], "XYZ" );
-
-	var m = new THREE.Matrix4().multiplyMatrices( m1, m2 ).multiply( m3 );
-
-	var qFromM = new THREE.Quaternion().setFromRotationMatrix( m );
-
-	ok( qSub( q, qFromM ).length() < 0.001, "Passed!" );
-});
-
-test( "multiplyVector3", function() {
-
-	var angles = [ new THREE.Euler( 1, 0, 0 ), new THREE.Euler( 0, 1, 0 ), new THREE.Euler( 0, 0, 1 ) ];
-
-	// ensure euler conversion for Quaternion matches that of Matrix4
-	for( var i = 0; i < orders.length; i ++ ) {
-		for( var j = 0; j < angles.length; j ++ ) {
-			var q = new THREE.Quaternion().setFromEuler( angles[j], orders[i] );
-			var m = new THREE.Matrix4().makeRotationFromEuler( angles[j], orders[i] );
-
-			var v0 = new THREE.Vector3(1, 0, 0);
-			var qv = v0.clone().applyQuaternion( q );
-			var mv = v0.clone().applyMatrix4( m );
-
-			ok( qv.distanceTo( mv ) < 0.001, "Passed!" );
-		}
-	}
-
-});
-
-test( "equals", function() {
-	var a = new THREE.Quaternion( x, y, z, w );
-	var b = new THREE.Quaternion( -x, -y, -z, -w );
-
-	ok( a.x != b.x, "Passed!" );
-	ok( a.y != b.y, "Passed!" );
-
-	ok( ! a.equals( b ), "Passed!" );
-	ok( ! b.equals( a ), "Passed!" );
-
-	a.copy( b );
-	ok( a.x == b.x, "Passed!" );
-	ok( a.y == b.y, "Passed!" );
-
-	ok( a.equals( b ), "Passed!" );
-	ok( b.equals( a ), "Passed!" );
-});
-
-
-function doSlerpObject( aArr, bArr, t ) {
-
-	var a = new THREE.Quaternion().fromArray( aArr ),
-		b = new THREE.Quaternion().fromArray( bArr ),
-		c = new THREE.Quaternion().fromArray( aArr );
-
-	c.slerp( b, t );
-
-	return {
-
-		equals: function( x, y, z, w, maxError ) {
-
-			if ( maxError === undefined ) maxError = Number.EPSILON;
-
-			return 	Math.abs( x - c.x ) <= maxError &&
-					Math.abs( y - c.y ) <= maxError &&
-					Math.abs( z - c.z ) <= maxError &&
-					Math.abs( w - c.w ) <= maxError;
-
-		},
-
-		length: c.length(),
-
-		dotA: c.dot( a ),
-		dotB: c.dot( b )
-
-	};
-
-}
-
-function doSlerpArray( a, b, t ) {
-
-	var result = [ 0, 0, 0, 0 ];
-
-	THREE.Quaternion.slerpFlat( result, 0, a, 0, b, 0, t );
-
-	function arrDot( a, b ) {
-
-		return 	a[ 0 ] * b[ 0 ] + a[ 1 ] * b[ 1 ] +
-				a[ 2 ] * b[ 2 ] + a[ 3 ] * b[ 3 ];
-
-	}
-
-	return {
-
-		equals: function( x, y, z, w, maxError ) {
-
-			if ( maxError === undefined ) maxError = Number.EPSILON;
-
-			return 	Math.abs( x - result[ 0 ] ) <= maxError &&
-					Math.abs( y - result[ 1 ] ) <= maxError &&
-					Math.abs( z - result[ 2 ] ) <= maxError &&
-					Math.abs( w - result[ 3 ] ) <= maxError;
-
-		},
-
-		length: Math.sqrt( arrDot( result, result ) ),
-
-		dotA: arrDot( result, a ),
-		dotB: arrDot( result, b )
-
-	};
-
-}
-
-function slerpTestSkeleton( doSlerp, maxError ) {
-
-	var a, b, result;
-
-	a = [
-		0.6753410084407496,
-		0.4087830051091744,
-		0.32856700410659473,
-		0.5185120064806223
-	];
-
-	b = [
-		0.6602792107657797,
-		0.43647413932562285,
-		0.35119011210236006,
-		0.5001871596632682
-	];
-
-	var maxNormError = 0;
-
-	function isNormal( result ) {
-
-		var normError = Math.abs( 1 - result.length );
-		maxNormError = Math.max( maxNormError, normError );
-		return normError <= maxError;
-
-	}
-
-	result = doSlerp( a, b, 0 );
-	ok( result.equals(
-			a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ], 0 ), "Exactly A @ t = 0" );
-
-	result = doSlerp( a, b, 1 );
-	ok( result.equals(
-			b[ 0 ], b[ 1 ], b[ 2 ], b[ 3 ], 0 ), "Exactly B @ t = 1" );
-
-	result = doSlerp( a, b, 0.5 );
-	ok( Math.abs( result.dotA - result.dotB ) <= Number.EPSILON, "Symmetry at 0.5" );
-	ok( isNormal( result ), "Approximately normal (at 0.5)" );
-
-	result = doSlerp( a, b, 0.25 );
-	ok( result.dotA > result.dotB, "Interpolating at 0.25" );
-	ok( isNormal( result ), "Approximately normal (at 0.25)" );
-
-	result = doSlerp( a, b, 0.75 );
-	ok( result.dotA < result.dotB, "Interpolating at 0.75" );
-	ok( isNormal( result ), "Approximately normal (at 0.75)" );
-
-	var D = Math.SQRT1_2;
-
-	result = doSlerp( [ 1, 0, 0, 0 ], [ 0, 0, 1, 0 ], 0.5 );
-	ok( result.equals( D, 0, D, 0 ), "X/Z diagonal from axes" );
-	ok( isNormal( result ), "Approximately normal (X/Z diagonal)" );
-
-	result = doSlerp( [ 0, D, 0, D ], [ 0, -D, 0, D ], 0.5 );
-	ok( result.equals( 0, 0, 0, 1 ), "W-Unit from diagonals" );
-	ok( isNormal( result ), "Approximately normal (W-Unit)" );
-}
-
-
-test( "slerp", function() {
-
-	slerpTestSkeleton( doSlerpObject, Number.EPSILON );
-
-} );
-
-test( "slerpFlat", function() {
-
-	slerpTestSkeleton( doSlerpArray, Number.EPSILON );
-
-} );

+ 0 - 331
test/unit/math/Ray.js

@@ -1,331 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Ray" );
-
-test( "constructor/equals", function() {
-	var a = new THREE.Ray();
-	ok( a.origin.equals( zero3 ), "Passed!" );
-	ok( a.direction.equals( zero3 ), "Passed!" );
-
-	a = new THREE.Ray( two3.clone(), one3.clone() );
-	ok( a.origin.equals( two3 ), "Passed!" );
-	ok( a.direction.equals( one3 ), "Passed!" );
-});
-
-test( "copy/equals", function() {
-	var a = new THREE.Ray( zero3.clone(), one3.clone() );
-	var b = new THREE.Ray().copy( a );
-	ok( b.origin.equals( zero3 ), "Passed!" );
-	ok( b.direction.equals( one3 ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.origin = zero3;
-	a.direction = one3;
-	ok( b.origin.equals( zero3 ), "Passed!" );
-	ok( b.direction.equals( one3 ), "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Ray();
-
-	a.set( one3, one3 );
-	ok( a.origin.equals( one3 ), "Passed!" );
-	ok( a.direction.equals( one3 ), "Passed!" );
-});
-
-test( "at", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	ok( a.at( 0 ).equals( one3 ), "Passed!" );
-	ok( a.at( -1 ).equals( new THREE.Vector3( 1, 1, 0 ) ), "Passed!" );
-	ok( a.at( 1 ).equals( new THREE.Vector3( 1, 1, 2 ) ), "Passed!" );
-});
-
-test( "recast/clone", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	ok( a.recast( 0 ).equals( a ), "Passed!" );
-
-	var b = a.clone();
-	ok( b.recast( -1 ).equals( new THREE.Ray( new THREE.Vector3( 1, 1, 0 ), new THREE.Vector3( 0, 0, 1 ) ) ), "Passed!" );
-
-	var c = a.clone();
-	ok( c.recast( 1 ).equals( new THREE.Ray( new THREE.Vector3( 1, 1, 2 ), new THREE.Vector3( 0, 0, 1 ) ) ), "Passed!" );
-
-	var d = a.clone();
-	var e = d.clone().recast( 1 );
-	ok( d.equals( a ), "Passed!" );
-	ok( ! e.equals( d ), "Passed!" );
-	ok( e.equals( c ), "Passed!" );
-});
-
-test( "closestPointToPoint", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	// behind the ray
-	var b = a.closestPointToPoint( zero3 );
-	ok( b.equals( one3 ), "Passed!" );
-
-	// front of the ray
-	var c = a.closestPointToPoint( new THREE.Vector3( 0, 0, 50 ) );
-	ok( c.equals( new THREE.Vector3( 1, 1, 50 ) ), "Passed!" );
-
-	// exactly on the ray
-	var d = a.closestPointToPoint( one3 );
-	ok( d.equals( one3 ), "Passed!" );
-});
-
-test( "distanceToPoint", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	// behind the ray
-	var b = a.distanceToPoint( zero3 );
-	ok( b === Math.sqrt( 3 ), "Passed!" );
-
-	// front of the ray
-	var c = a.distanceToPoint( new THREE.Vector3( 0, 0, 50 ) );
-	ok( c === Math.sqrt( 2 ), "Passed!" );
-
-	// exactly on the ray
-	var d = a.distanceToPoint( one3 );
-	ok( d === 0, "Passed!" );
-});
-
-test( "distanceSqToPoint", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	// behind the ray
-	var b = a.distanceSqToPoint( zero3 );
-	ok( b === 3, "Passed!" );
-
-	// front of the ray
-	var c = a.distanceSqToPoint( new THREE.Vector3( 0, 0, 50 ) );
-	ok( c === 2, "Passed!" );
-
-	// exactly on the ray
-	var d = a.distanceSqToPoint( one3 );
-	ok( d === 0, "Passed!" );
-});
-
-test( "intersectsSphere", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-	var b = new THREE.Sphere( zero3, 0.5 );
-	var c = new THREE.Sphere( zero3, 1.5 );
-	var d = new THREE.Sphere( one3, 0.1 );
-	var e = new THREE.Sphere( two3, 0.1 );
-	var f = new THREE.Sphere( two3, 1 );
-
-	ok( ! a.intersectsSphere( b ), "Passed!" );
-	ok( ! a.intersectsSphere( c ), "Passed!" );
-	ok( a.intersectsSphere( d ), "Passed!" );
-	ok( ! a.intersectsSphere( e ), "Passed!" );
-	ok( ! a.intersectsSphere( f ), "Passed!" );
-});
-
-test( "intersectSphere", function() {
-
-	var TOL = 0.0001;
-
-	// ray a0 origin located at ( 0, 0, 0 ) and points outward in negative-z direction
-	var a0 = new THREE.Ray( zero3.clone(), new THREE.Vector3( 0, 0, -1 ) );
-	// ray a1 origin located at ( 1, 1, 1 ) and points left in negative-x direction
-	var a1 = new THREE.Ray( one3.clone(), new THREE.Vector3( -1, 0, 0 ) );
-
-	// sphere (radius of 2) located behind ray a0, should result in null
-	var b = new THREE.Sphere( new THREE.Vector3( 0, 0, 3 ), 2 );
-	ok( a0.intersectSphere( b ) === null, "Passed!" );
-
-	// sphere (radius of 2) located in front of, but too far right of ray a0, should result in null
-	var b = new THREE.Sphere( new THREE.Vector3( 3, 0, -1 ), 2 );
-	ok( a0.intersectSphere( b ) === null, "Passed!" );
-
-	// sphere (radius of 2) located below ray a1, should result in null
-	var b = new THREE.Sphere( new THREE.Vector3( 1, -2, 1 ), 2 );
-	ok( a1.intersectSphere( b ) === null, "Passed!" );
-
-	// sphere (radius of 1) located to the left of ray a1, should result in intersection at 0, 1, 1
-	var b = new THREE.Sphere( new THREE.Vector3( -1, 1, 1 ), 1 );
-	ok( a1.intersectSphere( b ).distanceTo( new THREE.Vector3( 0, 1, 1 ) ) < TOL, "Passed!" );
-
-	// sphere (radius of 1) located in front of ray a0, should result in intersection at 0, 0, -1
-	var b = new THREE.Sphere( new THREE.Vector3( 0, 0, -2 ), 1 );
-	ok( a0.intersectSphere( b ).distanceTo( new THREE.Vector3( 0, 0, -1 ) ) < TOL, "Passed!" );
-
-	// sphere (radius of 2) located in front & right of ray a0, should result in intersection at 0, 0, -1, or left-most edge of sphere
-	var b = new THREE.Sphere( new THREE.Vector3( 2, 0, -1 ), 2 );
-	ok( a0.intersectSphere( b ).distanceTo( new THREE.Vector3( 0, 0, -1 ) ) < TOL, "Passed!" );
-
-	// same situation as above, but move the sphere a fraction more to the right, and ray a0 should now just miss
-	var b = new THREE.Sphere( new THREE.Vector3( 2.01, 0, -1 ), 2 );
-	ok( a0.intersectSphere( b ) === null, "Passed!" );
-
-	// following tests are for situations where the ray origin is inside the sphere
-
-	// sphere (radius of 1) center located at ray a0 origin / sphere surrounds the ray origin, so the first intersect point 0, 0, 1,
-	// is behind ray a0.  Therefore, second exit point on back of sphere will be returned: 0, 0, -1
-	// thus keeping the intersection point always in front of the ray.
-	var b = new THREE.Sphere( zero3.clone(), 1 );
-	ok( a0.intersectSphere( b ).distanceTo( new THREE.Vector3( 0, 0, -1 ) ) < TOL, "Passed!" );
-
-	// sphere (radius of 4) center located behind ray a0 origin / sphere surrounds the ray origin, so the first intersect point 0, 0, 5,
-	// is behind ray a0.  Therefore, second exit point on back of sphere will be returned: 0, 0, -3
-	// thus keeping the intersection point always in front of the ray.
-	var b = new THREE.Sphere( new THREE.Vector3( 0, 0, 1 ), 4 );
-	ok( a0.intersectSphere( b ).distanceTo( new THREE.Vector3( 0, 0, -3 ) ) < TOL, "Passed!" );
-
-	// sphere (radius of 4) center located in front of ray a0 origin / sphere surrounds the ray origin, so the first intersect point 0, 0, 3,
-	// is behind ray a0.  Therefore, second exit point on back of sphere will be returned: 0, 0, -5
-	// thus keeping the intersection point always in front of the ray.
-	var b = new THREE.Sphere( new THREE.Vector3( 0, 0, -1 ), 4 );
-	ok( a0.intersectSphere( b ).distanceTo( new THREE.Vector3( 0, 0, -5 ) ) < TOL, "Passed!" );
-
-});
-
-test( "intersectsPlane", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	// parallel plane in front of the ray
-	var b = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().sub( new THREE.Vector3( 0, 0, -1 ) ) );
-	ok( a.intersectsPlane( b ), "Passed!" );
-
-	// parallel plane coincident with origin
-	var c = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().sub( new THREE.Vector3( 0, 0, 0 ) ) );
-	ok( a.intersectsPlane( c ), "Passed!" );
-
-	// parallel plane behind the ray
-	var d = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().sub( new THREE.Vector3( 0, 0, 1 ) ) );
-	ok( ! a.intersectsPlane( d ), "Passed!" );
-
-	// perpendical ray that overlaps exactly
-	var e = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 1, 0, 0 ), one3 );
-	ok( a.intersectsPlane( e ), "Passed!" );
-
-	// perpendical ray that doesn't overlap
-	var f = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 1, 0, 0 ), zero3 );
-	ok( ! a.intersectsPlane( f ), "Passed!" );
-});
-
-test( "intersectPlane", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-
-	// parallel plane behind
-	var b = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), new THREE.Vector3( 1, 1, -1 ) );
-	ok( a.intersectPlane( b ) === null, "Passed!" );
-
-	// parallel plane coincident with origin
-	var c = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), new THREE.Vector3( 1, 1, 0 ) );
-	ok( a.intersectPlane( c ) === null, "Passed!" );
-
-	// parallel plane infront
-	var d = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), new THREE.Vector3( 1, 1, 1 ) );
-	ok( a.intersectPlane( d ).equals( a.origin ), "Passed!" );
-
-	// perpendical ray that overlaps exactly
-	var e = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 1, 0, 0 ), one3 );
-	ok( a.intersectPlane( e ).equals( a.origin ), "Passed!" );
-
-	// perpendical ray that doesn't overlap
-	var f = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 1, 0, 0 ), zero3 );
-	ok( a.intersectPlane( f ) === null, "Passed!" );
-});
-
-
-test( "applyMatrix4", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-	var m = new THREE.Matrix4();
-
-	ok( a.clone().applyMatrix4( m ).equals( a ), "Passed!" );
-
-	a = new THREE.Ray( zero3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-	m.makeRotationZ( Math.PI );
-	ok( a.clone().applyMatrix4( m ).equals( a ), "Passed!" );
-
-	m.makeRotationX( Math.PI );
-	var b = a.clone();
-	b.direction.negate();
-	var a2 = a.clone().applyMatrix4( m );
-	ok( a2.origin.distanceTo( b.origin ) < 0.0001, "Passed!" );
-	ok( a2.direction.distanceTo( b.direction ) < 0.0001, "Passed!" );
-
-	a.origin = new THREE.Vector3( 0, 0, 1 );
-	b.origin = new THREE.Vector3( 0, 0, -1 );
-	var a2 = a.clone().applyMatrix4( m );
-	ok( a2.origin.distanceTo( b.origin ) < 0.0001, "Passed!" );
-	ok( a2.direction.distanceTo( b.direction ) < 0.0001, "Passed!" );
-});
-
-
-test( "distanceSqToSegment", function() {
-	var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
-	var ptOnLine = new THREE.Vector3();
-	var ptOnSegment = new THREE.Vector3();
-
-	//segment in front of the ray
-	var v0 = new THREE.Vector3( 3, 5, 50 );
-	var v1 = new THREE.Vector3( 50, 50, 50 ); // just a far away point
-	var distSqr = a.distanceSqToSegment( v0, v1, ptOnLine, ptOnSegment );
-
-	ok( ptOnSegment.distanceTo( v0 ) < 0.0001, "Passed!" );
-	ok( ptOnLine.distanceTo( new THREE.Vector3(1, 1, 50) ) < 0.0001, "Passed!" );
-	// ((3-1) * (3-1) + (5-1) * (5-1) = 4 + 16 = 20
-	ok( Math.abs( distSqr - 20 ) < 0.0001, "Passed!" );
-
-	//segment behind the ray
-	v0 = new THREE.Vector3( -50, -50, -50 ); // just a far away point
-	v1 = new THREE.Vector3( -3, -5, -4 );
-	distSqr = a.distanceSqToSegment( v0, v1, ptOnLine, ptOnSegment );
-
-	ok( ptOnSegment.distanceTo( v1 ) < 0.0001, "Passed!" );
-	ok( ptOnLine.distanceTo( one3 ) < 0.0001, "Passed!" );
-	// ((-3-1) * (-3-1) + (-5-1) * (-5-1) + (-4-1) + (-4-1) = 16 + 36 + 25 = 77
-	ok( Math.abs( distSqr - 77 ) < 0.0001, "Passed!" );
-
-	//exact intersection between the ray and the segment
-	v0 = new THREE.Vector3( -50, -50, -50 );
-	v1 = new THREE.Vector3( 50, 50, 50 );
-	distSqr = a.distanceSqToSegment( v0, v1, ptOnLine, ptOnSegment );
-
-	ok( ptOnSegment.distanceTo( one3 ) < 0.0001, "Passed!" );
-	ok( ptOnLine.distanceTo( one3 ) < 0.0001, "Passed!" );
-	ok( distSqr < 0.0001, "Passed!" );
-});
-
-test( "intersectBox", function() {
-
-	var TOL = 0.0001;
-
-	var box = new THREE.Box3( new THREE.Vector3(  -1, -1, -1 ), new THREE.Vector3( 1, 1, 1 ) );
-
-	var a = new THREE.Ray( new THREE.Vector3( -2, 0, 0 ), new THREE.Vector3( 1, 0, 0) );
-	//ray should intersect box at -1,0,0
-	ok( a.intersectsBox(box) === true, "Passed!" );
-	ok( a.intersectBox(box).distanceTo( new THREE.Vector3( -1, 0, 0 ) ) < TOL, "Passed!" );
-
-	var b = new THREE.Ray( new THREE.Vector3( -2, 0, 0 ), new THREE.Vector3( -1, 0, 0) );
-	//ray is point away from box, it should not intersect
-	ok( b.intersectsBox(box) === false, "Passed!" );
-	ok( b.intersectBox(box) === null, "Passed!" );
-
-	var c = new THREE.Ray( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0) );
-	// ray is inside box, should return exit point
-	ok( c.intersectsBox(box) === true, "Passed!" );
-	ok( c.intersectBox(box).distanceTo( new THREE.Vector3( 1, 0, 0 ) ) < TOL, "Passed!" );
-
-	var d = new THREE.Ray( new THREE.Vector3( 0, 2, 1 ), new THREE.Vector3( 0, -1, -1).normalize() );
-	//tilted ray should intersect box at 0,1,0
-	ok( d.intersectsBox(box) === true, "Passed!" );
-	ok( d.intersectBox(box).distanceTo( new THREE.Vector3( 0, 1, 0 ) ) < TOL, "Passed!" );
-
-	var e = new THREE.Ray( new THREE.Vector3( 1, -2, 1 ), new THREE.Vector3( 0, 1, 0).normalize() );
-	//handle case where ray is coplanar with one of the boxes side - box in front of ray
-	ok( e.intersectsBox(box) === true, "Passed!" );
-	ok( e.intersectBox(box).distanceTo( new THREE.Vector3( 1, -1, 1 ) ) < TOL, "Passed!" );
-
-	var f = new THREE.Ray( new THREE.Vector3( 1, -2, 0 ), new THREE.Vector3( 0, -1, 0).normalize() );
-	//handle case where ray is coplanar with one of the boxes side - box behind ray
-	ok( f.intersectsBox(box) === false, "Passed!" );
-	ok( f.intersectBox(box) == null, "Passed!" );
-
-});

+ 0 - 112
test/unit/math/Sphere.js

@@ -1,112 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Sphere" );
-
-test( "constructor", function() {
-	var a = new THREE.Sphere();
-	ok( a.center.equals( zero3 ), "Passed!" );
-	ok( a.radius == 0, "Passed!" );
-
-	a = new THREE.Sphere( one3.clone(), 1 );
-	ok( a.center.equals( one3 ), "Passed!" );
-	ok( a.radius == 1, "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-	var b = new THREE.Sphere().copy( a );
-
-	ok( b.center.equals( one3 ), "Passed!" );
-	ok( b.radius == 1, "Passed!" );
-
-	// ensure that it is a true copy
-	a.center = zero3;
-	a.radius = 0;
-	ok( b.center.equals( one3 ), "Passed!" );
-	ok( b.radius == 1, "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Sphere();
-	ok( a.center.equals( zero3 ), "Passed!" );
-	ok( a.radius == 0, "Passed!" );
-
-	a.set( one3, 1 );
-	ok( a.center.equals( one3 ), "Passed!" );
-	ok( a.radius == 1, "Passed!" );
-});
-
-test( "empty", function() {
-	var a = new THREE.Sphere();
-	ok( a.empty(), "Passed!" );
-
-	a.set( one3, 1 );
-	ok( ! a.empty(), "Passed!" );
-});
-
-test( "containsPoint", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-
-	ok( ! a.containsPoint( zero3 ), "Passed!" );
-	ok( a.containsPoint( one3 ), "Passed!" );
-});
-
-test( "distanceToPoint", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-
-	ok( ( a.distanceToPoint( zero3 ) - 0.7320 ) < 0.001, "Passed!" );
-	ok( a.distanceToPoint( one3 ) === -1, "Passed!" );
-});
-
-test( "intersectsSphere", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-	var b = new THREE.Sphere( zero3.clone(), 1 );
-	var c = new THREE.Sphere( zero3.clone(), 0.25 );
-
-	ok( a.intersectsSphere( b ) , "Passed!" );
-	ok( ! a.intersectsSphere( c ) , "Passed!" );
-});
-
-test( "intersectsPlane", function() {
-	var a = new THREE.Sphere( zero3.clone(), 1 );
-	var b = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), 1 );
-	var c = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ), 1.25 );
-	var d = new THREE.Plane( new THREE.Vector3( 0, -1, 0 ), 1.25 );
-
-	ok( a.intersectsPlane( b ) , "Passed!" );
-	ok( ! a.intersectsPlane( c ) , "Passed!" );
-	ok( ! a.intersectsPlane( d ) , "Passed!" );
-});
-
-test( "clampPoint", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-
-	ok( a.clampPoint( new THREE.Vector3( 1, 1, 3 ) ).equals( new THREE.Vector3( 1, 1, 2 ) ), "Passed!" );
-	ok( a.clampPoint( new THREE.Vector3( 1, 1, -3 ) ).equals( new THREE.Vector3( 1, 1, 0 ) ), "Passed!" );
-});
-
-test( "getBoundingBox", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-
-	ok( a.getBoundingBox().equals( new THREE.Box3( zero3, two3 ) ), "Passed!" );
-
-	a.set( zero3, 0 );
-	ok( a.getBoundingBox().equals( new THREE.Box3( zero3, zero3 ) ), "Passed!" );
-});
-
-test( "applyMatrix4", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-
-	var m = new THREE.Matrix4().makeTranslation( 1, -2, 1 );
-
-	ok( a.clone().applyMatrix4( m ).getBoundingBox().equals( a.getBoundingBox().applyMatrix4( m ) ), "Passed!" );
-});
-
-test( "translate", function() {
-	var a = new THREE.Sphere( one3.clone(), 1 );
-
-	a.translate( one3.clone().negate() );
-	ok( a.center.equals( zero3 ), "Passed!" );
-});

+ 0 - 191
test/unit/math/Triangle.js

@@ -1,191 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Triangle" );
-
-test( "constructor", function() {
-	var a = new THREE.Triangle();
-	ok( a.a.equals( zero3 ), "Passed!" );
-	ok( a.b.equals( zero3 ), "Passed!" );
-	ok( a.c.equals( zero3 ), "Passed!" );
-
-	a = new THREE.Triangle( one3.clone().negate(), one3.clone(), two3.clone() );
-	ok( a.a.equals( one3.clone().negate() ), "Passed!" );
-	ok( a.b.equals( one3 ), "Passed!" );
-	ok( a.c.equals( two3 ), "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Triangle( one3.clone().negate(), one3.clone(), two3.clone() );
-	var b = new THREE.Triangle().copy( a );
-	ok( b.a.equals( one3.clone().negate() ), "Passed!" );
-	ok( b.b.equals( one3 ), "Passed!" );
-	ok( b.c.equals( two3 ), "Passed!" );
-
-	// ensure that it is a true copy
-	a.a = one3;
-	a.b = zero3;
-	a.c = zero3;
-	ok( b.a.equals( one3.clone().negate() ), "Passed!" );
-	ok( b.b.equals( one3 ), "Passed!" );
-	ok( b.c.equals( two3 ), "Passed!" );
-});
-
-test( "setFromPointsAndIndices", function() {
-	var a = new THREE.Triangle();
-
-	var points = [ one3, one3.clone().negate(), two3 ];
-	a.setFromPointsAndIndices( points, 1, 0, 2 );
-	ok( a.a.equals( one3.clone().negate() ), "Passed!" );
-	ok( a.b.equals( one3 ), "Passed!" );
-	ok( a.c.equals( two3 ), "Passed!" );
-
-});
-
-test( "set", function() {
-	var a = new THREE.Triangle();
-
-	a.set( one3.clone().negate(), one3, two3 );
-	ok( a.a.equals( one3.clone().negate() ), "Passed!" );
-	ok( a.b.equals( one3 ), "Passed!" );
-	ok( a.c.equals( two3 ), "Passed!" );
-
-});
-
-test( "area", function() {
-	var a = new THREE.Triangle();
-
-	ok( a.area() == 0, "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-	ok( a.area() == 0.5, "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 2 ) );
-	ok( a.area() == 2, "Passed!" );
-
-	// colinear triangle.
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 3, 0, 0 ) );
-	ok( a.area() == 0, "Passed!" );
-});
-
-test( "midpoint", function() {
-	var a = new THREE.Triangle();
-
-	ok( a.midpoint().equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-	ok( a.midpoint().equals( new THREE.Vector3( 1/3, 1/3, 0 ) ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 2 ) );
-	ok( a.midpoint().equals( new THREE.Vector3( 2/3, 0, 2/3 ) ), "Passed!" );
-});
-
-test( "normal", function() {
-	var a = new THREE.Triangle();
-
-	ok( a.normal().equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-	ok( a.normal().equals( new THREE.Vector3( 0, 0, 1 ) ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 2 ) );
-	ok( a.normal().equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-});
-
-test( "plane", function() {
-	var a = new THREE.Triangle();
-
-	// artificial normal is created in this case.
-	ok( a.plane().distanceToPoint( a.a ) == 0, "Passed!" );
-	ok( a.plane().distanceToPoint( a.b ) == 0, "Passed!" );
-	ok( a.plane().distanceToPoint( a.c ) == 0, "Passed!" );
-	ok( a.plane().normal.equals( a.normal() ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-	ok( a.plane().distanceToPoint( a.a ) == 0, "Passed!" );
-	ok( a.plane().distanceToPoint( a.b ) == 0, "Passed!" );
-	ok( a.plane().distanceToPoint( a.c ) == 0, "Passed!" );
-	ok( a.plane().normal.equals( a.normal() ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 2 ) );
-	ok( a.plane().distanceToPoint( a.a ) == 0, "Passed!" );
-	ok( a.plane().distanceToPoint( a.b ) == 0, "Passed!" );
-	ok( a.plane().distanceToPoint( a.c ) == 0, "Passed!" );
-	ok( a.plane().normal.clone().normalize().equals( a.normal() ), "Passed!" );
-});
-
-test( "barycoordFromPoint", function() {
-	var a = new THREE.Triangle();
-
-	var bad = new THREE.Vector3( -2, -1, -1 );
-
-	ok( a.barycoordFromPoint( a.a ).equals( bad ), "Passed!" );
-	ok( a.barycoordFromPoint( a.b ).equals( bad ), "Passed!" );
-	ok( a.barycoordFromPoint( a.c ).equals( bad ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-	ok( a.barycoordFromPoint( a.a ).equals( new THREE.Vector3( 1, 0, 0 ) ), "Passed!" );
-	ok( a.barycoordFromPoint( a.b ).equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-	ok( a.barycoordFromPoint( a.c ).equals( new THREE.Vector3( 0, 0, 1 ) ), "Passed!" );
-	ok( a.barycoordFromPoint( a.midpoint() ).distanceTo( new THREE.Vector3( 1/3, 1/3, 1/3 ) ) < 0.0001, "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 2 ) );
-	ok( a.barycoordFromPoint( a.a ).equals( new THREE.Vector3( 1, 0, 0 ) ), "Passed!" );
-	ok( a.barycoordFromPoint( a.b ).equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-	ok( a.barycoordFromPoint( a.c ).equals( new THREE.Vector3( 0, 0, 1 ) ), "Passed!" );
-	ok( a.barycoordFromPoint( a.midpoint() ).distanceTo( new THREE.Vector3( 1/3, 1/3, 1/3 ) ) < 0.0001, "Passed!" );
-});
-
-test( "containsPoint", function() {
-	var a = new THREE.Triangle();
-
-	ok( ! a.containsPoint( a.a ), "Passed!" );
-	ok( ! a.containsPoint( a.b ), "Passed!" );
-	ok( ! a.containsPoint( a.c ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-	ok( a.containsPoint( a.a ), "Passed!" );
-	ok( a.containsPoint( a.b ), "Passed!" );
-	ok( a.containsPoint( a.c ), "Passed!" );
-	ok( a.containsPoint( a.midpoint() ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( -1, -1, -1 ) ), "Passed!" );
-
-	a = new THREE.Triangle( new THREE.Vector3( 2, 0, 0 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 2 ) );
-	ok( a.containsPoint( a.a ), "Passed!" );
-	ok( a.containsPoint( a.b ), "Passed!" );
-	ok( a.containsPoint( a.c ), "Passed!" );
-	ok( a.containsPoint( a.midpoint() ), "Passed!" );
-	ok( ! a.containsPoint( new THREE.Vector3( -1, -1, -1 ) ), "Passed!" );
-});
-
-test( "closestPointToPoint", function() {
-
-	var a = new THREE.Triangle( new THREE.Vector3( -1, 0, 0 ), new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );
-
-	// point lies inside the triangle
-	var b0 = a.closestPointToPoint( new THREE.Vector3( 0, 0.5, 0 ) );
-	ok( b0.equals( new THREE.Vector3( 0, 0.5, 0 ) ), "Passed!" );
-
-	// point lies on a vertex
-	b0 = a.closestPointToPoint( a.a );
-	ok( b0.equals( a.a ), "Passed!" );
-	b0 = a.closestPointToPoint( a.b );
-	ok( b0.equals( a.b ), "Passed!" );
-	b0 = a.closestPointToPoint( a.c );
-	ok( b0.equals( a.c ), "Passed!" );
-
-	// point lies on an edge
-	b0 = a.closestPointToPoint( zero3.clone() );
-	ok( b0.equals( zero3.clone() ), "Passed!" );
-
-	// point lies outside the triangle
-	b0 = a.closestPointToPoint( new THREE.Vector3( -2, 0, 0 ) );
-	ok( b0.equals( new THREE.Vector3( -1, 0, 0 ) ), "Passed!" );
-	b0 = a.closestPointToPoint( new THREE.Vector3( 2, 0, 0 ) );
-	ok( b0.equals( new THREE.Vector3( 1, 0, 0 ) ), "Passed!" );
-	b0 = a.closestPointToPoint( new THREE.Vector3( 0, 2, 0 ) );
-	ok( b0.equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-	b0 = a.closestPointToPoint( new THREE.Vector3( 0, -2, 0 ) );
-	ok( b0.equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-});

+ 0 - 262
test/unit/math/Vector2.js

@@ -1,262 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Vector2" );
-
-test( "constructor", function() {
-	var a = new THREE.Vector2();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-
-	a = new THREE.Vector2( x, y );
-	ok( a.x === x, "Passed!" );
-	ok( a.y === y, "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Vector2( x, y );
-	var b = new THREE.Vector2().copy( a );
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-
-	// ensure that it is a true copy
-	a.x = 0;
-	a.y = -1;
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Vector2();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-
-	a.set( x, y );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-});
-
-test( "setX,setY", function() {
-	var a = new THREE.Vector2();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-
-	a.setX( x );
-	a.setY( y );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-});
-
-test( "setComponent,getComponent", function() {
-	var a = new THREE.Vector2();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-
-	a.setComponent( 0, 1 );
-	a.setComponent( 1, 2 );
-	ok( a.getComponent( 0 ) == 1, "Passed!" );
-	ok( a.getComponent( 1 ) == 2, "Passed!" );
-});
-
-test( "add", function() {
-	var a = new THREE.Vector2( x, y );
-	var b = new THREE.Vector2( -x, -y );
-
-	a.add( b );
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-
-	var c = new THREE.Vector2().addVectors( b, b );
-	ok( c.x == -2*x, "Passed!" );
-	ok( c.y == -2*y, "Passed!" );
-});
-
-test( "sub", function() {
-	var a = new THREE.Vector2( x, y );
-	var b = new THREE.Vector2( -x, -y );
-
-	a.sub( b );
-	ok( a.x == 2*x, "Passed!" );
-	ok( a.y == 2*y, "Passed!" );
-
-	var c = new THREE.Vector2().subVectors( a, a );
-	ok( c.x == 0, "Passed!" );
-	ok( c.y == 0, "Passed!" );
-});
-
-test( "multiply/divide", function() {
-	var a = new THREE.Vector2( x, y );
-	var b = new THREE.Vector2( -x, -y );
-
-	a.multiplyScalar( -2 );
-	ok( a.x == x*-2, "Passed!" );
-	ok( a.y == y*-2, "Passed!" );
-
-	b.multiplyScalar( -2 );
-	ok( b.x == 2*x, "Passed!" );
-	ok( b.y == 2*y, "Passed!" );
-
-	a.divideScalar( -2 );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-
-	b.divideScalar( -2 );
-	ok( b.x == -x, "Passed!" );
-	ok( b.y == -y, "Passed!" );
-});
-
-
-test( "min/max/clamp", function() {
-	var a = new THREE.Vector2( x, y );
-	var b = new THREE.Vector2( -x, -y );
-	var c = new THREE.Vector2();
-
-	c.copy( a ).min( b );
-	ok( c.x == -x, "Passed!" );
-	ok( c.y == -y, "Passed!" );
-
-	c.copy( a ).max( b );
-	ok( c.x == x, "Passed!" );
-	ok( c.y == y, "Passed!" );
-
-	c.set( -2*x, 2*y );
-	c.clamp( b, a );
-	ok( c.x == -x, "Passed!" );
-	ok( c.y == y, "Passed!" );
-
-	c.set(-2*x, 2*x);
-	c.clampScalar( -x, x );
-	equal( c.x, -x, "scalar clamp x" );
-	equal( c.y,  x, "scalar clamp y" );
-});
-
-test( "rounding", function() {
-	deepEqual( new THREE.Vector2( -0.1, 0.1 ).floor(), new THREE.Vector2( -1, 0 ), "floor .1" );
-	deepEqual( new THREE.Vector2( -0.5, 0.5 ).floor(), new THREE.Vector2( -1, 0 ), "floor .5" );
-	deepEqual( new THREE.Vector2( -0.9, 0.9 ).floor(), new THREE.Vector2( -1, 0 ), "floor .9" );
-
-	deepEqual( new THREE.Vector2( -0.1, 0.1 ).ceil(), new THREE.Vector2( 0, 1 ), "ceil .1" );
-	deepEqual( new THREE.Vector2( -0.5, 0.5 ).ceil(), new THREE.Vector2( 0, 1 ), "ceil .5" );
-	deepEqual( new THREE.Vector2( -0.9, 0.9 ).ceil(), new THREE.Vector2( 0, 1 ), "ceil .9" );
-
-	deepEqual( new THREE.Vector2( -0.1, 0.1 ).round(), new THREE.Vector2( 0, 0 ), "round .1" );
-	deepEqual( new THREE.Vector2( -0.5, 0.5 ).round(), new THREE.Vector2( 0, 1 ), "round .5" );
-	deepEqual( new THREE.Vector2( -0.9, 0.9 ).round(), new THREE.Vector2( -1, 1 ), "round .9" );
-
-	deepEqual( new THREE.Vector2( -0.1, 0.1 ).roundToZero(), new THREE.Vector2( 0, 0 ), "roundToZero .1" );
-	deepEqual( new THREE.Vector2( -0.5, 0.5 ).roundToZero(), new THREE.Vector2( 0, 0 ), "roundToZero .5" );
-	deepEqual( new THREE.Vector2( -0.9, 0.9 ).roundToZero(), new THREE.Vector2( 0, 0 ), "roundToZero .9" );
-	deepEqual( new THREE.Vector2( -1.1, 1.1 ).roundToZero(), new THREE.Vector2( -1, 1 ), "roundToZero 1.1" );
-	deepEqual( new THREE.Vector2( -1.5, 1.5 ).roundToZero(), new THREE.Vector2( -1, 1 ), "roundToZero 1.5" );
-	deepEqual( new THREE.Vector2( -1.9, 1.9 ).roundToZero(), new THREE.Vector2( -1, 1 ), "roundToZero 1.9" );
-});
-
-test( "negate", function() {
-	var a = new THREE.Vector2( x, y );
-
-	a.negate();
-	ok( a.x == -x, "Passed!" );
-	ok( a.y == -y, "Passed!" );
-});
-
-test( "dot", function() {
-	var a = new THREE.Vector2( x, y );
-	var b = new THREE.Vector2( -x, -y );
-	var c = new THREE.Vector2();
-
-	var result = a.dot( b );
-	ok( result == (-x*x-y*y), "Passed!" );
-
-	result = a.dot( c );
-	ok( result == 0, "Passed!" );
-});
-
-test( "length/lengthSq", function() {
-	var a = new THREE.Vector2( x, 0 );
-	var b = new THREE.Vector2( 0, -y );
-	var c = new THREE.Vector2();
-
-	ok( a.length() == x, "Passed!" );
-	ok( a.lengthSq() == x*x, "Passed!" );
-	ok( b.length() == y, "Passed!" );
-	ok( b.lengthSq() == y*y, "Passed!" );
-	ok( c.length() == 0, "Passed!" );
-	ok( c.lengthSq() == 0, "Passed!" );
-
-	a.set( x, y );
-	ok( a.length() == Math.sqrt( x*x + y*y ), "Passed!" );
-	ok( a.lengthSq() == ( x*x + y*y ), "Passed!" );
-});
-
-test( "normalize", function() {
-	var a = new THREE.Vector2( x, 0 );
-	var b = new THREE.Vector2( 0, -y );
-	var c = new THREE.Vector2();
-
-	a.normalize();
-	ok( a.length() == 1, "Passed!" );
-	ok( a.x == 1, "Passed!" );
-
-	b.normalize();
-	ok( b.length() == 1, "Passed!" );
-	ok( b.y == -1, "Passed!" );
-});
-
-test( "distanceTo/distanceToSquared", function() {
-	var a = new THREE.Vector2( x, 0 );
-	var b = new THREE.Vector2( 0, -y );
-	var c = new THREE.Vector2();
-
-	ok( a.distanceTo( c ) == x, "Passed!" );
-	ok( a.distanceToSquared( c ) == x*x, "Passed!" );
-
-	ok( b.distanceTo( c ) == y, "Passed!" );
-	ok( b.distanceToSquared( c ) == y*y, "Passed!" );
-});
-
-test( "setLength", function() {
-	var a = new THREE.Vector2( x, 0 );
-
-	ok( a.length() == x, "Passed!" );
-	a.setLength( y );
-	ok( a.length() == y, "Passed!" );
-
-	a = new THREE.Vector2( 0, 0 );
-	ok( a.length() == 0, "Passed!" );
-	a.setLength( y );
-	ok( a.length() == 0, "Passed!" );
-});
-
-test( "lerp/clone", function() {
-	var a = new THREE.Vector2( x, 0 );
-	var b = new THREE.Vector2( 0, -y );
-
-	ok( a.lerp( a, 0 ).equals( a.lerp( a, 0.5 ) ), "Passed!" );
-	ok( a.lerp( a, 0 ).equals( a.lerp( a, 1 ) ), "Passed!" );
-
-	ok( a.clone().lerp( b, 0 ).equals( a ), "Passed!" );
-
-	ok( a.clone().lerp( b, 0.5 ).x == x*0.5, "Passed!" );
-	ok( a.clone().lerp( b, 0.5 ).y == -y*0.5, "Passed!" );
-
-	ok( a.clone().lerp( b, 1 ).equals( b ), "Passed!" );
-});
-
-test( "equals", function() {
-	var a = new THREE.Vector2( x, 0 );
-	var b = new THREE.Vector2( 0, -y );
-
-	ok( a.x != b.x, "Passed!" );
-	ok( a.y != b.y, "Passed!" );
-
-	ok( ! a.equals( b ), "Passed!" );
-	ok( ! b.equals( a ), "Passed!" );
-
-	a.copy( b );
-	ok( a.x == b.x, "Passed!" );
-	ok( a.y == b.y, "Passed!" );
-
-	ok( a.equals( b ), "Passed!" );
-	ok( b.equals( a ), "Passed!" );
-});

+ 0 - 379
test/unit/math/Vector3.js

@@ -1,379 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Vector3" );
-
-test( "constructor", function() {
-	var a = new THREE.Vector3();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-
-	a = new THREE.Vector3( x, y, z );
-	ok( a.x === x, "Passed!" );
-	ok( a.y === y, "Passed!" );
-	ok( a.z === z, "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector3().copy( a );
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-	ok( b.z == z, "Passed!" );
-
-	// ensure that it is a true copy
-	a.x = 0;
-	a.y = -1;
-	a.z = -2;
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-	ok( b.z == z, "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Vector3();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-
-	a.set( x, y, z );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z == z, "Passed!" );
-});
-
-test( "setX,setY,setZ", function() {
-	var a = new THREE.Vector3();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-
-	a.setX( x );
-	a.setY( y );
-	a.setZ( z );
-
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z == z, "Passed!" );
-});
-
-test( "setComponent,getComponent", function() {
-	var a = new THREE.Vector3();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-
-	a.setComponent( 0, 1 );
-	a.setComponent( 1, 2 );
-	a.setComponent( 2, 3 );
-	ok( a.getComponent( 0 ) == 1, "Passed!" );
-	ok( a.getComponent( 1 ) == 2, "Passed!" );
-	ok( a.getComponent( 2 ) == 3, "Passed!" );
-});
-
-test( "add", function() {
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector3( -x, -y, -z );
-
-	a.add( b );
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-
-	var c = new THREE.Vector3().addVectors( b, b );
-	ok( c.x == -2*x, "Passed!" );
-	ok( c.y == -2*y, "Passed!" );
-	ok( c.z == -2*z, "Passed!" );
-});
-
-test( "sub", function() {
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector3( -x, -y, -z );
-
-	a.sub( b );
-	ok( a.x == 2*x, "Passed!" );
-	ok( a.y == 2*y, "Passed!" );
-	ok( a.z == 2*z, "Passed!" );
-
-	var c = new THREE.Vector3().subVectors( a, a );
-	ok( c.x == 0, "Passed!" );
-	ok( c.y == 0, "Passed!" );
-	ok( c.z == 0, "Passed!" );
-});
-
-test( "multiply/divide", function() {
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector3( -x, -y, -z );
-
-	a.multiplyScalar( -2 );
-	ok( a.x == x*-2, "Passed!" );
-	ok( a.y == y*-2, "Passed!" );
-	ok( a.z == z*-2, "Passed!" );
-
-	b.multiplyScalar( -2 );
-	ok( b.x == 2*x, "Passed!" );
-	ok( b.y == 2*y, "Passed!" );
-	ok( b.z == 2*z, "Passed!" );
-
-	a.divideScalar( -2 );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z == z, "Passed!" );
-
-	b.divideScalar( -2 );
-	ok( b.x == -x, "Passed!" );
-	ok( b.y == -y, "Passed!" );
-	ok( b.z == -z, "Passed!" );
-});
-
-test( "min/max/clamp", function() {
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector3( -x, -y, -z );
-	var c = new THREE.Vector3();
-
-	c.copy( a ).min( b );
-	ok( c.x == -x, "Passed!" );
-	ok( c.y == -y, "Passed!" );
-	ok( c.z == -z, "Passed!" );
-
-	c.copy( a ).max( b );
-	ok( c.x == x, "Passed!" );
-	ok( c.y == y, "Passed!" );
-	ok( c.z == z, "Passed!" );
-
-	c.set( -2*x, 2*y, -2*z );
-	c.clamp( b, a );
-	ok( c.x == -x, "Passed!" );
-	ok( c.y == y, "Passed!" );
-	ok( c.z == -z, "Passed!" );
-});
-
-test( "negate", function() {
-	var a = new THREE.Vector3( x, y, z );
-
-	a.negate();
-	ok( a.x == -x, "Passed!" );
-	ok( a.y == -y, "Passed!" );
-	ok( a.z == -z, "Passed!" );
-});
-
-test( "dot", function() {
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector3( -x, -y, -z );
-	var c = new THREE.Vector3();
-
-	var result = a.dot( b );
-	ok( result == (-x*x-y*y-z*z), "Passed!" );
-
-	result = a.dot( c );
-	ok( result == 0, "Passed!" );
-});
-
-test( "length/lengthSq", function() {
-	var a = new THREE.Vector3( x, 0, 0 );
-	var b = new THREE.Vector3( 0, -y, 0 );
-	var c = new THREE.Vector3( 0, 0, z );
-	var d = new THREE.Vector3();
-
-	ok( a.length() == x, "Passed!" );
-	ok( a.lengthSq() == x*x, "Passed!" );
-	ok( b.length() == y, "Passed!" );
-	ok( b.lengthSq() == y*y, "Passed!" );
-	ok( c.length() == z, "Passed!" );
-	ok( c.lengthSq() == z*z, "Passed!" );
-	ok( d.length() == 0, "Passed!" );
-	ok( d.lengthSq() == 0, "Passed!" );
-
-	a.set( x, y, z );
-	ok( a.length() == Math.sqrt( x*x + y*y + z*z ), "Passed!" );
-	ok( a.lengthSq() == ( x*x + y*y + z*z ), "Passed!" );
-});
-
-test( "normalize", function() {
-	var a = new THREE.Vector3( x, 0, 0 );
-	var b = new THREE.Vector3( 0, -y, 0 );
-	var c = new THREE.Vector3( 0, 0, z );
-
-	a.normalize();
-	ok( a.length() == 1, "Passed!" );
-	ok( a.x == 1, "Passed!" );
-
-	b.normalize();
-	ok( b.length() == 1, "Passed!" );
-	ok( b.y == -1, "Passed!" );
-
-	c.normalize();
-	ok( c.length() == 1, "Passed!" );
-	ok( c.z == 1, "Passed!" );
-});
-
-test( "distanceTo/distanceToSquared", function() {
-	var a = new THREE.Vector3( x, 0, 0 );
-	var b = new THREE.Vector3( 0, -y, 0 );
-	var c = new THREE.Vector3( 0, 0, z );
-	var d = new THREE.Vector3();
-
-	ok( a.distanceTo( d ) == x, "Passed!" );
-	ok( a.distanceToSquared( d ) == x*x, "Passed!" );
-
-	ok( b.distanceTo( d ) == y, "Passed!" );
-	ok( b.distanceToSquared( d ) == y*y, "Passed!" );
-
-	ok( c.distanceTo( d ) == z, "Passed!" );
-	ok( c.distanceToSquared( d ) == z*z, "Passed!" );
-});
-
-test( "setLength", function() {
-	var a = new THREE.Vector3( x, 0, 0 );
-
-	ok( a.length() == x, "Passed!" );
-	a.setLength( y );
-	ok( a.length() == y, "Passed!" );
-
-	a = new THREE.Vector3( 0, 0, 0 );
-	ok( a.length() == 0, "Passed!" );
-	a.setLength( y );
-	ok( a.length() == 0, "Passed!" );
-
-});
-
-test( "projectOnVector", function() {
-	var a = new THREE.Vector3( 1, 0, 0 );
-	var b = new THREE.Vector3();
-	var normal = new THREE.Vector3( 10, 0, 0 );
-
-	ok( b.copy( a ).projectOnVector( normal ).equals( new THREE.Vector3( 1, 0, 0 ) ), "Passed!" );
-
-	a.set( 0, 1, 0 );
-	ok( b.copy( a ).projectOnVector( normal ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	a.set( 0, 0, -1 );
-	ok( b.copy( a ).projectOnVector( normal ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	a.set( -1, 0, 0 );
-	ok( b.copy( a ).projectOnVector( normal ).equals( new THREE.Vector3( -1, 0, 0 ) ), "Passed!" );
-
-});
-
-test( "projectOnPlane", function() {
-	var a = new THREE.Vector3( 1, 0, 0 );
-	var b = new THREE.Vector3();
-	var normal = new THREE.Vector3( 1, 0, 0 );
-
-	ok( b.copy( a ).projectOnPlane( normal ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-	a.set( 0, 1, 0 );
-	ok( b.copy( a ).projectOnPlane( normal ).equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-
-	a.set( 0, 0, -1 );
-	ok( b.copy( a ).projectOnPlane( normal ).equals( new THREE.Vector3( 0, 0, -1 ) ), "Passed!" );
-
-	a.set( -1, 0, 0 );
-	ok( b.copy( a ).projectOnPlane( normal ).equals( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
-
-});
-
-test( "reflect", function() {
-	var a = new THREE.Vector3();
-	var normal = new THREE.Vector3( 0, 1, 0 );
-	var b = new THREE.Vector3();
-
-	a.set( 0, -1, 0 );
-	ok( b.copy( a ).reflect( normal ).equals( new THREE.Vector3( 0, 1, 0 ) ), "Passed!" );
-
-	a.set( 1, -1, 0 );
-	ok( b.copy( a ).reflect( normal ).equals( new THREE.Vector3( 1, 1, 0 ) ), "Passed!" );
-
-	a.set( 1, -1, 0 );
-	normal.set( 0, -1, 0 );
-	ok( b.copy( a ).reflect( normal ).equals( new THREE.Vector3( 1, 1, 0 ) ), "Passed!" );
-});
-
-test( "angleTo", function() {
-	var a = new THREE.Vector3( 0, -0.18851655680720186, 0.9820700116639124 );
-	var b = new THREE.Vector3( 0, 0.18851655680720186, -0.9820700116639124 );
-
-	equal( a.angleTo( a ), 0 );
-	equal( a.angleTo( b ), Math.PI );
-
-	var x = new THREE.Vector3( 1, 0, 0 );
-	var y = new THREE.Vector3( 0, 1, 0 );
-	var z = new THREE.Vector3( 0, 0, 1 );
-
-	equal( x.angleTo( y ), Math.PI / 2 );
-	equal( x.angleTo( z ), Math.PI / 2 );
-	equal( z.angleTo( x ), Math.PI / 2 );
-
-	ok( Math.abs( x.angleTo( new THREE.Vector3( 1, 1, 0 ) ) - ( Math.PI / 4 ) ) < 0.0000001 );
-});
-
-test( "lerp/clone", function() {
-	var a = new THREE.Vector3( x, 0, z );
-	var b = new THREE.Vector3( 0, -y, 0 );
-
-	ok( a.lerp( a, 0 ).equals( a.lerp( a, 0.5 ) ), "Passed!" );
-	ok( a.lerp( a, 0 ).equals( a.lerp( a, 1 ) ), "Passed!" );
-
-	ok( a.clone().lerp( b, 0 ).equals( a ), "Passed!" );
-
-	ok( a.clone().lerp( b, 0.5 ).x == x*0.5, "Passed!" );
-	ok( a.clone().lerp( b, 0.5 ).y == -y*0.5, "Passed!" );
-	ok( a.clone().lerp( b, 0.5 ).z == z*0.5, "Passed!" );
-
-	ok( a.clone().lerp( b, 1 ).equals( b ), "Passed!" );
-});
-
-test( "equals", function() {
-	var a = new THREE.Vector3( x, 0, z );
-	var b = new THREE.Vector3( 0, -y, 0 );
-
-	ok( a.x != b.x, "Passed!" );
-	ok( a.y != b.y, "Passed!" );
-	ok( a.z != b.z, "Passed!" );
-
-	ok( ! a.equals( b ), "Passed!" );
-	ok( ! b.equals( a ), "Passed!" );
-
-	a.copy( b );
-	ok( a.x == b.x, "Passed!" );
-	ok( a.y == b.y, "Passed!" );
-	ok( a.z == b.z, "Passed!" );
-
-	ok( a.equals( b ), "Passed!" );
-	ok( b.equals( a ), "Passed!" );
-});
-
-test( "applyMatrix4", function() {
-
-	var a = new THREE.Vector3( x, y, z );
-	var b = new THREE.Vector4( x, y, z, 1 );
-
-	var m = new THREE.Matrix4().makeRotationX( Math.PI );
-	a.applyMatrix4( m );
-	b.applyMatrix4( m );
-	ok( a.x == b.x / b.w, "Passed!" );
-	ok( a.y == b.y / b.w, "Passed!" );
-	ok( a.z == b.z / b.w, "Passed!" );
-
-	m = new THREE.Matrix4().makeTranslation( 3, 2, 1 );
-	a.applyMatrix4( m );
-	b.applyMatrix4( m );
-	ok( a.x == b.x / b.w, "Passed!" );
-	ok( a.y == b.y / b.w, "Passed!" );
-	ok( a.z == b.z / b.w, "Passed!" );
-
-	m = new THREE.Matrix4().set(
-		1, 0, 0, 0,
-		0, 1, 0, 0,
-		0, 0, 1, 0,
-		0, 0, 1, 0
-	);
-	a.applyMatrix4( m );
-	b.applyMatrix4( m );
-	ok( a.x == b.x / b.w, "Passed!" );
-	ok( a.y == b.y / b.w, "Passed!" );
-	ok( a.z == b.z / b.w, "Passed!" );
-
-});

+ 0 - 318
test/unit/math/Vector4.js

@@ -1,318 +0,0 @@
-/**
- * @author bhouston / http://exocortex.com
- */
-
-module( "Vector4" );
-
-test( "constructor", function() {
-	var a = new THREE.Vector4();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 1, "Passed!" );
-
-	a = new THREE.Vector4( x, y, z, w );
-	ok( a.x === x, "Passed!" );
-	ok( a.y === y, "Passed!" );
-	ok( a.z === z, "Passed!" );
-	ok( a.w === w, "Passed!" );
-});
-
-test( "copy", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-	var b = new THREE.Vector4().copy( a );
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-	ok( b.z == z, "Passed!" );
-	ok( b.w == w, "Passed!" );
-
-	// ensure that it is a true copy
-	a.x = 0;
-	a.y = -1;
-	a.z = -2;
-	a.w = -3;
-	ok( b.x == x, "Passed!" );
-	ok( b.y == y, "Passed!" );
-	ok( b.z == z, "Passed!" );
-	ok( b.w == w, "Passed!" );
-});
-
-test( "set", function() {
-	var a = new THREE.Vector4();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 1, "Passed!" );
-
-	a.set( x, y, z, w );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z == z, "Passed!" );
-	ok( a.w == w, "Passed!" );
-});
-
-test( "setX,setY,setZ,setW", function() {
-	var a = new THREE.Vector4();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 1, "Passed!" );
-
-	a.setX( x );
-	a.setY( y );
-	a.setZ( z );
-	a.setW( w );
-
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z == z, "Passed!" );
-	ok( a.w == w, "Passed!" );
-});
-
-test( "setComponent,getComponent", function() {
-	var a = new THREE.Vector4();
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 1, "Passed!" );
-
-	a.setComponent( 0, 1 );
-	a.setComponent( 1, 2 );
-	a.setComponent( 2, 3 );
-	a.setComponent( 3, 4 );
-	ok( a.getComponent( 0 ) == 1, "Passed!" );
-	ok( a.getComponent( 1 ) == 2, "Passed!" );
-	ok( a.getComponent( 2 ) == 3, "Passed!" );
-	ok( a.getComponent( 3 ) == 4, "Passed!" );
-});
-
-test( "add", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-	var b = new THREE.Vector4( -x, -y, -z, -w );
-
-	a.add( b );
-	ok( a.x == 0, "Passed!" );
-	ok( a.y == 0, "Passed!" );
-	ok( a.z == 0, "Passed!" );
-	ok( a.w == 0, "Passed!" );
-
-	var c = new THREE.Vector4().addVectors( b, b );
-	ok( c.x == -2*x, "Passed!" );
-	ok( c.y == -2*y, "Passed!" );
-	ok( c.z == -2*z, "Passed!" );
-	ok( c.w == -2*w, "Passed!" );
-});
-
-test( "sub", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-	var b = new THREE.Vector4( -x, -y, -z, -w );
-
-	a.sub( b );
-	ok( a.x == 2*x, "Passed!" );
-	ok( a.y == 2*y, "Passed!" );
-	ok( a.z == 2*z, "Passed!" );
-	ok( a.w == 2*w, "Passed!" );
-
-	var c = new THREE.Vector4().subVectors( a, a );
-	ok( c.x == 0, "Passed!" );
-	ok( c.y == 0, "Passed!" );
-	ok( c.z == 0, "Passed!" );
-	ok( c.w == 0, "Passed!" );
-});
-
-test( "multiply/divide", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-	var b = new THREE.Vector4( -x, -y, -z, -w );
-
-	a.multiplyScalar( -2 );
-	ok( a.x == x*-2, "Passed!" );
-	ok( a.y == y*-2, "Passed!" );
-	ok( a.z == z*-2, "Passed!" );
-	ok( a.w == w*-2, "Passed!" );
-
-	b.multiplyScalar( -2 );
-	ok( b.x == 2*x, "Passed!" );
-	ok( b.y == 2*y, "Passed!" );	
-	ok( b.z == 2*z, "Passed!" );	
-	ok( b.w == 2*w, "Passed!" );	
-
-	a.divideScalar( -2 );
-	ok( a.x == x, "Passed!" );
-	ok( a.y == y, "Passed!" );
-	ok( a.z == z, "Passed!" );
-	ok( a.w == w, "Passed!" );
-
-	b.divideScalar( -2 );
-	ok( b.x == -x, "Passed!" );
-	ok( b.y == -y, "Passed!" );
-	ok( b.z == -z, "Passed!" );
-	ok( b.w == -w, "Passed!" );
-});
-
-test( "min/max/clamp", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-	var b = new THREE.Vector4( -x, -y, -z, -w );
-	var c = new THREE.Vector4();
-
-	c.copy( a ).min( b );
-	ok( c.x == -x, "Passed!" );
-	ok( c.y == -y, "Passed!" );
-	ok( c.z == -z, "Passed!" );
-	ok( c.w == -w, "Passed!" );
-
-	c.copy( a ).max( b );
-	ok( c.x == x, "Passed!" );
-	ok( c.y == y, "Passed!" );
-	ok( c.z == z, "Passed!" );
-	ok( c.w == w, "Passed!" );
-
-	c.set( -2*x, 2*y, -2*z, 2*w );
-	c.clamp( b, a );
-	ok( c.x == -x, "Passed!" );
-	ok( c.y == y, "Passed!" );
-	ok( c.z == -z, "Passed!" );
-	ok( c.w == w, "Passed!" );
-});
-
-test( "negate", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-
-	a.negate();
-	ok( a.x == -x, "Passed!" );
-	ok( a.y == -y, "Passed!" );
-	ok( a.z == -z, "Passed!" );
-	ok( a.w == -w, "Passed!" );
-});
-
-test( "dot", function() {
-	var a = new THREE.Vector4( x, y, z, w );
-	var b = new THREE.Vector4( -x, -y, -z, -w );
-	var c = new THREE.Vector4( 0, 0, 0, 0 );
-
-	var result = a.dot( b );
-	ok( result == (-x*x-y*y-z*z-w*w), "Passed!" );
-
-	result = a.dot( c );
-	ok( result == 0, "Passed!" );
-});
-
-test( "length/lengthSq", function() {
-	var a = new THREE.Vector4( x, 0, 0, 0 );
-	var b = new THREE.Vector4( 0, -y, 0, 0 );
-	var c = new THREE.Vector4( 0, 0, z, 0 );
-	var d = new THREE.Vector4( 0, 0, 0, w );
-	var e = new THREE.Vector4( 0, 0, 0, 0 );
-	
-	ok( a.length() == x, "Passed!" );
-	ok( a.lengthSq() == x*x, "Passed!" );
-	ok( b.length() == y, "Passed!" );
-	ok( b.lengthSq() == y*y, "Passed!" );
-	ok( c.length() == z, "Passed!" );
-	ok( c.lengthSq() == z*z, "Passed!" );
-	ok( d.length() == w, "Passed!" );
-	ok( d.lengthSq() == w*w, "Passed!" );
-	ok( e.length() == 0, "Passed!" );
-	ok( e.lengthSq() == 0, "Passed!" );
-
-	a.set( x, y, z, w );
-	ok( a.length() == Math.sqrt( x*x + y*y + z*z + w*w ), "Passed!" );
-	ok( a.lengthSq() == ( x*x + y*y + z*z + w*w ), "Passed!" );
-});
-
-test( "normalize", function() {
-	var a = new THREE.Vector4( x, 0, 0, 0 );
-	var b = new THREE.Vector4( 0, -y, 0, 0 );
-	var c = new THREE.Vector4( 0, 0, z, 0 );
-	var d = new THREE.Vector4( 0, 0, 0, -w );
-	
-	a.normalize();
-	ok( a.length() == 1, "Passed!" );
-	ok( a.x == 1, "Passed!" );
-
-	b.normalize();
-	ok( b.length() == 1, "Passed!" );
-	ok( b.y == -1, "Passed!" );
-
-	c.normalize();
-	ok( c.length() == 1, "Passed!" );
-	ok( c.z == 1, "Passed!" );
-
-	d.normalize();
-	ok( d.length() == 1, "Passed!" );
-	ok( d.w == -1, "Passed!" );
-});
-
-/*
-test( "distanceTo/distanceToSquared", function() {
-	var a = new THREE.Vector4( x, 0, 0, 0 );
-	var b = new THREE.Vector4( 0, -y, 0, 0 );
-	var c = new THREE.Vector4( 0, 0, z, 0 );
-	var d = new THREE.Vector4( 0, 0, 0, -w );
-	var e = new THREE.Vector4();
-	
-	ok( a.distanceTo( e ) == x, "Passed!" );
-	ok( a.distanceToSquared( e ) == x*x, "Passed!" );
-
-	ok( b.distanceTo( e ) == y, "Passed!" );
-	ok( b.distanceToSquared( e ) == y*y, "Passed!" );
-
-	ok( c.distanceTo( e ) == z, "Passed!" );
-	ok( c.distanceToSquared( e ) == z*z, "Passed!" );
-
-	ok( d.distanceTo( e ) == w, "Passed!" );
-	ok( d.distanceToSquared( e ) == w*w, "Passed!" );
-});
-*/
-
-
-test( "setLength", function() {
-	var a = new THREE.Vector4( x, 0, 0, 0 );
-
-	ok( a.length() == x, "Passed!" );
-	a.setLength( y );
-	ok( a.length() == y, "Passed!" );
-
-	a = new THREE.Vector4( 0, 0, 0, 0 );
-	ok( a.length() == 0, "Passed!" );
-	a.setLength( y );
-	ok( a.length() == 0, "Passed!" );
-});
-
-test( "lerp/clone", function() {
-	var a = new THREE.Vector4( x, 0, z, 0 );
-	var b = new THREE.Vector4( 0, -y, 0, -w );
-
-	ok( a.lerp( a, 0 ).equals( a.lerp( a, 0.5 ) ), "Passed!" );
-	ok( a.lerp( a, 0 ).equals( a.lerp( a, 1 ) ), "Passed!" );
-
-	ok( a.clone().lerp( b, 0 ).equals( a ), "Passed!" );
-
-	ok( a.clone().lerp( b, 0.5 ).x == x*0.5, "Passed!" );
-	ok( a.clone().lerp( b, 0.5 ).y == -y*0.5, "Passed!" );
-	ok( a.clone().lerp( b, 0.5 ).z == z*0.5, "Passed!" );
-	ok( a.clone().lerp( b, 0.5 ).w == -w*0.5, "Passed!" );
-
-	ok( a.clone().lerp( b, 1 ).equals( b ), "Passed!" );
-});
-
-test( "equals", function() {
-	var a = new THREE.Vector4( x, 0, z, 0 );
-	var b = new THREE.Vector4( 0, -y, 0, -w );
-
-	ok( a.x != b.x, "Passed!" );
-	ok( a.y != b.y, "Passed!" );
-	ok( a.z != b.z, "Passed!" );
-	ok( a.w != b.w, "Passed!" );
-
-	ok( ! a.equals( b ), "Passed!" );
-	ok( ! b.equals( a ), "Passed!" );
-
-	a.copy( b );
-	ok( a.x == b.x, "Passed!" );
-	ok( a.y == b.y, "Passed!" );
-	ok( a.z == b.z, "Passed!" );
-	ok( a.w == b.w, "Passed!" );
-
-	ok( a.equals( b ), "Passed!" );
-	ok( b.equals( a ), "Passed!" );
-});