Explorar o código

Delete old test folder

Tristan VALCKE %!s(int64=7) %!d(string=hai) anos
pai
achega
6e18f1c83f
Modificáronse 100 ficheiros con 0 adicións e 9006 borrados
  1. 0 252
      test/Three.Unit.js
  2. 0 40
      test/benchmark/README.MD
  3. 0 79
      test/benchmark/benchmark.js
  4. 0 51
      test/benchmark/benchmarks.html
  5. 0 82
      test/benchmark/core/Float32Array.js
  6. 0 110
      test/benchmark/core/Vector3Components.js
  7. 0 59
      test/benchmark/core/Vector3Length.js
  8. 0 113
      test/benchmark/core/Vector3Storage.js
  9. 0 419
      test/benchmark/normalize.css
  10. 0 96
      test/benchmark/style.css
  11. 0 0
      test/benchmark/vendor/benchmark-2.1.0.min.js
  12. 0 121
      test/benchmark/vendor/lodash.min.js
  13. 0 128
      test/perf.html
  14. 0 40
      test/rollup.unit.config.js
  15. 0 210
      test/unit/SmartComparer.js
  16. 0 171
      test/unit/editor/CommonUtilities.js
  17. 0 56
      test/unit/editor/TestAddObjectCommandAndRemoveObjectCommand.js
  18. 0 62
      test/unit/editor/TestAddScriptCommand.js
  19. 0 55
      test/unit/editor/TestMassUndoAndRedo.js
  20. 0 42
      test/unit/editor/TestMoveObjectCommand.js
  21. 0 80
      test/unit/editor/TestMultiCmdsCommand.js
  22. 0 55
      test/unit/editor/TestNegativeCases.js
  23. 0 108
      test/unit/editor/TestNestedDoUndoRedo.js
  24. 0 64
      test/unit/editor/TestRemoveScriptCommand.js
  25. 0 358
      test/unit/editor/TestSerialization.js
  26. 0 40
      test/unit/editor/TestSetColorCommand.js
  27. 0 63
      test/unit/editor/TestSetGeometryCommand.js
  28. 0 51
      test/unit/editor/TestSetGeometryValueCommand.js
  29. 0 45
      test/unit/editor/TestSetMaterialColorCommand.js
  30. 0 66
      test/unit/editor/TestSetMaterialCommand.js
  31. 0 70
      test/unit/editor/TestSetMaterialMapCommand.js
  32. 0 63
      test/unit/editor/TestSetMaterialValueCommand.js
  33. 0 48
      test/unit/editor/TestSetPositionCommand.js
  34. 0 51
      test/unit/editor/TestSetRotationCommand.js
  35. 0 51
      test/unit/editor/TestSetScaleCommand.js
  36. 0 73
      test/unit/editor/TestSetSceneCommand.js
  37. 0 77
      test/unit/editor/TestSetScriptValueCommand.js
  38. 0 37
      test/unit/editor/TestSetUuidCommand.js
  39. 0 54
      test/unit/editor/TestSetValueCommand.js
  40. 0 334
      test/unit/qunit-utils.js
  41. 0 34
      test/unit/src/animation/AnimationAction.js
  42. 0 6
      test/unit/src/animation/AnimationClip.js
  43. 0 6
      test/unit/src/animation/AnimationMixer.js
  44. 0 107
      test/unit/src/animation/AnimationObjectGroup.js
  45. 0 6
      test/unit/src/animation/AnimationUtils.js
  46. 0 6
      test/unit/src/animation/KeyframeTrack.js
  47. 0 6
      test/unit/src/animation/KeyframeTrackConstructor.js
  48. 0 6
      test/unit/src/animation/KeyframeTrackPrototype.js
  49. 0 259
      test/unit/src/animation/PropertyBinding.js
  50. 0 6
      test/unit/src/animation/PropertyMixer.js
  51. 0 6
      test/unit/src/animation/tracks/BooleanKeyframeTrack.js
  52. 0 6
      test/unit/src/animation/tracks/ColorKeyframeTrack.js
  53. 0 6
      test/unit/src/animation/tracks/NumberKeyframeTrack.js
  54. 0 6
      test/unit/src/animation/tracks/QuaternionKeyframeTrack.js
  55. 0 6
      test/unit/src/animation/tracks/StringKeyframeTrack.js
  56. 0 6
      test/unit/src/animation/tracks/VectorKeyFrameTrack.js
  57. 0 6
      test/unit/src/audio/Audio.js
  58. 0 6
      test/unit/src/audio/AudioAnalyser.js
  59. 0 6
      test/unit/src/audio/AudioContext.js
  60. 0 6
      test/unit/src/audio/AudioListener.js
  61. 0 6
      test/unit/src/audio/PositionalAudio.js
  62. 0 25
      test/unit/src/cameras/Camera.js
  63. 0 6
      test/unit/src/cameras/CubeCamera.js
  64. 0 41
      test/unit/src/cameras/OrthographicCamera.js
  65. 0 76
      test/unit/src/cameras/PerspectiveCamera.js
  66. 0 6
      test/unit/src/cameras/StereoCamera.js
  67. 0 6
      test/unit/src/constants.js
  68. 0 239
      test/unit/src/core/BufferAttribute.js
  69. 0 837
      test/unit/src/core/BufferGeometry.js
  70. 0 38
      test/unit/src/core/Clock.js
  71. 0 224
      test/unit/src/core/DirectGeometry.js
  72. 0 76
      test/unit/src/core/EventDispatcher.js
  73. 0 58
      test/unit/src/core/Face3.js
  74. 0 360
      test/unit/src/core/Geometry.js
  75. 0 29
      test/unit/src/core/InstancedBufferAttribute.js
  76. 0 52
      test/unit/src/core/InstancedBufferGeometry.js
  77. 0 20
      test/unit/src/core/InstancedInterleavedBuffer.js
  78. 0 108
      test/unit/src/core/InterleavedBuffer.js
  79. 0 36
      test/unit/src/core/InterleavedBufferAttribute.js
  80. 0 101
      test/unit/src/core/Layers.js
  81. 0 482
      test/unit/src/core/Object3D.js
  82. 0 152
      test/unit/src/core/Raycaster.js
  83. 0 32
      test/unit/src/core/Uniform.js
  84. 0 6
      test/unit/src/extras/SceneUtils.js
  85. 0 6
      test/unit/src/extras/ShapeUtils.js
  86. 0 6
      test/unit/src/extras/core/Curve.js
  87. 0 6
      test/unit/src/extras/core/CurvePath.js
  88. 0 6
      test/unit/src/extras/core/Font.js
  89. 0 6
      test/unit/src/extras/core/Interpolations.js
  90. 0 6
      test/unit/src/extras/core/Path.js
  91. 0 6
      test/unit/src/extras/core/PathPrototype.js
  92. 0 6
      test/unit/src/extras/core/Shape.js
  93. 0 6
      test/unit/src/extras/core/ShapePath.js
  94. 0 341
      test/unit/src/extras/curves/CatmullRomCurve3.js
  95. 0 192
      test/unit/src/extras/curves/CubicBezierCurve.js
  96. 0 230
      test/unit/src/extras/curves/CubicBezierCurve3.js
  97. 0 173
      test/unit/src/extras/curves/EllipseCurve.js
  98. 0 152
      test/unit/src/extras/curves/LineCurve.js
  99. 0 181
      test/unit/src/extras/curves/LineCurve3.js
  100. 0 191
      test/unit/src/extras/curves/QuadraticBezierCurve.js

+ 0 - 252
test/Three.Unit.js

@@ -1,252 +0,0 @@
-
-//src
-import '../src/polyfills.js';
-export * from '../src/constants.js';
-export * from '../src/Three.Legacy.js';
-export * from '../src/utils.js';
-
-//src/animation
-export { AnimationAction } from '../src/animation/AnimationAction.js';
-export { AnimationClip } from '../src/animation/AnimationClip.js';
-export { AnimationMixer } from '../src/animation/AnimationMixer.js';
-export { AnimationObjectGroup } from '../src/animation/AnimationObjectGroup.js';
-export { AnimationUtils } from '../src/animation/AnimationUtils.js';
-export { KeyframeTrack } from '../src/animation/KeyframeTrack.js';
-export { KeyframeTrackConstructor } from '../src/animation/KeyframeTrackConstructor.js';
-export { KeyframeTrackPrototype } from '../src/animation/KeyframeTrackPrototype.js';
-export { PropertyBinding } from '../src/animation/PropertyBinding.js';
-export { PropertyMixer } from '../src/animation/PropertyMixer.js';
-
-//src/animation/tracks
-export { BooleanKeyframeTrack } from '../src/animation/tracks/BooleanKeyframeTrack.js';
-export { ColorKeyframeTrack } from '../src/animation/tracks/ColorKeyframeTrack.js';
-export { NumberKeyframeTrack } from '../src/animation/tracks/NumberKeyframeTrack.js';
-export { QuaternionKeyframeTrack } from '../src/animation/tracks/QuaternionKeyframeTrack.js';
-export { StringKeyframeTrack } from '../src/animation/tracks/StringKeyframeTrack.js';
-export { VectorKeyframeTrack } from '../src/animation/tracks/VectorKeyframeTrack.js';
-
-
-//src/audio
-export { Audio } from '../src/audio/Audio.js';
-export { AudioAnalyser } from '../src/audio/AudioAnalyser.js';
-export { AudioContext } from '../src/audio/AudioContext.js';
-export { AudioListener } from '../src/audio/AudioListener.js';
-export { PositionalAudio } from '../src/audio/PositionalAudio.js';
-
-
-//src/cameras
-export { ArrayCamera } from '../src/cameras/ArrayCamera.js';
-export { Camera } from '../src/cameras/Camera.js';
-export { CubeCamera } from '../src/cameras/CubeCamera.js';
-export { OrthographicCamera } from '../src/cameras/OrthographicCamera.js';
-export { PerspectiveCamera } from '../src/cameras/PerspectiveCamera.js';
-export { StereoCamera } from '../src/cameras/StereoCamera.js';
-
-
-//src/core
-export * from '../src/core/BufferAttribute.js';
-export { BufferGeometry } from '../src/core/BufferGeometry.js';
-export { Clock } from '../src/core/Clock.js';
-export { DirectGeometry } from '../src/core/DirectGeometry.js';
-export { EventDispatcher } from '../src/core/EventDispatcher.js';
-export { Face3 } from '../src/core/Face3.js';
-export { Geometry } from '../src/core/Geometry.js';
-export { InstancedBufferAttribute } from '../src/core/InstancedBufferAttribute.js';
-export { InstancedBufferGeometry } from '../src/core/InstancedBufferGeometry.js';
-export { InstancedInterleavedBuffer } from '../src/core/InstancedInterleavedBuffer.js';
-export { InterleavedBuffer } from '../src/core/InterleavedBuffer.js';
-export { InterleavedBufferAttribute } from '../src/core/InterleavedBufferAttribute.js';
-export { Layers } from '../src/core/Layers.js';
-export { Object3D } from '../src/core/Object3D.js';
-export { Raycaster } from '../src/core/Raycaster.js';
-export { Uniform } from '../src/core/Uniform.js';
-
-
-//src/extras
-export { SceneUtils } from '../src/extras/SceneUtils.js';
-export { ShapeUtils } from '../src/extras/ShapeUtils.js';
-
-//src/extras/core
-export { Curve } from '../src/extras/core/Curve.js';
-export { CurvePath } from '../src/extras/core/CurvePath.js';
-export { Font } from '../src/extras/core/Font.js';
-export * from '../src/extras/core/Interpolations.js';
-export { Path } from '../src/extras/core/Path.js';
-export { PathPrototype } from '../src/extras/core/PathPrototype.js';
-export { Shape } from '../src/extras/core/Shape.js';
-export { ShapePath } from '../src/extras/core/ShapePath.js';
-
-//src/extras/curves
-export { ArcCurve } from '../src/extras/curves/ArcCurve.js';
-export { CatmullRomCurve3 } from '../src/extras/curves/CatmullRomCurve3.js';
-export { CubicBezierCurve } from '../src/extras/curves/CubicBezierCurve.js';
-export { CubicBezierCurve3 } from '../src/extras/curves/CubicBezierCurve3.js';
-export { EllipseCurve } from '../src/extras/curves/EllipseCurve.js';
-export { LineCurve } from '../src/extras/curves/LineCurve.js';
-export { LineCurve3 } from '../src/extras/curves/LineCurve3.js';
-export { QuadraticBezierCurve } from '../src/extras/curves/QuadraticBezierCurve.js';
-export { QuadraticBezierCurve3 } from '../src/extras/curves/QuadraticBezierCurve3.js';
-export { SplineCurve } from '../src/extras/curves/SplineCurve.js';
-
-//src/extras/objects
-export { ImmediateRenderObject } from '../src/extras/objects/ImmediateRenderObject.js';
-
-
-//src/geometries
-export * from '../src/geometries/Geometries.js';
-
-
-//src/helpers
-export { ArrowHelper } from '../src/helpers/ArrowHelper.js';
-export { AxesHelper } from '../src/helpers/AxesHelper.js';
-export { BoxHelper } from '../src/helpers/BoxHelper.js';
-export { Box3Helper } from '../src/helpers/Box3Helper.js';
-export { CameraHelper } from '../src/helpers/CameraHelper.js';
-export { DirectionalLightHelper } from '../src/helpers/DirectionalLightHelper.js';
-export { FaceNormalsHelper } from '../src/helpers/FaceNormalsHelper.js';
-export { GridHelper } from '../src/helpers/GridHelper.js';
-export { HemisphereLightHelper } from '../src/helpers/HemisphereLightHelper.js';
-export { PlaneHelper } from '../src/helpers/PlaneHelper.js';
-export { PointLightHelper } from '../src/helpers/PointLightHelper.js';
-export { PolarGridHelper } from '../src/helpers/PolarGridHelper.js';
-export { RectAreaLightHelper } from '../src/helpers/RectAreaLightHelper.js';
-export { SkeletonHelper } from '../src/helpers/SkeletonHelper.js';
-export { SpotLightHelper } from '../src/helpers/SpotLightHelper.js';
-export { VertexNormalsHelper } from '../src/helpers/VertexNormalsHelper.js';
-
-
-//src/lights
-export { AmbientLight } from '../src/lights/AmbientLight.js';
-export { DirectionalLight } from '../src/lights/DirectionalLight.js';
-export { DirectionalLightShadow } from '../src/lights/DirectionalLightShadow.js';
-export { HemisphereLight } from '../src/lights/HemisphereLight.js';
-export { Light } from '../src/lights/Light.js';
-export { LightShadow } from '../src/lights/LightShadow.js';
-export { PointLight } from '../src/lights/PointLight.js';
-export { RectAreaLight } from '../src/lights/RectAreaLight.js';
-export { SpotLight } from '../src/lights/SpotLight.js';
-export { SpotLightShadow } from '../src/lights/SpotLightShadow.js';
-
-
-//src/loaders
-export { AnimationLoader } from '../src/loaders/AnimationLoader.js';
-export { AudioLoader } from '../src/loaders/AudioLoader.js';
-export { BufferGeometryLoader } from '../src/loaders/BufferGeometryLoader.js';
-export { Cache } from '../src/loaders/Cache.js';
-export { CompressedTextureLoader } from '../src/loaders/CompressedTextureLoader.js';
-export { CubeTextureLoader } from '../src/loaders/CubeTextureLoader.js';
-export { DataTextureLoader } from '../src/loaders/DataTextureLoader.js';
-export { DefaultLoadingManager, LoadingManager } from '../src/loaders/LoadingManager.js';
-export { FileLoader } from '../src/loaders/FileLoader.js';
-export { FontLoader } from '../src/loaders/FontLoader.js';
-export { ImageLoader } from '../src/loaders/ImageLoader.js';
-export { JSONLoader } from '../src/loaders/JSONLoader.js';
-export { Loader } from '../src/loaders/Loader.js';
-export { MaterialLoader } from '../src/loaders/MaterialLoader.js';
-export { ObjectLoader } from '../src/loaders/ObjectLoader.js';
-export { TextureLoader } from '../src/loaders/TextureLoader.js';
-
-
-//src/materials
-export * from '../src/materials/Materials.js';
-
-
-//src/math
-export { _Math as Math } from '../src/math/Math.js';
-export { Box2 } from '../src/math/Box2.js';
-export { Box3 } from '../src/math/Box3.js';
-export { Color } from '../src/math/Color.js';
-export { Cylindrical } from '../src/math/Cylindrical.js';
-export { Euler } from '../src/math/Euler.js';
-export { Frustum } from '../src/math/Frustum.js';
-export { Interpolant } from '../src/math/Interpolant.js';
-export { Line3 } from '../src/math/Line3.js';
-export { Matrix3 } from '../src/math/Matrix3.js';
-export { Matrix4 } from '../src/math/Matrix4.js';
-export { Plane } from '../src/math/Plane.js';
-export { Quaternion } from '../src/math/Quaternion.js';
-export { Ray } from '../src/math/Ray.js';
-export { Sphere } from '../src/math/Sphere.js';
-export { Spherical } from '../src/math/Spherical.js';
-export { Triangle } from '../src/math/Triangle.js';
-export { Vector2 } from '../src/math/Vector2.js';
-export { Vector3 } from '../src/math/Vector3.js';
-export { Vector4 } from '../src/math/Vector4.js';
-
-//src/math/interpolants
-export { CubicInterpolant } from '../src/math/interpolants/CubicInterpolant.js';
-export { DiscreteInterpolant } from '../src/math/interpolants/DiscreteInterpolant.js';
-export { LinearInterpolant } from '../src/math/interpolants/LinearInterpolant.js';
-export { QuaternionLinearInterpolant } from '../src/math/interpolants/QuaternionLinearInterpolant.js';
-
-
-//src/objects
-export { Bone } from '../src/objects/Bone.js';
-export { Group } from '../src/objects/Group.js';
-export { LensFlare } from '../src/objects/LensFlare.js';
-export { Line } from '../src/objects/Line.js';
-export { LineLoop } from '../src/objects/LineLoop.js';
-export { LineSegments } from '../src/objects/LineSegments.js';
-export { LOD } from '../src/objects/LOD.js';
-export { Mesh } from '../src/objects/Mesh.js';
-export { Points } from '../src/objects/Points.js';
-export { Skeleton } from '../src/objects/Skeleton.js';
-export { SkinnedMesh } from '../src/objects/SkinnedMesh.js';
-export { Sprite } from '../src/objects/Sprite.js';
-
-
-//src/renderers
-export { WebGL2Renderer } from '../src/renderers/WebGL2Renderer.js';
-export { WebGLRenderer } from '../src/renderers/WebGLRenderer.js';
-export { WebGLRenderTarget } from '../src/renderers/WebGLRenderTarget.js';
-export { WebGLRenderTargetCube } from '../src/renderers/WebGLRenderTargetCube.js';
-
-//src/renderers/shaders
-export { ShaderChunk } from '../src/renderers/shaders/ShaderChunk.js';
-export { ShaderLib } from '../src/renderers/shaders/ShaderLib.js';
-export { UniformsLib } from '../src/renderers/shaders/UniformsLib.js';
-export { UniformsUtils } from '../src/renderers/shaders/UniformsUtils.js';
-
-//src/renderers/webgl
-export { WebGLAttributes } from '../src/renderers/webgl/WebGLAttributes.js';
-export { WebGLBackground } from '../src/renderers/webgl/WebGLBackground.js';
-export { WebGLBufferRenderer } from '../src/renderers/webgl/WebGLBufferRenderer.js';
-export { WebGLCapabilities } from '../src/renderers/webgl/WebGLCapabilities.js';
-export { WebGLClipping } from '../src/renderers/webgl/WebGLClipping.js';
-export { WebGLExtensions } from '../src/renderers/webgl/WebGLExtensions.js';
-export { WebGLFlareRenderer } from '../src/renderers/webgl/WebGLFlareRenderer.js';
-export { WebGLGeometries } from '../src/renderers/webgl/WebGLGeometries.js';
-export { WebGLIndexedBufferRenderer } from '../src/renderers/webgl/WebGLIndexedBufferRenderer.js';
-export { WebGLLights } from '../src/renderers/webgl/WebGLLights.js';
-export { WebGLMorphtargets } from '../src/renderers/webgl/WebGLMorphtargets.js';
-export { WebGLObjects } from '../src/renderers/webgl/WebGLObjects.js';
-export { WebGLProgram } from '../src/renderers/webgl/WebGLProgram.js';
-export { WebGLPrograms } from '../src/renderers/webgl/WebGLPrograms.js';
-export { WebGLProperties } from '../src/renderers/webgl/WebGLProperties.js';
-export { WebGLRenderLists } from '../src/renderers/webgl/WebGLRenderLists.js';
-export { WebGLShader } from '../src/renderers/webgl/WebGLShader.js';
-export { WebGLShadowMap } from '../src/renderers/webgl/WebGLShadowMap.js';
-export { WebGLSpriteRenderer } from '../src/renderers/webgl/WebGLSpriteRenderer.js';
-export { WebGLState } from '../src/renderers/webgl/WebGLState.js';
-export { WebGLTextures } from '../src/renderers/webgl/WebGLTextures.js';
-export { WebGLUniforms } from '../src/renderers/webgl/WebGLUniforms.js';
-export { WebGLUtils } from '../src/renderers/webgl/WebGLUtils.js';
-
-//src/renderers/webvr
-export { WebVRManager } from '../src/renderers/webvr/WebVRManager.js';
-
-
-//src/scenes
-export { Fog } from '../src/scenes/Fog.js';
-export { FogExp2 } from '../src/scenes/FogExp2.js';
-export { Scene } from '../src/scenes/Scene.js';
-
-
-//src/textures
-export { CanvasTexture } from '../src/textures/CanvasTexture.js';
-export { CompressedTexture } from '../src/textures/CompressedTexture.js';
-export { CubeTexture } from '../src/textures/CubeTexture.js';
-export { DataTexture } from '../src/textures/DataTexture.js';
-export { DepthTexture } from '../src/textures/DepthTexture.js';
-export { Texture } from '../src/textures/Texture.js';
-export { VideoTexture } from '../src/textures/VideoTexture.js';

+ 0 - 40
test/benchmark/README.MD

@@ -1,40 +0,0 @@
-# THREEJS Benchmark Suite
-
-### Example: Adding a New Suite
-
-For adding a new Tests we need two things
- - Adding the Test File
- - Linking it on the benchmark.html page
-
-Some example could be like this
-```javascript
-(function() {
-  // We want to make sure THREE.JS is loaded for this Benchmark
-  var THREE
-  if (Bench.isTHREELoaded()) {
-    THREE = Bench.THREE;
-  } else {
-    Bench.warning("Test Example Benchmark not loaded because THREEJS was not loaded");
-    return;
-  }
-
-  var s = Bench.newSuite("Example Benchmark Distance Calculation");
-
-  var v2a = new THREE.Vector2(3.0, 3.0);
-  var v2b = new THREE.Vector2(9.0, -3.0);
-
-  var v3a = new THREE.Vector3(3.0, 3.0, 0.0);
-  var v3b = new THREE.Vector3(9.0, -3.0, 0.0);
-
-  s.add("Vector3", function() {
-    v3a.distanceTo(v3b);
-  })
-
-  s.add("Vector2", function() {
-    v2a.distanceTo(v2b);
-
-  })
-})();
-```
-
-Remember that THREEJS library is only accesible via `Bench.THREE`

+ 0 - 79
test/benchmark/benchmark.js

@@ -1,79 +0,0 @@
-var BenchClass = function() {
-  this.suites = [];
-  this.THREE = window.THREE ;
-  window.THREE = undefined;
-  Benchmark.options.maxTime = 1.0;
-  return this;
-}
-
-BenchClass.prototype.isTHREELoaded = function() {
-  return _.isObject(this.THREE);
-}
-
-BenchClass.prototype.newSuite = function(name) {
-  var s = new Benchmark.Suite(name);
-  this.suites.push(s);
-  return s;
-}
-
-BenchClass.prototype.display = function() {
-  for (x of this.suites) {
-    var s = new SuiteUI(x);
-    s.render();
-  }
-}
-
-BenchClass.prototype.warning = function(message) {
-  console.error(message);
-}
-
-var SuiteUI = function(suite) {
-  this.suite = suite;
-  this.isRunning = false;
-  return this;
-}
-
-SuiteUI.prototype.render = function() {
-  var n = document.importNode(this.suiteTemplate, true);
-  this.elem = n.querySelector("article");
-  this.results = n.querySelector(".results");
-  this.title = n.querySelector("h2");
-  this.runButton = n.querySelector("h3");
-
-  this.title.innerText = this.suite.name;
-  this.runButton.onclick = this.run.bind(this);
-
-  this.section.appendChild(n);
-}
-
-SuiteUI.prototype.run = function() {
-  this.runButton.click = _.noop;
-  this.runButton.innerText = "Running..."
-  this.suite.on("complete", this.complete.bind(this));
-  this.suite.run({
-    async: true
-  });
-}
-
-SuiteUI.prototype.complete = function() {
-  this.runButton.style.display = "none";
-  this.results.style.display = "block";
-  var f = _.orderBy(this.suite, ["hz"], ["desc"]);
-  for (var i = 0; i < f.length; i++) {
-    var x = f[i];
-    var n = document.importNode(this.suiteTestTemplate, true);
-    n.querySelector(".name").innerText = x.name;
-    n.querySelector(".ops").innerText = x.hz.toFixed();
-    n.querySelector(".desv").innerText = x.stats.rme.toFixed(2);
-    this.results.appendChild(n);
-  }
-}
-
-var Bench = new BenchClass();
-window.addEventListener('load', function() {
-  SuiteUI.prototype.suiteTemplate = document.querySelector("#suite").content;
-  SuiteUI.prototype.suiteTestTemplate = document.querySelector("#suite-test").content;
-  SuiteUI.prototype.section = document.querySelector("section");
-
-  Bench.display();
-})

+ 0 - 51
test/benchmark/benchmarks.html

@@ -1,51 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>ThreeJS Benchmark Tests - Using Files in /src</title>
-  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:700" rel="stylesheet" type="text/css">
-  <link href="normalize.css" rel="stylesheet" type="text/css">
-  <link href="style.css" rel="stylesheet" type="text/css">
-  <script src="../../build/three.min.js"></script>
-  <script src="vendor/lodash.min.js"></script>
-  <script src="vendor/benchmark-2.1.0.min.js"></script>
-  <script src="benchmark.js"></script>
-
-  <script src="core/Vector3Components.js"></script>
-  <script src="core/Vector3Storage.js"></script>
-  <script src="core/Vector3Length.js"></script>
-  <script src="core/Float32Array.js"></script>
-</head>
-<body>
-  <header>
-    <h1>Three JS Benchmarks Suite</h1>
-  </header>
-  <section>
-  </section>
-
-  <template id="suite">
-    <article>
-      <header>
-        <h2></h2>
-        <h3>Start</h3>
-      </header>
-      <div class="results">
-        <div class"head">
-          <p class="name">Name</p>
-          <p class="ops">Ops / Sec</p>
-          <p class="desv">±</p>
-        </div>
-      </div>
-    </article>
-  </template>
-
-  <template id="suite-test">
-    <div>
-      <p class="name"></p>
-      <p class="ops"></p>
-      <p class="desv"></p>
-    </div>
-  </template>
-
-</body>
-</html>

+ 0 - 82
test/benchmark/core/Float32Array.js

@@ -1,82 +0,0 @@
-(function() {
-
-  var input = new Float32Array(10000 * 3);
-  var output = new Float32Array(10000 * 3);
-
-  for (var j = 0, jl = input.length; j < jl; j++) {
-    input[j] = j;
-  }
-
-  var inputVectors = [];
-  var outputVectors = [];
-
-  for (var j = 0, jl = input.length / 3; j < jl; j++) {
-    inputVectors.push(new THREE.Vector3(j * 3, j * 3 + 1, j * 3 + 2));
-    outputVectors.push(new THREE.Vector3());
-  }
-
-  var s = Bench.newSuite("Float 32 Arrays");
-
-  s.add('Float32Array-Float32Array', function() {
-    var value3 = new Float32Array(3);
-    for (var i = 0, il = input.length / 3; i < il; i += 3) {
-      value3[0] = input[i + 0];
-      value3[1] = input[i + 1];
-      value3[2] = input[i + 2];
-      value3[0] *= 1.01;
-      value3[1] *= 1.03;
-      value3[2] *= 0.98;
-      output[i + 0] = value3[0];
-      output[i + 1] = value3[1];
-      output[i + 2] = value3[2];
-    }
-  });
-
-  s.add('Float32Array-Array', function() {
-    var value2 = [0, 0, 0];
-    for (var i = 0, il = input.length / 3; i < il; i += 3) {
-      value2[0] = input[i + 0];
-      value2[1] = input[i + 1];
-      value2[2] = input[i + 2];
-      value2[0] *= 1.01;
-      value2[1] *= 1.03;
-      value2[2] *= 0.98;
-      output[i + 0] = value2[0];
-      output[i + 1] = value2[1];
-      output[i + 2] = value2[2];
-    }
-  });
-
-  s.add('Float32Array-Literal', function() {
-    var x,
-      y,
-      z;
-    for (var i = 0, il = input.length / 3; i < il; i += 3) {
-      x = input[i + 0];
-      y = input[i + 1];
-      z = input[i + 2];
-      x *= 1.01;
-      y *= 1.03;
-      z *= 0.98;
-      output[i + 0] = x;
-      output[i + 1] = y;
-      output[i + 2] = z;
-    }
-  });
-
-  s.add('Float32Array-Vector3', function() {
-    var value = new THREE.Vector3();
-    for (var i = 0, il = input.length / 3; i < il; i += 3) {
-      value.x = input[i + 0];
-      value.y = input[i + 1];
-      value.z = input[i + 2];
-      value.x *= 1.01;
-      value.y *= 1.03;
-      value.z *= 0.98;
-      output[i + 0] = value.x;
-      output[i + 1] = value.y;
-      output[i + 2] = value.z;
-    }
-  });
-
-})();

+ 0 - 110
test/benchmark/core/Vector3Components.js

@@ -1,110 +0,0 @@
-(function() {
-
-  var s = Bench.newSuite("Vector 3 Components");
-
-  THREE = {};
-
-  THREE.Vector3 = function(x, y, z) {
-    this.x = x || 0;
-    this.y = y || 0;
-    this.z = z || 0;
-  };
-
-  THREE.Vector3.prototype = {
-    constructor: THREE.Vector3,
-    setComponent: function(index, value) {
-      this[THREE.Vector3.__indexToName[index]] = value;
-    },
-
-    getComponent: function(index) {
-      return this[THREE.Vector3.__indexToName[index]];
-    },
-
-    setComponent2: function(index, value) {
-      switch (index) {
-        case 0:
-          this.x = value;
-          break;
-        case 1:
-          this.y = value;
-          break;
-        case 2:
-          this.z = value;
-          break;
-        default:
-          throw new Error("index is out of range: " + index);
-      }
-    },
-
-    getComponent2: function(index) {
-      switch (index) {
-        case 0:
-          return this.x;
-        case 1:
-          return this.y;
-        case 2:
-          return this.z;
-        default:
-          throw new Error("index is out of range: " + index);
-      }
-    },
-
-
-    getComponent3: function(index) {
-      if (index === 0) return this.x;
-      if (index === 1) return this.y;
-      if (index === 2) return this.z;
-      throw new Error("index is out of range: " + index);
-    },
-
-    getComponent4: function(index) {
-      if (index === 0) return this.x;else if (index === 1) return this.y;else if (index === 2) return this.z;
-      else
-        throw new Error("index is out of range: " + index);
-    }
-  };
-
-
-  THREE.Vector3.__indexToName = {
-    0: 'x',
-    1: 'y',
-    2: 'z'
-  };
-
-  var a = [];
-  for (var i = 0; i < 100000; i++) {
-    a[i] = new THREE.Vector3(i * 0.01, i * 2, i * -1.3);
-  }
-
-
-
-
-  s.add('IndexToName', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      result += a[i].getComponent(i % 3);
-    }
-  });
-
-  s.add('SwitchStatement', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      result += a[i].getComponent2(i % 3);
-    }
-  });
-
-  s.add('IfAndReturnSeries', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      result += a[i].getComponent3(i % 3);
-    }
-  });
-
-  s.add('IfReturnElseSeries', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      result += a[i].getComponent4(i % 3);
-    }
-  });
-
-})();

+ 0 - 59
test/benchmark/core/Vector3Length.js

@@ -1,59 +0,0 @@
-(function() {
-
-  var THREE = {};
-
-  THREE.Vector3 = function(x, y, z) {
-
-    this.x = x || 0;
-    this.y = y || 0;
-    this.z = z || 0;
-
-  };
-
-  THREE.Vector3.prototype = {
-    constructor: THREE.Vector3,
-    lengthSq: function() {
-      return this.x * this.x + this.y * this.y + this.z * this.z;
-    },
-
-    length: function() {
-      return Math.sqrt(this.lengthSq());
-    },
-
-    length2: function() {
-      return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
-    }
-
-  };
-
-  var a = [];
-  for (var i = 0; i < 100000; i++) {
-    a[i] = new THREE.Vector3(i * 0.01, i * 2, i * -1.3);
-  }
-
-
-  var suite = Bench.newSuite("Vector 3 Length");
-
-  suite.add('NoCallTest', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      var v = a[i];
-      result += Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
-    }
-  });
-
-  suite.add('InlineCallTest', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      result += a[i].length2();
-    }
-  });
-
-  suite.add('FunctionCallTest', function() {
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      result += a[i].length();
-    }
-  });
-
-})();

+ 0 - 113
test/benchmark/core/Vector3Storage.js

@@ -1,113 +0,0 @@
-(function() {
-
-  THREE = {};
-
-  THREE.Vector3 = function(x, y, z) {
-
-    this.x = x || 0;
-    this.y = y || 0;
-    this.z = z || 0;
-
-  };
-
-  THREE.Vector3.prototype = {
-
-    constructor: THREE.Vector3,
-
-    length: function() {
-
-      return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
-
-    }
-
-  };
-
-  THREE.Vector3X = function(x, y, z) {
-
-    var elements = this.elements = new Float32Array(3);
-    elements[0] = x || 0;
-    elements[1] = y || 1;
-    elements[2] = z || 2;
-
-  };
-
-  THREE.Vector3X.prototype = {
-
-    constructor: THREE.Vector3X,
-
-    length: function() {
-
-      return Math.sqrt(this.elements[0] * this.elements[0] + this.elements[1] * this.elements[1] + this.elements[2] * this.elements[2]);
-
-    }
-
-  };
-
-
-  THREE.Vector3Y = function(x, y, z) {
-
-    this.elements = [x || 0, y || 1, z || 2];
-
-  };
-
-  THREE.Vector3Y.prototype = {
-
-    constructor: THREE.Vector3Y,
-
-    length: function() {
-
-      return Math.sqrt(this.elements[0] * this.elements[0] + this.elements[1] * this.elements[1] + this.elements[2] * this.elements[2]);
-
-    }
-
-  };
-
-
-  var suite = Bench.newSuite("Vector 3 Storage");
-
-  suite.add('Vector3-Set', function() {
-
-    var array = [];
-    for (var i = 0; i < 100000; i++) {
-      var v = new THREE.Vector3(i, i, i);
-      array.push(v);
-    }
-
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      var v = array[i];
-      result += v.length();
-    }
-  });
-
-  suite.add('Vector3-Float32Array', function() {
-
-    var array = [];
-    for (var i = 0; i < 100000; i++) {
-      var v = new THREE.Vector3X(i, i, i);
-      array.push(v);
-    }
-
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      var v = array[i];
-      result += v.length();
-    }
-  });
-
-  suite.add('Vector3-Array', function() {
-
-    var array = [];
-    for (var i = 0; i < 100000; i++) {
-      var v = new THREE.Vector3Y(i, i, i);
-      array.push(v);
-    }
-
-    var result = 0;
-    for (var i = 0; i < 100000; i++) {
-      var v = array[i];
-      result += v.length();
-    }
-  });
-
-})();

+ 0 - 419
test/benchmark/normalize.css

@@ -1,419 +0,0 @@
-/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
-
-/**
- * 1. Change the default font family in all browsers (opinionated).
- * 2. Prevent adjustments of font size after orientation changes in IE and iOS.
- */
-
-html {
-  font-family: sans-serif; /* 1 */
-  -ms-text-size-adjust: 100%; /* 2 */
-  -webkit-text-size-adjust: 100%; /* 2 */
-}
-
-/**
- * Remove the margin in all browsers (opinionated).
- */
-
-body {
-  margin: 0;
-}
-
-/* HTML5 display definitions
-   ========================================================================== */
-
-/**
- * Add the correct display in IE 9-.
- * 1. Add the correct display in Edge, IE, and Firefox.
- * 2. Add the correct display in IE.
- */
-
-article,
-aside,
-details, /* 1 */
-figcaption,
-figure,
-footer,
-header,
-main, /* 2 */
-menu,
-nav,
-section,
-summary { /* 1 */
-  display: block;
-}
-
-/**
- * Add the correct display in IE 9-.
- */
-
-audio,
-canvas,
-progress,
-video {
-  display: inline-block;
-}
-
-/**
- * Add the correct display in iOS 4-7.
- */
-
-audio:not([controls]) {
-  display: none;
-  height: 0;
-}
-
-/**
- * Add the correct vertical alignment in Chrome, Firefox, and Opera.
- */
-
-progress {
-  vertical-align: baseline;
-}
-
-/**
- * Add the correct display in IE 10-.
- * 1. Add the correct display in IE.
- */
-
-template, /* 1 */
-[hidden] {
-  display: none;
-}
-
-/* Links
-   ========================================================================== */
-
-/**
- * 1. Remove the gray background on active links in IE 10.
- * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
- */
-
-a {
-  background-color: transparent; /* 1 */
-  -webkit-text-decoration-skip: objects; /* 2 */
-}
-
-/**
- * Remove the outline on focused links when they are also active or hovered
- * in all browsers (opinionated).
- */
-
-a:active,
-a:hover {
-  outline-width: 0;
-}
-
-/* Text-level semantics
-   ========================================================================== */
-
-/**
- * 1. Remove the bottom border in Firefox 39-.
- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
- */
-
-abbr[title] {
-  border-bottom: none; /* 1 */
-  text-decoration: underline; /* 2 */
-  text-decoration: underline dotted; /* 2 */
-}
-
-/**
- * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
- */
-
-b,
-strong {
-  font-weight: inherit;
-}
-
-/**
- * Add the correct font weight in Chrome, Edge, and Safari.
- */
-
-b,
-strong {
-  font-weight: bolder;
-}
-
-/**
- * Add the correct font style in Android 4.3-.
- */
-
-dfn {
-  font-style: italic;
-}
-
-/**
- * Correct the font size and margin on `h1` elements within `section` and
- * `article` contexts in Chrome, Firefox, and Safari.
- */
-
-h1 {
-  font-size: 2em;
-  margin: 0.67em 0;
-}
-
-/**
- * Add the correct background and color in IE 9-.
- */
-
-mark {
-  background-color: #ff0;
-  color: #000;
-}
-
-/**
- * Add the correct font size in all browsers.
- */
-
-small {
-  font-size: 80%;
-}
-
-/**
- * Prevent `sub` and `sup` elements from affecting the line height in
- * all browsers.
- */
-
-sub,
-sup {
-  font-size: 75%;
-  line-height: 0;
-  position: relative;
-  vertical-align: baseline;
-}
-
-sub {
-  bottom: -0.25em;
-}
-
-sup {
-  top: -0.5em;
-}
-
-/* Embedded content
-   ========================================================================== */
-
-/**
- * Remove the border on images inside links in IE 10-.
- */
-
-img {
-  border-style: none;
-}
-
-/**
- * Hide the overflow in IE.
- */
-
-svg:not(:root) {
-  overflow: hidden;
-}
-
-/* Grouping content
-   ========================================================================== */
-
-/**
- * 1. Correct the inheritance and scaling of font size in all browsers.
- * 2. Correct the odd `em` font sizing in all browsers.
- */
-
-code,
-kbd,
-pre,
-samp {
-  font-family: monospace, monospace; /* 1 */
-  font-size: 1em; /* 2 */
-}
-
-/**
- * Add the correct margin in IE 8.
- */
-
-figure {
-  margin: 1em 40px;
-}
-
-/**
- * 1. Add the correct box sizing in Firefox.
- * 2. Show the overflow in Edge and IE.
- */
-
-hr {
-  box-sizing: content-box; /* 1 */
-  height: 0; /* 1 */
-  overflow: visible; /* 2 */
-}
-
-/* Forms
-   ========================================================================== */
-
-/**
- * 1. Change font properties to `inherit` in all browsers (opinionated).
- * 2. Remove the margin in Firefox and Safari.
- */
-
-button,
-input,
-select,
-textarea {
-  font: inherit; /* 1 */
-  margin: 0; /* 2 */
-}
-
-/**
- * Restore the font weight unset by the previous rule.
- */
-
-optgroup {
-  font-weight: bold;
-}
-
-/**
- * Show the overflow in IE.
- * 1. Show the overflow in Edge.
- */
-
-button,
-input { /* 1 */
-  overflow: visible;
-}
-
-/**
- * Remove the inheritance of text transform in Edge, Firefox, and IE.
- * 1. Remove the inheritance of text transform in Firefox.
- */
-
-button,
-select { /* 1 */
-  text-transform: none;
-}
-
-/**
- * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
- *    controls in Android 4.
- * 2. Correct the inability to style clickable types in iOS and Safari.
- */
-
-button,
-html [type="button"], /* 1 */
-[type="reset"],
-[type="submit"] {
-  -webkit-appearance: button; /* 2 */
-}
-
-/**
- * Remove the inner border and padding in Firefox.
- */
-
-button::-moz-focus-inner,
-[type="button"]::-moz-focus-inner,
-[type="reset"]::-moz-focus-inner,
-[type="submit"]::-moz-focus-inner {
-  border-style: none;
-  padding: 0;
-}
-
-/**
- * Restore the focus styles unset by the previous rule.
- */
-
-button:-moz-focusring,
-[type="button"]:-moz-focusring,
-[type="reset"]:-moz-focusring,
-[type="submit"]:-moz-focusring {
-  outline: 1px dotted ButtonText;
-}
-
-/**
- * Change the border, margin, and padding in all browsers (opinionated).
- */
-
-fieldset {
-  border: 1px solid #c0c0c0;
-  margin: 0 2px;
-  padding: 0.35em 0.625em 0.75em;
-}
-
-/**
- * 1. Correct the text wrapping in Edge and IE.
- * 2. Correct the color inheritance from `fieldset` elements in IE.
- * 3. Remove the padding so developers are not caught out when they zero out
- *    `fieldset` elements in all browsers.
- */
-
-legend {
-  box-sizing: border-box; /* 1 */
-  color: inherit; /* 2 */
-  display: table; /* 1 */
-  max-width: 100%; /* 1 */
-  padding: 0; /* 3 */
-  white-space: normal; /* 1 */
-}
-
-/**
- * Remove the default vertical scrollbar in IE.
- */
-
-textarea {
-  overflow: auto;
-}
-
-/**
- * 1. Add the correct box sizing in IE 10-.
- * 2. Remove the padding in IE 10-.
- */
-
-[type="checkbox"],
-[type="radio"] {
-  box-sizing: border-box; /* 1 */
-  padding: 0; /* 2 */
-}
-
-/**
- * Correct the cursor style of increment and decrement buttons in Chrome.
- */
-
-[type="number"]::-webkit-inner-spin-button,
-[type="number"]::-webkit-outer-spin-button {
-  height: auto;
-}
-
-/**
- * 1. Correct the odd appearance in Chrome and Safari.
- * 2. Correct the outline style in Safari.
- */
-
-[type="search"] {
-  -webkit-appearance: textfield; /* 1 */
-  outline-offset: -2px; /* 2 */
-}
-
-/**
- * Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
- */
-
-[type="search"]::-webkit-search-cancel-button,
-[type="search"]::-webkit-search-decoration {
-  -webkit-appearance: none;
-}
-
-/**
- * Correct the text style of placeholders in Chrome, Edge, and Safari.
- */
-
-::-webkit-input-placeholder {
-  color: inherit;
-  opacity: 0.54;
-}
-
-/**
- * 1. Correct the inability to style clickable types in iOS and Safari.
- * 2. Change font properties to `inherit` in Safari.
- */
-
-::-webkit-file-upload-button {
-  -webkit-appearance: button; /* 1 */
-  font: inherit; /* 2 */
-}

+ 0 - 96
test/benchmark/style.css

@@ -1,96 +0,0 @@
-html{
-        background-color: #FFE0F7;
-}
-
-body{
-    font-family: 'Source Sans Pro', sans-serif;
-}
-
-header{
-
-}
-header h1{
-    color: #6F0752;
-    border-bottom: 4px solid #A23183;
-    margin: 10px;
-}
-
-article{
-    border: 2px solid #B8509B;
-    margin:5px 10px;
-    border-radius:10px;
-}
-
-article header{
-
-    display: flex;
-}
-
-article h2{
-    color:#6F0752;
-    font-size:1.2em;
-    margin:10px;
-    flex-grow:1;
-}
-
-article h3{
-    color:#6F0752;
-    font-size:1.0em;
-    margin:7px;
-    text-align:right;
-    flex-grow:0;
-    background:transparent;
-    border: 1px solid  #B8509B;
-    border-radius:3px;
-    padding:3px 7px;
-    cursor:pointer;
-}
-
-article h3:hover{
-    color:#6F0752;
-    font-size:1.0em;
-    margin:7px;
-    text-align:right;
-    flex-grow:0;
-    background:transparent;
-    border: 1px solid  #B8509B;
-    border-radius:3px;
-    padding:3px 7px;
-}
-
-article .results{
-    margin:0 10px 10px;
-    display:none;
-}
-article .results > div{
-    display: flex;
-}
-article .results > div p{
-    color:#6F0752;
-    flex-grow: 1;
-    margin: 0 3px;
-    font-size:0.8em;
-}
-
-.results > div:nth-child(1){
-    margin-bottom: 3px;
-    border-bottom: 1px solid #A23183;
-}
-
-.results > div:nth-child(2){
-    background: #6F0752;
-}
-
-.results > div:nth-child(2) p{
-    color: #FFE0F7;
-}
-
-.results .name{
-    flex-basis:60%;
-}
-.results .time{
-    flex-basis:20%;
-}
-.results .desv{
-    flex-basis:20%;
-}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
test/benchmark/vendor/benchmark-2.1.0.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 121
test/benchmark/vendor/lodash.min.js


+ 0 - 128
test/perf.html

@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<body>
-
-		<script src="../build/three.min.js"></script>
-		<script src="../examples/js/math/TypeArrayVector3.js"></script>
-
-		<script>
-
-			var Benchmark = function ( title, test ) {
-
-				var titleDom = document.createElement( 'div' );
-				titleDom.style.fontWeight = 'bold';
-				titleDom.textContent = title;
-				document.body.appendChild( titleDom );
-
-				var msDom = document.createElement( 'div' );
-				document.body.appendChild( msDom );
-
-				this.run = function () {
-
-					var start = performance.now();
-
-					test();
-
-					msDom.textContent = performance.now() - start;
-
-				}
-
-			};
-
-
-			var vector11 = new THREE.Vector3( 1.2, 2.3, 3.4 );
-			var vector12 = new THREE.Vector3( 1.2, 2.3, 3.4 );
-			var vector13 = new THREE.Vector3( 1.2, 2.3, 3.4 );
-
-			var vector21 = new THREE.TypeArrayVector3( 1.2, 2.3, 3.4 );
-			var vector22 = new THREE.TypeArrayVector3( 1.2, 2.3, 3.4 );
-			var vector23 = new THREE.TypeArrayVector3( 1.2, 2.3, 3.4 );
-
-			var benchmarks = [
-
-				new Benchmark( 'new Vector3()', function () {
-
-					for ( var i = 0; i < 10000; i ++ ) {
-
-						var vector = new THREE.Vector3( 1, 1, 1 );
-
-					}
-
-				} ),
-
-				new Benchmark( 'new TypeArrayVector3()', function () {
-
-					for ( var i = 0; i < 10000; i ++ ) {
-
-						var vector = new THREE.TypeArrayVector3( 1, 1, 1 );
-
-					}
-
-				} ),
-
-				new Benchmark( 'Vector3 add()', function () {
-
-					for ( var i = 0; i < 10000000; i ++ ) {
-
-						vector11.add( vector12 );
-
-					}
-
-				} ),
-
-				new Benchmark( 'TypeArrayVector3 add()', function () {
-
-					for ( var i = 0; i < 10000000; i ++ ) {
-
-						vector21.add( vector22 );
-
-					}
-
-				} ),
-
-				new Benchmark( 'Vector3 addVectors()', function () {
-
-					for ( var i = 0; i < 10000000; i ++ ) {
-
-						vector11.addVectors( vector12, vector13 );
-
-					}
-
-				} ),
-
-				new Benchmark( 'TypeArrayVector3 addVectors()', function () {
-
-					for ( var i = 0; i < 10000000; i ++ ) {
-
-						vector21.addVectors( vector22, vector23 );
-
-					}
-
-				} )
-
-			];
-
-			function update () {
-
-				vector11 = new THREE.Vector3( Math.random(), Math.random(), Math.random() );
-				vector12 = new THREE.Vector3( Math.random(), Math.random(), Math.random() );
-
-				vector21 = new THREE.TypeArrayVector3().set( vector11.x, vector11.y, vector11.z );
-				vector22 = new THREE.TypeArrayVector3().set( vector12.x, vector12.y, vector12.z );
-
-				for ( var i = 0, l = benchmarks.length; i < l; i ++ ) {
-
-					benchmarks[ i ].run();
-
-				}
-
-				setTimeout( update, 2000 );
-
-			}
-
-			update();
-
-		</script>
-
-	</body>
-</html>

+ 0 - 40
test/rollup.unit.config.js

@@ -1,40 +0,0 @@
-function glsl() {
-
-	return {
-
-		transform( code, id ) {
-
-			if ( /\.glsl$/.test( id ) === false ) return;
-
-			var transformedCode = 'export default ' + JSON.stringify(
-				code
-					.replace( /[ \t]*\/\/.*\n/g, '' )
-					.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' )
-					.replace( /\n{2,}/g, '\n' )
-			) + ';';
-			return {
-				code: transformedCode,
-				map: { mappings: '' }
-			};
-
-		}
-
-	};
-
-}
-
-export default {
-	entry: 'test/Three.Unit.js',
-	indent: '\t',
-	plugins: [
-		glsl()
-	],
-	// sourceMap: true,
-	targets: [
-		{
-			format: 'umd',
-			moduleName: 'THREE',
-			dest: 'test/unit/three.unit.js'
-		}
-	]
-};

+ 0 - 210
test/unit/SmartComparer.js

@@ -1,210 +0,0 @@
-// Smart comparison of three.js objects.
-// Identifies significant differences between two objects.
-// Performs deep comparison.
-// Comparison stops after the first difference is found.
-// Provides an explanation for the failure.
-function SmartComparer() {
-	'use strict';
-
-	// Diagnostic message, when comparison fails.
-	var message;
-
-	return {
-
-		areEqual: areEqual,
-
-		getDiagnostic: function() {
-
-			return message;
-
-		}
-
-	};
-
-
-	// val1 - first value to compare (typically the actual value)
-	// val2 - other value to compare (typically the expected value)
-	function areEqual( val1, val2 ) {
-
-		// Values are strictly equal.
-		if ( val1 === val2 ) return true;
-
-		// Null or undefined values.
-		/* jshint eqnull:true */
-		if ( val1 == null || val2 == null ) {
-
-			if ( val1 != val2 ) {
-
-				return makeFail( 'One value is undefined or null', val1, val2 );
-
-			}
-
-			// Both null / undefined.
-			return true;
-		}
-
-		// Don't compare functions.
-		if ( isFunction( val1 ) && isFunction( val2 ) ) return true;
-
-		// Array comparison.
-		var arrCmp = compareArrays( val1, val2 );
-		if ( arrCmp !== undefined ) return arrCmp;
-
-		// Has custom equality comparer.
-		if ( val1.equals ) {
-
-			if ( val1.equals( val2 ) ) return true;
-
-			return makeFail( 'Comparison with .equals method returned false' );
-
-		}
-
-		// Object comparison.
-		var objCmp = compareObjects( val1, val2 );
-		if ( objCmp !== undefined ) return objCmp;
-
-		// if (JSON.stringify( val1 ) == JSON.stringify( val2 ) ) return true;
-
-		// Object differs (unknown reason).
-		return makeFail( 'Values differ', val1, val2 );
-	}
-
-	function isFunction(value) {
-
-		// The use of `Object#toString` avoids issues with the `typeof` operator
-		// in Safari 8 which returns 'object' for typed array constructors, and
-		// PhantomJS 1.9 which returns 'function' for `NodeList` instances.
-		var tag = isObject(value) ? Object.prototype.toString.call(value) : '';
-
-		return tag == '[object Function]' || tag == '[object GeneratorFunction]';
-
-  }
-
-	function isObject(value) {
-
-		// Avoid a V8 JIT bug in Chrome 19-20.
-		// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
-		var type = typeof value;
-
-		return !!value && (type == 'object' || type == 'function');
-
-  }
-
-	function compareArrays( val1, val2 ) {
-
-		var isArr1 = Array.isArray( val1 );
-		var isArr2 = Array.isArray( val2 );
-
-		// Compare type.
-		if ( isArr1 !== isArr2 ) return makeFail( 'Values are not both arrays' );
-
-		// Not arrays. Continue.
-		if ( !isArr1 ) return undefined;
-
-		// Compare length.
-		var N1 = val1.length;
-		var N2 = val2.length;
-		if ( N1 !== val2.length ) return makeFail( 'Array length differs', N1, N2 );
-
-		// Compare content at each index.
-		for ( var i = 0; i < N1; i ++ ) {
-
-			var cmp = areEqual( val1[ i ], val2[ i ] );
-			if ( !cmp )	return addContext( 'array index "' + i + '"' );
-
-		}
-
-		// Arrays are equal.
-		return true;
-	}
-
-
-	function compareObjects( val1, val2 ) {
-
-		var isObj1 = isObject( val1 );
-		var isObj2 = isObject( val2 );
-
-		// Compare type.
-		if ( isObj1 !== isObj2 ) return makeFail( 'Values are not both objects' );
-
-		// Not objects. Continue.
-		if ( !isObj1 ) return undefined;
-
-		// Compare keys.
-		var keys1 = Object.keys( val1 );
-		var keys2 = Object.keys( val2 );
-
-		for ( var i = 0, l = keys1.length; i < l; i++ ) {
-
-			if (keys2.indexOf(keys1[ i ]) < 0) {
-
-				return makeFail( 'Property "' + keys1[ i ] + '" is unexpected.' );
-
-			}
-
-		}
-
-		for ( var i = 0, l = keys2.length; i < l; i++ ) {
-
-			if (keys1.indexOf(keys2[ i ]) < 0) {
-
-				return makeFail( 'Property "' + keys2[ i ] + '" is missing.' );
-
-			}
-
-		}
-
-		// Keys are the same. For each key, compare content until a difference is found.
-		var hadDifference = false;
-
-		for ( var i = 0, l = keys1.length; i < l; i++ ) {
-
-			var key = keys1[ i ];
-
-			if (key === "uuid" || key === "id") {
-
-				continue;
-
-			}
-
-			var prop1 = val1[ key ];
-			var prop2 = val2[ key ];
-
-			// Compare property content.
-			var eq = areEqual( prop1, prop2 );
-
-			// In case of failure, an message should already be set.
-			// Add context to low level message.
-			if ( !eq ) {
-
-				addContext( 'property "' + key + '"' );
-				hadDifference = true;
-
-			}
-		}
-
-		return ! hadDifference;
-
-	}
-
-
-	function makeFail( msg, val1, val2 ) {
-
-		message = msg;
-		if ( arguments.length > 1) message += " (" + val1 + " vs " + val2 + ")";
-
-		return false;
-
-	}
-
-	function addContext( msg ) {
-
-		// There should already be a validation message. Add more context to it.
-		message = message || "Error";
-		message += ", at " + msg;
-
-		return false;
-
-	}
-
-}

+ 0 - 171
test/unit/editor/CommonUtilities.js

@@ -1,171 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-function mergeParams( defaults, customParams ) {
-
-	if ( typeof customParams == "undefined" ) return defaults;
-
-	var defaultKeys = Object.keys( defaults );
-	var params = {};
-
-	defaultKeys.map( function( key ) {
-
-		params[ key ] = customParams[ key ] || defaultKeys[ key ];
-
-	} );
-
-	return params;
-
-}
-
-
-function getGeometryParams( type, customParams ) {
-
-	if ( typeof customParams != "undefined" &&
-		typeof customParams.geometry != "undefined" &&
-		typeof customParams.geometry.parameters != "undefined" ) {
-
-		var customGeometryParams = customParams.geometry.parameters;
-
-	}
-
-	var defaults = {};
-
-	switch ( type ) {
-
-		case "BoxGeometry":
-
-			defaults = { width: 100, height: 100, depth: 100, widthSegments: 1, heightSegments: 1, depthSegments: 1 };
-			break;
-
-		case "SphereGeometry":
-
-			defaults = { radius: 75, widthSegments: 32, heightSegments: 16, phiStart: 0, phiLength: 6.28, thetaStart: 0.00, thetaLength: 3.14 };
-			break;
-
-		default:
-
-			console.error( "Type '" + type + "' is not known while creating params" );
-			return false;
-
-	}
-
-	return mergeParams( defaults, customGeometryParams );
-
-}
-
-function getGeometry( type, customParams ) {
-
-	var params = getGeometryParams( type, customParams );
-
-	switch ( type ) {
-
-		case "BoxGeometry":
-
-			return new THREE.BoxGeometry(
-				params[ 'width' ],
-				params[ 'height' ],
-				params[ 'depth' ],
-				params[ 'widthSegments' ],
-				params[ 'heightSegments' ],
-				params[ 'depthSegments' ]
-			);
-
-		case "SphereGeometry":
-
-			return new THREE.SphereGeometry(
-				params[ 'radius' ],
-				params[ 'widthSegments' ],
-				params[ 'heightSegments' ],
-				params[ 'phiStart' ],
-				params[ 'phiLength' ],
-				params[ 'thetaStart' ],
-				params[ 'thetaLength' ]
-			);
-
-		default:
-
-			console.error( "Type '" + type + "' is not known while creating geometry " );
-			return false;
-
-	}
-
-}
-
-function getObject( name, type, customParams ) {
-
-	var geometry = getGeometry( type, customParams );
-
-	var object = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
-	object.name = name || type + " 1";
-
-	return object;
-
-}
-
-
-function aBox( name, customParams ) {
-
-	return getObject( name, "BoxGeometry", customParams );
-
-}
-
-function aSphere( name, customParams ) {
-
-	return getObject( name, "SphereGeometry", customParams );
-
-}
-
-function aPointlight( name ) {
-
-	var object = new THREE.PointLight( 54321, 1.0, 0.0, 1.0 );
-	object.name = name || "PointLight 1";
-
-	return object;
-
-}
-
-function aPerspectiveCamera( name ) {
-
-	var object = new THREE.PerspectiveCamera( 50.1, 0.4, 1.03, 999.05 );
-	object.name = name || "PerspectiveCamera 1";
-
-	return object;
-
-}
-
-function getScriptCount( editor ) {
-
-	var scriptsKeys = Object.keys( editor.scripts );
-	var scriptCount = 0;
-
-	for ( var i = 0; i < scriptsKeys.length; i ++ ) {
-
-		scriptCount += editor.scripts[ scriptsKeys[ i ] ].length;
-
-	}
-
-	return scriptCount;
-
-}
-
-function exportScene( editor ) {
-
-	var output = editor.scene.toJSON();
-	output = JSON.stringify( output, null, '\t' );
-	output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
-	return output;
-
-}
-
-function importScene( data ) {
-
-	var json = JSON.parse( data );
-	var loader = new THREE.ObjectLoader();
-	var result = loader.parse( json );
-
-	return result;
-
-}

+ 0 - 56
test/unit/editor/TestAddObjectCommandAndRemoveObjectCommand.js

@@ -1,56 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "AddObjectCommandAndRemoveObjectCommand" );
-
-QUnit.test( "Test AddObjectCommand and RemoveObjectCommand (Undo and Redo)", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-
-	var box = aBox( 'The Box' );
-	var light = aPointlight( 'The PointLight' );
-	var camera = aPerspectiveCamera( 'The Camera' );
-
-	var objects = [ box , light, camera ];
-
-	objects.map( function( object ) {
-
-		// Test Add
-		var cmd = new AddObjectCommand( object );
-		cmd.updatable = false;
-
-		editor.execute( cmd );
-		assert.ok( editor.scene.children.length == 1, "OK, adding '" + object.type + "' was successful " );
-
-		editor.undo();
-		assert.ok( editor.scene.children.length == 0, "OK, adding '" + object.type + "' is undone (was removed)" );
-
-		editor.redo();
-		assert.ok( editor.scene.children[ 0 ].name == object.name, "OK, removed '" + object.type + "' was added again (redo)" );
-
-		assert.ok( editor.selected == object, "OK, focus was set on recovered object after Add-Redo" );
-
-
-		// Test Remove
-		var cmd = new RemoveObjectCommand( object );
-		cmd.updatable = false;
-
-		editor.execute( cmd );
-		assert.ok( editor.scene.children.length == 0, "OK, removing object was successful" );
-
-		editor.undo();
-		assert.ok( editor.scene.children[ 0 ].name == object.name, "OK, removed object was added again (undo)" );
-
-		assert.ok( editor.selected == object, "OK, focus was set on recovered object after Delete-Undo" );
-
-		editor.redo();
-		assert.ok( editor.scene.children.length == 0, "OK, object was removed again (redo)" );
-
-
-	} );
-
-
-} );

+ 0 - 62
test/unit/editor/TestAddScriptCommand.js

@@ -1,62 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "AddScriptCommand" );
-
-QUnit.test( "Test AddScriptCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-
-	// prepare
-	var box    = aBox( "The scripted box" );
-	var sphere = aSphere( "The scripted sphere" );
-	var objects = [ box, sphere ];
-
-	var xMove  = { name: "", source: "function update( event ) { this.position.x = this.position.x + 1; }" };
-	var yMove  = { name: "", source: "function update( event ) { this.position.y = this.position.y + 1; }" };
-	var scripts = [ xMove, yMove ];
-
-	// add objects to editor
-	objects.map( function( item ) {
-
-		editor.execute( new AddObjectCommand( item ) );
-
-	} );
-	assert.ok( editor.scene.children.length == 2, "OK, the box and the sphere have been added" );
-
-	// add scripts to the objects
-	for ( var i = 0; i < scripts.length; i ++ ) {
-
-		var cmd = new AddScriptCommand( objects[ i ], scripts[ i ] );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	}
-
-	var scriptsKeys = Object.keys( editor.scripts );
-	assert.ok( getScriptCount( editor ) == scripts.length, "OK, correct number of scripts have been added" );
-
-	for ( var i = 0; i < objects.length; i ++ ) {
-
-		assert.ok( objects[ i ].uuid == scriptsKeys[ i ], "OK, script key #" + i + " matches the object's UUID" );
-
-	}
-
-	editor.undo();
-	assert.ok( getScriptCount( editor ) == scripts.length - 1, "OK, one script has been removed by undo" );
-
-	editor.redo();
-	assert.ok( getScriptCount( editor ) == scripts.length, "OK, one script has been added again by redo" );
-
-
-	for ( var i = 0; i < scriptsKeys.length; i ++ ) {
-
-		assert.ok( editor.scripts[ scriptsKeys[ i ] ][ 0 ] == scripts[ i ], "OK, script #" + i + " is still assigned correctly" );
-
-	}
-
-
-} );
-

+ 0 - 55
test/unit/editor/TestMassUndoAndRedo.js

@@ -1,55 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "MassUndoAndRedo" );
-
-QUnit.test( "MassUndoAndRedo (stress test)", function( assert ) {
-
-	var editor = new Editor();
-
-	var MAX_OBJECTS = 100;
-
-	// add objects
-	var i = 0;
-	while ( i < MAX_OBJECTS ) {
-
-		var object = aSphere( 'Sphere #' + i );
-		var cmd = new AddObjectCommand( object );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		i ++;
-
-	}
-
-	assert.ok( editor.scene.children.lenght = MAX_OBJECTS,
-		"OK, " + MAX_OBJECTS + " objects have been added" );
-
-	// remove all objects
-	i = 0;
-	while ( i < MAX_OBJECTS ) {
-
-		editor.undo();
-		i ++;
-
-	}
-
-
-	assert.ok( editor.scene.children.length == 0,
-		"OK, all objects have been removed by undos" );
-
-
-	i = 0;
-	while ( i < MAX_OBJECTS ) {
-
-		editor.redo();
-		i ++;
-
-	}
-
-	assert.ok( editor.scene.children.lenght = MAX_OBJECTS,
-		"OK, " + MAX_OBJECTS + " objects have been added again by redos" );
-
-} );

+ 0 - 42
test/unit/editor/TestMoveObjectCommand.js

@@ -1,42 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "MoveObjectCommand" );
-
-QUnit.test( "Test MoveObjectCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-
-	// create some objects
-	var anakinsName = 'Anakin Skywalker';
-	var lukesName   = 'Luke Skywalker';
-	var anakinSkywalker = aSphere( anakinsName );
-	var lukeSkywalker   = aBox( lukesName );
-
-	editor.execute( new AddObjectCommand( anakinSkywalker ) );
-	editor.execute( new AddObjectCommand( lukeSkywalker ) );
-
-
-	assert.ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is 'Scene' " );
-	assert.ok( lukeSkywalker.parent.name   == "Scene", "OK, Luke's parent is 'Scene' " );
-
-	// Tell Luke, Anakin is his father
-	editor.execute( new MoveObjectCommand( lukeSkywalker, anakinSkywalker ) );
-
-	assert.ok( true === true, "(Luke has been told who his father is)" );
-	assert.ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is still 'Scene' " );
-	assert.ok( lukeSkywalker.parent.name   == anakinsName, "OK, Luke's parent is '" + anakinsName + "' " );
-
-	editor.undo();
-	assert.ok( true === true, "(Statement undone)" );
-	assert.ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is still 'Scene' " );
-	assert.ok( lukeSkywalker.parent.name   == "Scene", "OK, Luke's parent is 'Scene' again " );
-
-	editor.redo();
-	assert.ok( true === true, "(Statement redone)" );
-	assert.ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is still 'Scene' " );
-	assert.ok( lukeSkywalker.parent.name   == anakinsName, "OK, Luke's parent is '" + anakinsName + "' again " );
-
-} );

+ 0 - 80
test/unit/editor/TestMultiCmdsCommand.js

@@ -1,80 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "MultiCmdsCommand" );
-
-QUnit.test( "Test MultiCmdsCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-	var box = aBox( 'Multi Command Box' );
-	var boxGeometry1 = { geometry: { parameters: { width: 200, height: 201, depth: 202, widthSegments: 2, heightSegments: 3, depthSegments: 4 } } };
-	var boxGeometry2 = { geometry: { parameters: { width:  50, height:  51, depth:  52, widthSegments: 7, heightSegments: 8, depthSegments: 9 } } };
-	var boxGeometries = [ getGeometry( "BoxGeometry", boxGeometry1 ), getGeometry( "BoxGeometry", boxGeometry2 ) ];
-
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	// setup first multi commands
-	var firstMultiCmds = [
-
-		new SetGeometryCommand( box, boxGeometries[ 0 ] ),
-		new SetPositionCommand( box, new THREE.Vector3( 1, 2, 3 ) ),
-		new SetRotationCommand( box, new THREE.Euler( 0.1, 0.2, 0.2 ) ),
-		new SetScaleCommand( box, new THREE.Vector3( 1.1, 1.2, 1.3 ) )
-
-	];
-
-	firstMultiCmds.map( function( cmd ) {
-
-		cmd.updatable = false;
-
-	} );
-
-	var firstMultiCmd = new MultiCmdsCommand( firstMultiCmds );
-	firstMultiCmd.updatable = false;
-	editor.execute( firstMultiCmd );
-
-
-	// setup second multi commands
-	var secondMultiCmds = [
-
-		new SetGeometryCommand( box, boxGeometries[ 1 ] ),
-		new SetPositionCommand( box, new THREE.Vector3( 4, 5, 6 ) ),
-		new SetRotationCommand( box, new THREE.Euler( 0.4, 0.5, 0.6 ) ),
-		new SetScaleCommand( box, new THREE.Vector3( 1.4, 1.5, 1.6 ) )
-
-	];
-
-	secondMultiCmds.map( function( cmd ) {
-
-		cmd.updatable = false;
-
-	} );
-
-	var secondMultiCmd = new MultiCmdsCommand( secondMultiCmds );
-	secondMultiCmd.updatable = false;
-	editor.execute( secondMultiCmd );
-
-
-	// test one modified value for each command
-	assert.ok( box.geometry.parameters.widthSegments == 7, "OK, widthSegments has been modified accordingly after two multi executes (expected: 7, actual: " + box.geometry.parameters.widthSegments + ")" );
-	assert.ok( box.position.y == 5, "OK, y position has been modified accordingly after two multi executes (expected: 5, actual: " + box.position.y + ")" );
-	assert.ok( box.rotation.x == 0.4, "OK, x rotation has been modified accordingly after two multi executes (expected: 0.4, actual: " + box.rotation.x + ") " );
-	assert.ok( box.scale.z == 1.6, "OK, z scale has been modified accordingly after two multi executes (expected: 1.6, actual: " + box.scale.z + ")" );
-
-	editor.undo();
-	assert.ok( box.geometry.parameters.widthSegments == 2, "OK, widthSegments has been modified accordingly after undo (expected: 2, actual: " + box.geometry.parameters.widthSegments + ")" );
-	assert.ok( box.position.y == 2, "OK, y position has been modified accordingly after undo (expected: 2, actual: " + box.position.y + ")" );
-	assert.ok( box.rotation.x == 0.1, "OK, x rotation has been modified accordingly after undo (expected: 0.1, actual: " + box.rotation.x + ")" );
-	assert.ok( box.scale.z == 1.3, "OK, z scale has been modified accordingly after undo (expected: 1.3, actual: " + box.scale.z + ")" );
-
-	editor.redo();
-	assert.ok( box.geometry.parameters.widthSegments == 7, "OK, widthSegments has been modified accordingly after two multi executes (expected: 7, actual: " + box.geometry.parameters.widthSegments + ")" );
-	assert.ok( box.position.y == 5, "OK, y position has been modified accordingly after two multi executes (expected: 5, actual: " + box.position.y + ")" );
-	assert.ok( box.rotation.x == 0.4, "OK, x rotation has been modified accordingly after two multi executes (expected: 0.4, actual: " + box.rotation.x + ") " );
-	assert.ok( box.scale.z == 1.6, "OK, z scale has been modified accordingly after two multi executes (expected: 1.6, actual: " + box.scale.z + ")" );
-
-} );

+ 0 - 55
test/unit/editor/TestNegativeCases.js

@@ -1,55 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "NegativeCases" );
-
-QUnit.test( "Test unwanted situations ", function( assert ) {
-
-	var editor = new Editor();
-
-	// illegal
-	editor.undo();
-	assert.ok( editor.history.undos.length == 0, "OK, (illegal) undo did not affect the undo history" );
-	assert.ok( editor.history.redos.length == 0, "OK, (illegal) undo did not affect the redo history" );
-
-	// illegal
-	editor.redo();
-	assert.ok( editor.history.undos.length == 0, "OK, (illegal) redo did not affect the undo history" );
-	assert.ok( editor.history.redos.length == 0, "OK, (illegal) redo did not affect the redo history" );
-
-
-	var box = aBox();
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	assert.ok( editor.history.undos.length == 1, "OK, execute changed undo history" );
-	assert.ok( editor.history.redos.length == 0, "OK, execute did not change redo history" );
-
-	// illegal
-	editor.redo();
-	assert.ok( editor.history.undos.length == 1, "OK, (illegal) redo did not affect the undo history" );
-	assert.ok( editor.history.redos.length == 0, "OK, (illegal) redo did not affect the redo history" );
-
-
-	editor.undo();
-	assert.ok( editor.history.undos.length == 0, "OK, undo changed the undo history" );
-	assert.ok( editor.history.redos.length == 1, "OK, undo changed the redo history" );
-
-	// illegal
-	editor.undo();
-	assert.ok( editor.history.undos.length == 0, "OK, (illegal) undo did not affect the undo history" );
-	assert.ok( editor.history.redos.length == 1, "OK, (illegal) undo did not affect the redo history" );
-
-	editor.redo();
-	assert.ok( editor.history.undos.length == 1, "OK, redo changed the undo history" );
-	assert.ok( editor.history.redos.length == 0, "OK, undo changed the redo history" );
-
-	// illegal
-	editor.redo();
-	assert.ok( editor.history.undos.length == 1, "OK, (illegal) did not affect the undo history" );
-	assert.ok( editor.history.redos.length == 0, "OK, (illegal) did not affect the redo history" );
-
-} );

+ 0 - 108
test/unit/editor/TestNestedDoUndoRedo.js

@@ -1,108 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "NestedDoUndoRedo" );
-
-QUnit.test( "Test nested Do's, Undo's and Redo's", function( assert ) {
-
-	var editor = new Editor();
-
-	var mesh = aBox( 'One box unlike all others' );
-
-	var initPosX      =  2 ;
-	var initPosY      =  3 ;
-	var initPosZ      =  4 ;
-	var initRotationX = 12 ;
-	var initRotationY = 13 ;
-	var initRotationZ = 14 ;
-	var initScaleX    = 22 ;
-	var initScaleY    = 23 ;
-	var initScaleZ    = 24 ;
-
-	mesh.position.x = initPosX ;
-	mesh.position.y = initPosY ;
-	mesh.position.z = initPosZ ;
-	mesh.rotation.x = initRotationX ;
-	mesh.rotation.y = initRotationY ;
-	mesh.rotation.z = initRotationZ ;
-	mesh.scale.x    = initScaleX ;
-	mesh.scale.y    = initScaleY ;
-	mesh.scale.z    = initScaleZ ;
-
-	// let's begin
-	editor.execute( new AddObjectCommand( mesh ) );
-
-	var newPos = new THREE.Vector3( initPosX + 100, initPosY, initPosZ );
-	editor.execute( new SetPositionCommand( mesh, newPos ) );
-
-	var newRotation = new THREE.Euler( initRotationX, initRotationY + 1000, initRotationZ );
-	editor.execute( new SetRotationCommand( mesh, newRotation ) );
-
-	var newScale = new THREE.Vector3( initScaleX, initScaleY, initScaleZ + 10000 );
-	editor.execute( new SetScaleCommand( mesh, newScale ) );
-
-
-	/* full check */
-
-	assert.ok( mesh.position.x ==   102, "OK, X position is correct " );
-	assert.ok( mesh.position.y ==     3, "OK, Y position is correct " );
-	assert.ok( mesh.position.z ==     4, "OK, Z position is correct " );
-
-	assert.ok( mesh.rotation.x ==    12, "OK, X rotation is correct " );
-	assert.ok( mesh.rotation.y ==  1013, "OK, Y rotation is correct " );
-	assert.ok( mesh.rotation.z ==    14, "OK, Z rotation is correct " );
-
-	assert.ok( mesh.scale.x    ==    22, "OK, X scale is correct " );
-	assert.ok( mesh.scale.y    ==    23, "OK, Y scale is correct " );
-	assert.ok( mesh.scale.z    == 10024, "OK, Z scale is correct " );
-
-
-	editor.undo();  // rescaling undone
-	editor.undo();  // rotation undone
-	editor.undo();  // translation undone
-
-	/* full check */
-
-	assert.ok( mesh.position.x ==     2, "OK, X position is correct " );
-	assert.ok( mesh.position.y ==     3, "OK, Y position is correct " );
-	assert.ok( mesh.position.z ==     4, "OK, Z position is correct " );
-
-	assert.ok( mesh.rotation.x ==    12, "OK, X rotation is correct " );
-	assert.ok( mesh.rotation.y ==    13, "OK, Y rotation is correct " );
-	assert.ok( mesh.rotation.z ==    14, "OK, Z rotation is correct " );
-
-	assert.ok( mesh.scale.x    ==    22, "OK, X scale is correct " );
-	assert.ok( mesh.scale.y    ==    23, "OK, Y scale is correct " );
-	assert.ok( mesh.scale.z    ==    24, "OK, Z scale is correct " );
-
-
-	editor.redo();  // translation redone
-	editor.redo();  // rotation redone
-
-	editor.execute( new RemoveObjectCommand( mesh ) );
-	assert.ok( editor.scene.children.length == 0, "OK, object removal was successful" );
-
-	editor.undo();  // removal undone
-	assert.ok( mesh.rotation.y ==    1013, "OK, Y rotation is correct " );
-
-
-	editor.undo();  // rotation undone (expected!)
-
-	/* full check */
-
-	assert.ok( mesh.position.x ==   102, "OK, X position is correct " );
-	assert.ok( mesh.position.y ==     3, "OK, Y position is correct " );
-	assert.ok( mesh.position.z ==     4, "OK, Z position is correct " );
-
-	assert.ok( mesh.rotation.x ==    12, "OK, X rotation is correct " );
-	assert.ok( mesh.rotation.y ==    13, "OK, Y rotation is correct " );
-	assert.ok( mesh.rotation.z ==    14, "OK, Z rotation is correct " );
-
-	assert.ok( mesh.scale.x    ==    22, "OK, X scale is correct " );
-	assert.ok( mesh.scale.y    ==    23, "OK, Y scale is correct " );
-	assert.ok( mesh.scale.z    ==    24, "OK, Z scale is correct " );
-
-
-} );

+ 0 - 64
test/unit/editor/TestRemoveScriptCommand.js

@@ -1,64 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "RemoveScriptCommand" );
-
-QUnit.test( "Test RemoveScriptCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-
-	// prepare
-	var box    = aBox( "The scripted box" );
-	var sphere = aSphere( "The scripted sphere" );
-	var objects = [ box, sphere ];
-
-	var xMove  = { name: "", source: "function update( event ) { this.position.x = this.position.x + 1; }" };
-	var yMove  = { name: "", source: "function update( event ) { this.position.y = this.position.y + 1; }" };
-	var scripts = [ xMove, yMove ];
-
-	// add objects to editor
-	objects.map( function( item ) {
-
-		editor.execute( new AddObjectCommand( item ) );
-
-	} );
-	assert.ok( editor.scene.children.length == 2, "OK, the box and the sphere have been added" );
-
-	// add scripts to the objects
-	for ( var i = 0; i < scripts.length; i ++ ) {
-
-		var cmd = new AddScriptCommand( objects[ i ], scripts[ i ] );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	}
-
-	for ( var i = 0; i < scripts.length; i ++ ) {
-
-		var cmd = new RemoveScriptCommand( objects[ i ], scripts[ i ] );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	}
-	assert.ok( getScriptCount( editor ) == 0, "OK, all scripts have been removed" );
-
-	scripts.map( function() {
-
-		editor.undo();
-
-	} );
-	assert.ok( getScriptCount( editor ) == scripts.length, "OK, all scripts have been added again by undo(s)" );
-
-	var scriptsKeys = Object.keys( editor.scripts );
-	for ( var i = 0; i < scriptsKeys.length; i ++ ) {
-
-		assert.ok( editor.scripts[ scriptsKeys[ i ] ][ 0 ] == scripts[ i ], "OK, script #" + i + " is still assigned correctly" );
-
-	}
-
-	editor.redo();
-	assert.ok( getScriptCount( editor ) == scripts.length - 1, "OK, one script has been removed again by redo" );
-
-} );

+ 0 - 358
test/unit/editor/TestSerialization.js

@@ -1,358 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "Serialization" );
-
-QUnit.test( "Test Serialization", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-	var done = assert.async();
-	editor.storage.init( function () {
-
-		performTests();
-		done(); // continue running other tests
-
-	} );
-
-	var green   = 12581843; // bffbd3
-
-	var addObject = function () {
-
-		// setup
-		var box = aBox( 'The Box' );
-
-		// Test Add
-		var cmd = new AddObjectCommand( box );
-		cmd.updatable = false;
-
-		editor.execute( cmd );
-
-		return "addObject";
-
-	};
-
-	var addScript = function () {
-
-		// setup
-		var box = aBox( 'The Box' );
-
-		// Test Add
-
-		var cmd = new AddObjectCommand( box );
-		editor.execute( cmd );
-
-		var cmd = new AddScriptCommand( box, { "name": "test", "source": "console.log(\"hello world\");" } );
-		cmd.updatable = false;
-
-		editor.execute( cmd );
-
-		return "addScript";
-
-	};
-
-	var moveObject = function () {
-
-		// create some objects
-		var anakinsName = 'Anakin Skywalker';
-		var lukesName   = 'Luke Skywalker';
-		var anakinSkywalker = aSphere( anakinsName );
-		var lukeSkywalker   = aBox( lukesName );
-
-		editor.execute( new AddObjectCommand( anakinSkywalker ) );
-		editor.execute( new AddObjectCommand( lukeSkywalker ) );
-
-		// Tell Luke, Anakin is his father
-		editor.execute( new MoveObjectCommand( lukeSkywalker, anakinSkywalker ) );
-
-		return "moveObject";
-
-	};
-
-	var removeScript = function () {
-
-		var box = aBox( 'Box with no script' );
-		editor.execute( new AddObjectCommand( box ) );
-
-		var script = { "name": "test", "source": "console.log(\"hello world\");" } ;
-		var cmd = new AddScriptCommand( box, script );
-		cmd.updatable = false;
-
-		editor.execute( cmd );
-
-		cmd = new RemoveScriptCommand( box, script );
-		editor.execute( cmd );
-
-		return "removeScript";
-
-	};
-
-	var setColor = function () {
-
-		var pointLight = aPointlight( "The light Light" );
-
-		editor.execute( new AddObjectCommand( pointLight ) );
-		var cmd = new SetColorCommand( pointLight, 'color', green );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setColor";
-
-	};
-
-	var setGeometry = function () {
-
-		var box = aBox( 'Guinea Pig' ); // default ( 100, 100, 100, 1, 1, 1 )
-		var boxGeometry = { geometry: { parameters: { width: 200, height: 201, depth: 202, widthSegments: 2, heightSegments: 3, depthSegments: 4 } } };
-
-		editor.execute( new AddObjectCommand( box ) );
-
-		var cmd = new SetGeometryCommand( box, getGeometry( "BoxGeometry", boxGeometry ) );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setGeometry";
-
-	};
-
-	var setGeometryValue = function() {
-
-		var box = aBox( 'Geometry Value Box' );
-		editor.execute( new AddObjectCommand( box ) );
-
-		cmd = new SetGeometryValueCommand( box, 'uuid', THREE.Math.generateUUID() );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setGeometryValue";
-
-	};
-
-	var setMaterial = function () {
-
-		var sphere = aSphere( 'The Sun' );
-		editor.execute( new AddObjectCommand( sphere ) );
-
-		var material = new THREE[ 'MeshPhongMaterial' ]();
-		var cmd = new SetMaterialCommand( sphere, material );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setMaterial";
-
-	};
-
-	var setMaterialColor = function () {
-
-		var box = aBox( 'Box with colored material' );
-		editor.execute( new AddObjectCommand( box ) );
-
-		var cmd = new SetMaterialColorCommand( box, 'color', green );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setMaterialColor";
-
-	};
-
-	var setMaterialMap = function () {
-
-		var sphere = aSphere( 'Sphere with texture' );
-		editor.execute( new AddObjectCommand( sphere ) );
-
-		// dirt.png
-		var data = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDMjYxMEI4MzVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDMjYxMEI4NDVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMyNjEwQjgxNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMyNjEwQjgyNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+txizaQAAABVQTFRFh4eHbGxsdFhEWT0puYVclmxKeVU6ppwr+AAAAHtJREFUeNosjgEWBCEIQplFuP+RB5h9lZn2EZxkLzC3D1YSgSlmk7i0ctzDZNBz/VSoX1KwjlFI8WmA2R7JqUa0LJJcd1rLNWRRaMyi+3Y16qMKHhdE48XLsDyHKJ0nSMazY1fxHyriXxV584tmEedcfGNrA/5cmK8AAwCT9ATehDDyzwAAAABJRU5ErkJggg==';
-		var img = new Image();
-		img.src = data;
-
-		var texture = new THREE.Texture( img, 'map' );
-		texture.sourceFile = 'dirt.png';
-
-		var cmd = new SetMaterialMapCommand( sphere, 'map', texture );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setMaterialMap";
-
-	};
-
-	var setMaterialValue = function () {
-
-		var box = aBox( 'Box with values' );
-		editor.execute( new AddObjectCommand( box ) );
-
-		var cmd = new SetMaterialValueCommand( box, 'name', 'Bravo' );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setMaterialValue";
-
-	};
-
-	var setPosition = function () {
-
-		var sphere = aSphere( 'Sphere with position' );
-		editor.execute( new AddObjectCommand( sphere ) );
-
-		var newPosition = new THREE.Vector3( 101, 202, 303 );
-		var cmd = new SetPositionCommand( sphere, newPosition );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setPosition";
-
-	};
-
-	var setRotation = function () {
-
-		var box = aBox( 'Box with rotation' );
-		editor.execute( new AddObjectCommand( box ) );
-
-		var newRotation = new THREE.Euler( 0.3, - 1.7, 2 );
-		var cmd = new SetRotationCommand( box, newRotation );
-		cmd.updatable = false;
-		editor.execute ( cmd );
-
-		return "setRotation";
-
-	};
-
-	var setScale = function () {
-
-		var sphere = aSphere( 'Sphere with scale' );
-		editor.execute( new AddObjectCommand( sphere ) );
-
-		var newScale = new THREE.Vector3( 1.2, 3.3, 4.6 );
-		var cmd = new SetScaleCommand( sphere, newScale );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setScale";
-
-	};
-
-	var setScriptValue = function () {
-
-		var box = aBox( 'Box with script' );
-		editor.execute( new AddObjectCommand( box ) );
-		var script = { name: "Alert", source: "alert( null );" };
-		editor.execute( new AddScriptCommand( box, script ) );
-
-		var newScript = { name: "Console", source: "console.log( null );" };
-		var cmd = new SetScriptValueCommand( box, script, 'source', newScript.source, 0 );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setScriptValue";
-
-	};
-
-	var setUuid = function () {
-
-		var sphere = aSphere( 'Sphere with UUID' );
-		editor.execute( new AddObjectCommand( sphere ) );
-
-		var cmd = new SetUuidCommand( sphere, THREE.Math.generateUUID() );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setUuid";
-
-	};
-
-	var setValue = function () {
-
-		var box = aBox( 'Box with value' );
-		editor.execute( new AddObjectCommand( box ) );
-
-		var cmd = new SetValueCommand( box, 'intensity', 2.3 );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		return "setValue";
-
-	};
-
-	var setups = [
-
-		addObject,
-		addScript,
-		moveObject,
-		removeScript,
-		setColor,
-		setGeometry,
-		setGeometryValue,
-		setMaterial,
-		setMaterialColor,
-		setMaterialMap,
-		setMaterialValue,
-		setPosition,
-		setRotation,
-		setScale,
-		setScriptValue,
-		setUuid,
-		setValue
-
-	];
-
-	function performTests() {
-
-		// Forward tests
-
-		for ( var i = 0; i < setups.length ; i ++ ) {
-
-			var name = setups[ i ]();
-
-			// Check for correct serialization
-
-			editor.history.goToState( 0 );
-			editor.history.goToState( 1000 );
-
-			var history = JSON.stringify( editor.history.toJSON() );
-
-			editor.history.clear();
-
-			editor.history.fromJSON( JSON.parse( history ) );
-
-			editor.history.goToState( 0 );
-			editor.history.goToState( 1000 );
-
-			var history2 = JSON.stringify( editor.history.toJSON() );
-
-			assert.ok( history == history2, "OK, forward serializing was successful for " + name );
-
-			editor.clear();
-
-		}
-
-		// Backward tests
-
-		for ( var i = 0; i < setups.length ; i ++ ) {
-
-			var name = setups[ i ]();
-
-			editor.history.goToState( 0 );
-
-			var history = JSON.stringify( editor.history.toJSON() );
-
-			editor.history.clear();
-
-			editor.history.fromJSON( JSON.parse( history ) );
-
-			editor.history.goToState( 1000 );
-			editor.history.goToState( 0 );
-
-			var history2 = JSON.stringify( editor.history.toJSON() );
-
-			assert.ok( history == history2, "OK, backward serializing was successful for " + name );
-
-			editor.clear();
-
-		}
-
-	}
-
-} );
-

+ 0 - 40
test/unit/editor/TestSetColorCommand.js

@@ -1,40 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetColorCommand" );
-
-QUnit.test( "Test SetColorCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-	var pointLight = aPointlight( "The light Light" );
-	editor.execute( new AddObjectCommand( pointLight ) );
-
-	var green   = 12581843; // bffbd3
-	var blue    = 14152447; // d7f2ff
-	var yellow  = 16775383; // fff8d7
-
-	var colors = [ green, blue, yellow ];
-
-	colors.map( function( color ) {
-
-		var cmd = new SetColorCommand( pointLight, 'color', color );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	assert.ok( pointLight.color.getHex() == colors[ colors.length - 1 ],
-		"OK, color has been set successfully (expected: '" + colors[ colors.length - 1 ] + "', actual: '" + pointLight.color.getHex() + "')" );
-
-	editor.undo();
-	assert.ok( pointLight.color.getHex() == colors[ colors.length - 2 ],
-		"OK, color has been set successfully after undo (expected: '" + colors[ colors.length - 2 ] + "', actual: '" + pointLight.color.getHex() + "')" );
-
-	editor.redo();
-	assert.ok( pointLight.color.getHex() == colors[ colors.length - 1 ],
-		"OK, color has been set successfully after redo (expected: '" + colors[ colors.length - 1 ] + "', actual: '" + pointLight.color.getHex() + "')" );
-
-
-} );

+ 0 - 63
test/unit/editor/TestSetGeometryCommand.js

@@ -1,63 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetGeometryCommand" );
-
-QUnit.test( "Test SetGeometryCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-
-	// initialize objects and geometries
-	var box = aBox( 'Guinea Pig' ); // default ( 100, 100, 100, 1, 1, 1 )
-	var boxGeometry1 = { geometry: { parameters: { width: 200, height: 201, depth: 202, widthSegments: 2, heightSegments: 3, depthSegments: 4 } } };
-	var boxGeometry2 = { geometry: { parameters: { width:  50, height:  51, depth:  52, widthSegments: 7, heightSegments: 8, depthSegments: 9 } } };
-	var geometryParams = [ boxGeometry1, boxGeometry2 ];
-
-
-	// add the object
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	for ( var i = 0; i < geometryParams.length; i ++ ) {
-
-		var cmd = new SetGeometryCommand( box, getGeometry( "BoxGeometry", geometryParams[ i ] ) );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-		var actualParams = box.geometry.parameters;
-		var expectedParams = geometryParams[ i ].geometry.parameters;
-
-		assert.ok( actualParams.width == expectedParams.width, "OK, box width matches the corresponding value from boxGeometry"  + ( i + 1 ) );
-		assert.ok( actualParams.height == expectedParams.height, "OK, box height matches the corresponding value from boxGeometry" + ( i + 1 ) );
-		assert.ok( actualParams.depth == expectedParams.depth, "OK, box depth matches the corresponding value from boxGeometry"  + ( i + 1 ) );
-		assert.ok( actualParams.widthSegments == expectedParams.widthSegments, "OK, box widthSegments matches the corresponding value from boxGeometry"  + ( i + 1 ) );
-		assert.ok( actualParams.heightSegments == expectedParams.heightSegments, "OK, box heightSegments matches the corresponding value from boxGeometry"  + ( i + 1 ) );
-		assert.ok( actualParams.depthSegments == expectedParams.depthSegments, "OK, box depthSegments matches the corresponding value from boxGeometry"  + ( i + 1 ) );
-
-	}
-
-	editor.undo();
-	var actualParams = box.geometry.parameters;
-	var expectedParams = geometryParams[ 0 ].geometry.parameters;
-	assert.ok( actualParams.width == expectedParams.width, "OK, box width matches the corresponding value from boxGeometry1 (after undo)" );
-	assert.ok( actualParams.height == expectedParams.height, "OK, box height matches the corresponding value from boxGeometry1 (after undo)" );
-	assert.ok( actualParams.depth == expectedParams.depth, "OK, box depth matches the corresponding value from boxGeometry1 (after undo)" );
-	assert.ok( actualParams.widthSegments == expectedParams.widthSegments, "OK, box widthSegments matches the corresponding value from boxGeometry1 (after undo)" );
-	assert.ok( actualParams.heightSegments == expectedParams.heightSegments, "OK, box heightSegments matches the corresponding value from boxGeometry1 (after undo)" );
-	assert.ok( actualParams.depthSegments == expectedParams.depthSegments, "OK, box depthSegments matches the corresponding value from boxGeometry1 (after undo)" );
-
-	editor.redo();
-	var actualParams = box.geometry.parameters;
-	var expectedParams = geometryParams[ 1 ].geometry.parameters;
-	assert.ok( actualParams.width == expectedParams.width, "OK, box width matches the corresponding value from boxGeometry2 (after redo)" );
-	assert.ok( actualParams.height == expectedParams.height, "OK, box height matches the corresponding value from boxGeometry2 (after redo)" );
-	assert.ok( actualParams.depth == expectedParams.depth, "OK, box depth matches the corresponding value from boxGeometry2 (after redo)" );
-	assert.ok( actualParams.widthSegments == expectedParams.widthSegments, "OK, box widthSegments matches the corresponding value from boxGeometry2 (after redo)" );
-	assert.ok( actualParams.heightSegments == expectedParams.heightSegments, "OK, box heightSegments matches the corresponding value from boxGeometry2 (after redo)" );
-	assert.ok( actualParams.depthSegments == expectedParams.depthSegments, "OK, box depthSegments matches the corresponding value from boxGeometry2 (after redo)" );
-
-
-} );

+ 0 - 51
test/unit/editor/TestSetGeometryValueCommand.js

@@ -1,51 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetGeometryValueCommand" );
-
-QUnit.test( "Test SetGeometryValueCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-	var box = aBox( 'The Box' );
-
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	var testData = [
-		{ uuid: THREE.Math.generateUUID(), name: 'Bruno' },
-		{ uuid: THREE.Math.generateUUID(), name: 'Jack' }
-	];
-
-	for ( var i = 0; i < testData.length; i ++ ) {
-
-		var keys = Object.keys( testData[ i ] );
-
-		keys.map( function( key ) {
-
-			cmd = new SetGeometryValueCommand( box, key, testData[ i ][ key ] );
-			cmd.updatable = false;
-			editor.execute( cmd );
-
-		} );
-
-	}
-
-	assert.ok( box.geometry.name == testData[ 1 ].name, "OK, box.geometry.name is correct after executes" );
-	assert.ok( box.geometry.uuid == testData[ 1 ].uuid, "OK, box.geometry.uuid is correct after executes" );
-
-	editor.undo();
-	editor.undo();
-
-	assert.ok( box.geometry.name == testData[ 0 ].name, "OK, box.geometry.name is correct after undos" );
-	assert.ok( box.geometry.uuid == testData[ 0 ].uuid, "OK, box.geometry.uuid is correct after undos" );
-
-	editor.redo();
-	editor.redo();
-
-	assert.ok( box.geometry.name == testData[ 1 ].name, "OK, box.geometry.name is correct after executes" );
-	assert.ok( box.geometry.uuid == testData[ 1 ].uuid, "OK, box.geometry.uuid is correct after executes" );
-
-} );

+ 0 - 45
test/unit/editor/TestSetMaterialColorCommand.js

@@ -1,45 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetMaterialColorCommand" );
-
-QUnit.test( "Test for SetMaterialColorCommand (Undo and Redo)", function( assert ) {
-
-	// Setup scene
-	var editor = new Editor();
-	var box = aBox();
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	var green   = 12581843; // bffbd3
-	var blue    = 14152447; // d7f2ff
-	var yellow  = 16775383; // fff8d7
-
-	// there have to be at least 2 colors !
-	colors = [ green, blue, yellow ];
-
-	[ 'color', 'emissive', 'specular' ].map( function( attributeName ) {
-
-		colors.map( function ( color )  {
-
-			var cmd = new SetMaterialColorCommand( box, attributeName, color );
-			cmd.updatable = false;
-			editor.execute( cmd );
-
-		} );
-
-		assert.ok( box.material[ attributeName ].getHex() == colors[ colors.length - 1 ], "OK, " + attributeName + " was set correctly to last color " );
-
-		editor.undo();
-		assert.ok( box.material[ attributeName ].getHex() == colors[ colors.length - 2 ], "OK, " + attributeName + " is set correctly to second to last color after undo" );
-
-		editor.redo();
-		assert.ok( box.material[ attributeName ].getHex() == colors[ colors.length - 1 ], "OK, " + attributeName + " is set correctly to last color after redo" );
-
-
-	} );
-
-} );

+ 0 - 66
test/unit/editor/TestSetMaterialCommand.js

@@ -1,66 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetMaterialCommand" );
-
-QUnit.test( "Test for SetMaterialCommand (Undo and Redo)", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-	var box = aBox( 'Material girl in a material world' );
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	materialClasses = [
-
-		'LineBasicMaterial',
-		'LineDashedMaterial',
-		'MeshBasicMaterial',
-		'MeshDepthMaterial',
-		'MeshLambertMaterial',
-		'MeshNormalMaterial',
-		'MeshPhongMaterial',
-		'ShaderMaterial',
-		'SpriteMaterial'
-
-	];
-
-	materialClasses.map( function( materialClass ) {
-
-		material = new THREE[ materialClass ]();
-		editor.execute( new SetMaterialCommand( box, material ) );
-
-	} );
-
-	var i = materialClasses.length - 1;
-
-	// initial test
-	assert.ok( box.material.type == materialClasses[ i ],
-		"OK, initial material type was set correctly (expected: '" + materialClasses[ i ] + "', actual: '" + box.material.type + "')" );
-
-
-
-	// test undos
-	while ( i > 0 ) {
-
-		editor.undo();
-		-- i;
-		assert.ok( box.material.type == materialClasses[ i ],
-			"OK, material type was set correctly after undo (expected: '" + materialClasses[ i ] + "', actual: '" + box.material.type + "')" );
-
-	}
-
-	// test redos
-	while ( i < materialClasses.length - 1 ) {
-
-		editor.redo();
-		++ i;
-		assert.ok( box.material.type == materialClasses[ i ],
-			"OK, material type was set correctly after redo (expected: '" + materialClasses[ i ] + "', actual: '" + box.material.type + "')" );
-
-	}
-
-} );

+ 0 - 70
test/unit/editor/TestSetMaterialMapCommand.js

@@ -1,70 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetMaterialMapCommand" );
-
-QUnit.test( "Test for SetMaterialMapCommand (Undo and Redo)", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-	var box = aBox( 'Material mapped box' );
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	var mapNames = [ 'map', 'alphaMap', 'bumpMap', 'normalMap', 'displacementMap', 'specularMap', 'envMap', 'lightMap', 'aoMap' ];
-
-	// define files
-	var dirt  = { name: 'dirt.png' , data: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDMjYxMEI4MzVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDMjYxMEI4NDVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMyNjEwQjgxNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMyNjEwQjgyNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+txizaQAAABVQTFRFh4eHbGxsdFhEWT0puYVclmxKeVU6ppwr+AAAAHtJREFUeNosjgEWBCEIQplFuP+RB5h9lZn2EZxkLzC3D1YSgSlmk7i0ctzDZNBz/VSoX1KwjlFI8WmA2R7JqUa0LJJcd1rLNWRRaMyi+3Y16qMKHhdE48XLsDyHKJ0nSMazY1fxHyriXxV584tmEedcfGNrA/5cmK8AAwCT9ATehDDyzwAAAABJRU5ErkJggg==' };
-	var stone = { name: 'stone.png', data: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDMjYxMEI4NzVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDMjYxMEI4ODVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMyNjEwQjg1NUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMyNjEwQjg2NUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+WCxVbAAAAA9QTFRFgICAaGhoj4+Pf39/dHR0lCmHpAAAAG9JREFUeNo8TkkSBDEIEuH/bx7A9HigYlhkKA93sfcaetn10whSQ0jILpqjFQYiqGepXuexaxRpqAQInF2rzJKNx/CZm6yGuoKOzszjL0LbYjlgxzZokJA6CvgsenUaGm3PRPI/W1MUrXC9+v0TYACSUwL7JYc6IAAAAABJRU5ErkJggg==' };
-	var files = [ dirt, stone ];
-
-	// define images for given files
-	var images = files.map( function( file ) {
-
-		var i = new Image();
-		i.src = file.data;
-		return { name: file.name, image: i };
-
-	} );
-
-
-	// test all maps
-	mapNames.map( function( mapName ) {
-
-
-		// define textures for given images
-		var textures = images.map( function( img ) {
-
-			var texture = new THREE.Texture( img.image, mapName );
-			texture.sourceFile = img.name;
-			return texture;
-
-		} );
-
-		// apply the textures
-		textures.map( function( texture ) {
-
-			var cmd = new SetMaterialMapCommand( box, mapName, texture );
-			cmd.updatable = false;
-			editor.execute( cmd );
-
-		} );
-
-
-		assert.ok( box.material[ mapName ].image.src == images[ images.length - 1 ].image.src,
-			"OK, " + mapName + " set correctly " );
-
-		editor.undo();
-		assert.ok( box.material[ mapName ].image.src == images[ images.length - 2 ].image.src,
-			"OK, " + mapName + " set correctly after undo " );
-
-		editor.redo();
-		assert.ok( box.material[ mapName ].image.src == images[ images.length - 1 ].image.src,
-			"OK, " + mapName + " set correctly after redo" );
-
-	} );
-
-} );

+ 0 - 63
test/unit/editor/TestSetMaterialValueCommand.js

@@ -1,63 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetMaterialValueCommand" );
-
-QUnit.test( "Test for SetMaterialValueCommand (Undo and Redo)", function( assert ) {
-
-	// setup scene
-	var editor = new Editor();
-	var box = aBox();
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	// every attribute gets three test values
-	var testData = {
-
-		uuid: [ THREE.Math.generateUUID(), THREE.Math.generateUUID(), THREE.Math.generateUUID() ],
-		name: [ 'Alpha', 'Bravo', 'Charlie' ],
-		shininess: [ 11.1, 22.2, 33.3 ],
-		vertexColors: [ 'No', 'Face', 'Vertex' ],
-		bumpScale: [ 1.1, 2.2, 3.3 ],
-		reflectivity: [ - 1.3, 2.1, 5.0 ],
-		aoMapIntensity: [ 0.1, 0.4, 0.7 ],
-		side: [ 'Front', 'Back', 'Double' ],
-		shading: [ 'No', 'Flat', 'Smooth' ],
-		blending: [ 'No', 'Normal', 'Additive' ],
-		opacity: [ 0.2, 0.5, 0.8 ],
-		alphaTest: [ 0.1, 0.6, 0.9 ],
-		wireframeLinewidth: [ 1.2, 3.4, 5.6 ]
-
-	};
-
-	var testDataKeys = Object.keys( testData );
-
-	testDataKeys.map( function( attributeName ) {
-
-		testData[ attributeName ].map( function( value ) {
-
-			var cmd = new SetMaterialValueCommand( box, attributeName, value );
-			cmd.updatable = false;
-			editor.execute( cmd );
-
-		} );
-
-		var length = testData[ attributeName ].length;
-		assert.ok( box.material[ attributeName ] == testData[ attributeName ][ length - 1 ],
-			"OK, " + attributeName + " was set correctly to the last value (expected: '" + testData[ attributeName ][ length - 1 ] + "', actual: '" + box.material[ attributeName ] + "')" );
-
-		editor.undo();
-		assert.ok( box.material[ attributeName ] == testData[ attributeName ][ length - 2 ],
-			"OK, " + attributeName + " was set correctly to the second to the last value after undo (expected: '" + testData[ attributeName ][ length - 2 ] + "', actual: '" + box.material[ attributeName ] + "')" );
-
-		editor.redo();
-		assert.ok( box.material[ attributeName ] == testData[ attributeName ][ length - 1 ],
-			"OK, " + attributeName + " was set correctly to the last value again after redo (expected: '" + testData[ attributeName ][ length - 1 ] + "', actual: '" + box.material[ attributeName ] + "')" );
-
-	} );
-
-
-} );

+ 0 - 48
test/unit/editor/TestSetPositionCommand.js

@@ -1,48 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetPositionCommand" );
-
-QUnit.test( "Test SetPositionCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-	var box = aBox();
-	var cmd = new AddObjectCommand( box );
-	editor.execute( cmd );
-
-	var positions = [
-
-		{ x:   50, y: - 80, z: 30 },
-		{ x: - 10, y:  100, z:  0 },
-		{ x:   44, y: - 20, z: 90 }
-
-	];
-
-	positions.map( function( position ) {
-
-		var newPosition = new THREE.Vector3( position.x, position.y, position.z );
-		var cmd = new SetPositionCommand( box, newPosition );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	assert.ok( box.position.x == positions[ positions.length - 1 ].x, "OK, changing X position was successful" );
-	assert.ok( box.position.y == positions[ positions.length - 1 ].y, "OK, changing Y position was successful" );
-	assert.ok( box.position.z == positions[ positions.length - 1 ].z, "OK, changing Z position was successful" );
-
-
-	editor.undo();
-	assert.ok( box.position.x == positions[ positions.length - 2 ].x, "OK, changing X position was successful (after undo)" );
-	assert.ok( box.position.y == positions[ positions.length - 2 ].y, "OK, changing Y position was successful (after undo)" );
-	assert.ok( box.position.z == positions[ positions.length - 2 ].z, "OK, changing Z position was successful (after undo)" );
-
-	editor.redo();
-	assert.ok( box.position.x == positions[ positions.length - 1 ].x, "OK, changing X position was successful (after redo)" );
-	assert.ok( box.position.y == positions[ positions.length - 1 ].y, "OK, changing Y position was successful (after redo)" );
-	assert.ok( box.position.z == positions[ positions.length - 1 ].z, "OK, changing Z position was successful (after redo)" );
-
-
-} );

+ 0 - 51
test/unit/editor/TestSetRotationCommand.js

@@ -1,51 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetRotationCommand" );
-
-QUnit.test( "Test SetRotationCommand (Undo and Redo)", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-	var box = aBox();
-	editor.execute( new AddObjectCommand( box ) );
-
-
-	var rotations = [
-
-		{ x: 1.1, y:   0.4, z: - 2.0 },
-		{ x: 2.2, y: - 1.3, z:   1.3 },
-		{ x: 0.3, y: - 0.1, z: - 1.9 }
-
-	];
-
-
-	rotations.map( function( rotation ) {
-
-		var newRotation = new THREE.Euler( rotation.x, rotation.y, rotation.z );
-		var cmd = new SetRotationCommand( box, newRotation );
-		cmd.updatable = false;
-		editor.execute ( cmd );
-
-	} );
-
-
-	assert.ok( box.rotation.x == rotations[ rotations.length - 1 ].x, "OK, changing X rotation was successful" );
-	assert.ok( box.rotation.y == rotations[ rotations.length - 1 ].y, "OK, changing Y rotation was successful" );
-	assert.ok( box.rotation.z == rotations[ rotations.length - 1 ].z, "OK, changing Z rotation was successful" );
-
-	editor.undo();
-	assert.ok( box.rotation.x == rotations[ rotations.length - 2 ].x, "OK, changing X rotation was successful (after undo)" );
-	assert.ok( box.rotation.y == rotations[ rotations.length - 2 ].y, "OK, changing Y rotation was successful (after undo)" );
-	assert.ok( box.rotation.z == rotations[ rotations.length - 2 ].z, "OK, changing Z rotation was successful (after undo)" );
-
-	editor.redo();
-	assert.ok( box.rotation.x == rotations[ rotations.length - 1 ].x, "OK, changing X rotation was successful (after redo)" );
-	assert.ok( box.rotation.y == rotations[ rotations.length - 1 ].y, "OK, changing Y rotation was successful (after redo)" );
-	assert.ok( box.rotation.z == rotations[ rotations.length - 1 ].z, "OK, changing Z rotation was successful (after redo)" );
-
-
-
-} );

+ 0 - 51
test/unit/editor/TestSetScaleCommand.js

@@ -1,51 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetScaleCommand" );
-
-QUnit.test( "Test SetScaleCommand (Undo and Redo)", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-	var box = aBox();
-	editor.execute( new AddObjectCommand( box ) );
-
-
-	// scales
-	var scales = [
-
-		{ x: 1.4, y: 2.7, z: 0.4 },
-		{ x: 0.1, y: 1.3, z: 2.9 },
-		{ x: 3.2, y: 0.3, z: 2.0 }
-
-	];
-
-	scales.map( function( scale ) {
-
-		var newScale = new THREE.Vector3( scale.x, scale.y, scale.z );
-		var cmd = new SetScaleCommand( box, newScale );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	assert.ok( box.scale.x == scales[ scales.length - 1 ].x, "OK, setting X scale value was successful" );
-	assert.ok( box.scale.y == scales[ scales.length - 1 ].y, "OK, setting Y scale value was successful" );
-	assert.ok( box.scale.z == scales[ scales.length - 1 ].z, "OK, setting Z scale value was successful" );
-
-
-	editor.undo();
-	assert.ok( box.scale.x == scales[ scales.length - 2 ].x, "OK, X scale is correct after undo" );
-	assert.ok( box.scale.y == scales[ scales.length - 2 ].y, "OK, Y scale is correct after undo" );
-	assert.ok( box.scale.z == scales[ scales.length - 2 ].z, "OK, Z scale is correct after undo" );
-
-
-	editor.redo();
-	assert.ok( box.scale.x == scales[ scales.length - 1 ].x, "OK, X scale is correct after redo" );
-	assert.ok( box.scale.y == scales[ scales.length - 1 ].y, "OK, Y scale is correct after redo" );
-	assert.ok( box.scale.z == scales[ scales.length - 1 ].z, "OK, Z scale is correct after redo" );
-
-
-} );

+ 0 - 73
test/unit/editor/TestSetSceneCommand.js

@@ -1,73 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "TestCmdSetScene" );
-
-QUnit.test( "Test for SetSceneCommand (Undo and Redo)", function( assert ) {
-
-	// setup
-	var editor = new Editor();
-	objects = [ aBox(), aSphere(), aPointlight() ];
-
-
-	// create multiple editors (scenes) and save the output
-	var scenes = objects.map( function( object ) {
-
-		editor = new Editor();
-		var cmd = new AddObjectCommand( object );
-		cmd.updatable = false;
-		editor.execute( cmd );
-		return { obj: object, exportedData: exportScene( editor ) };
-
-	} );
-
-
-	// create new empty editor (scene), merge the other editors (scenes)
-	editor = new Editor();
-	scenes.map( function( scene ) {
-
-		var importedScene = importScene( scene.exportedData );
-		var cmd = new SetSceneCommand( importedScene );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	// tests
-	assert.ok( editor.scene.children.length = scenes.length,
-		"OK, all scenes have been merged" );
-
-	var i = 0;
-	while ( i < editor.scene.children.length ) {
-
-		assert.ok( editor.scene.children[ i ].name == scenes[ i ].obj.name,
-			"OK, editor.scene.children[ " + i + " ].name matches scenes[ " + i + " ].obj.name" );
-		i ++;
-
-	}
-
-	editor.undo();
-	var i = 0;
-	while ( i < editor.scene.children.length ) {
-
-		assert.ok( editor.scene.children[ i ].name == scenes[ i ].obj.name,
-			"OK, editor.scene.children[ " + i + " ].name matches scenes[ " + i + " ].obj.name after undo" );
-		i ++;
-
-	}
-
-
-	editor.redo();
-	var i = 0;
-	while ( i < editor.scene.children.length ) {
-
-		assert.ok( editor.scene.children[ i ].name == scenes[ i ].obj.name,
-			"OK, editor.scene.children[ " + i + " ].name matches scenes[ " + i + " ].obj.name after redo" );
-		i ++;
-
-	}
-
-
-} );

+ 0 - 77
test/unit/editor/TestSetScriptValueCommand.js

@@ -1,77 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetScriptValueCommand" );
-
-QUnit.test( "Test SetScriptValueCommand for source (Undo and Redo)", function( assert ) {
-
-
-	// setup
-	var editor = new Editor();
-	var box    = aBox( "The scripted box" );
-	var cmd = new AddObjectCommand( box );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-	var translateScript = { name: "Translate", source: "function( update ) {}" };
-	cmd = new AddScriptCommand( box, translateScript );
-	cmd.updatable = false;
-	editor.execute( cmd );
-
-
-	var testSourceData = [
-
-		{ name: "Translate", source: "function update( event ) { this.position.x = this.position.x + 1; }" },
-		{ name: "Translate", source: "function update( event ) { this.position.y = this.position.y + 1; }" },
-		{ name: "Translate", source: "function update( event ) { this.position.z = this.position.z + 1; }" }
-
-	];
-
-
-	// test source
-
-	testSourceData.map( function( script ) {
-
-		var cmd = new SetScriptValueCommand( box, translateScript, 'source', script.source, 0 );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	var length = testSourceData.length;
-	assert.ok( editor.scripts[ box.uuid ][ 0 ][ 'source' ] == testSourceData[ length - 1 ].source,
-		"OK, 'source' was set correctly to the last value (expected: '" + testSourceData[ length - 1 ].source + "', actual: '" + editor.scripts[ box.uuid ][ 0 ][ 'source' ] + "')" );
-
-	editor.undo();
-	assert.ok( editor.scripts[ box.uuid ][ 0 ][ 'source' ] == testSourceData[ length - 2 ].source,
-		"OK, 'source' was set correctly to the second to the last value after undo (expected: '" + testSourceData[ length - 2 ].source + "', actual: '" + editor.scripts[ box.uuid ][ 0 ][ 'source' ] + "')" );
-
-	editor.redo();
-	assert.ok( editor.scripts[ box.uuid ][ 0 ][ 'source' ] == testSourceData[ length - 1 ].source,
-		"OK, 'source' was set correctly to the last value again after redo (expected: '" + testSourceData[ length - 1 ].source + "', actual: '" + editor.scripts[ box.uuid ][ 0 ][ 'source' ]	 + "')" );
-
-
-	var names = [ "X Script", "Y Script", "Z Script" ];
-
-	names.map( function( name ) {
-
-		cmd = new SetScriptValueCommand( box, translateScript, 'name', name );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	var scriptName = editor.scripts[ box.uuid ][ 0 ][ "name" ];
-	assert.ok( scriptName == names[ names.length - 1 ], "OK, the script name corresponds to the last script name that was assigned" );
-
-	editor.undo();
-	scriptName = editor.scripts[ box.uuid ][ 0 ][ "name" ];
-	assert.ok( scriptName == names[ names.length - 2 ], "OK, the script name corresponds to the second last script name that was assigned" );
-
-	editor.redo();
-	scriptName = editor.scripts[ box.uuid ][ 0 ][ "name" ];
-	assert.ok( scriptName == names[ names.length - 1 ], "OK, the script name corresponds to the last script name that was assigned, again" );
-
-} );

+ 0 - 37
test/unit/editor/TestSetUuidCommand.js

@@ -1,37 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetUuidCommand" );
-
-QUnit.test( "Test SetUuidCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-	var object = aBox( 'UUID test box' );
-	editor.execute( new AddObjectCommand( object ) );
-
-
-	var uuids = [ THREE.Math.generateUUID(), THREE.Math.generateUUID(), THREE.Math.generateUUID() ];
-
-	uuids.map( function( uuid ) {
-
-		var cmd = new SetUuidCommand( object, uuid );
-		cmd.updatable = false;
-		editor.execute( cmd );
-
-	} );
-
-	assert.ok( object.uuid == uuids[ uuids.length - 1 ],
-		"OK, UUID on actual object matches last UUID in the test data array " );
-
-	editor.undo();
-	assert.ok( object.uuid == uuids[ uuids.length - 2 ],
-		"OK, UUID on actual object matches second to the last UUID in the test data array (after undo)" );
-
-	editor.redo();
-	assert.ok( object.uuid == uuids[ uuids.length - 1 ],
-		"OK, UUID on actual object matches last UUID in the test data array again (after redo) " );
-
-
-} );

+ 0 - 54
test/unit/editor/TestSetValueCommand.js

@@ -1,54 +0,0 @@
-/**
- * @author lxxxvi / https://github.com/lxxxvi
- * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
- */
-
-QUnit.module( "SetValueCommand" );
-
-QUnit.test( "Test SetValueCommand (Undo and Redo)", function( assert ) {
-
-	var editor = new Editor();
-
-	var valueBefore = 1.10;
-	var valueAfter  = 2.20;
-
-	var box   = aBox( 'A Box' );
-	var light = aPointlight( 'A PointLight' );
-	var cam   = aPerspectiveCamera( 'A PerspectiveCamera' );
-
-	[ box, light, cam ].map( function( object ) {
-
-		editor.execute( new AddObjectCommand( object ) );
-
-		assert.ok( 0 == 0, "Testing object of type '" + object.type + "'" );
-
-		[ 'name', 'fov', 'near', 'far', 'intensity', 'distance', 'angle', 'exponent', 'decay', 'visible', 'userData' ].map( function( item ) {
-
-			if ( object[ item ] !== undefined ) {
-
-				var cmd = new SetValueCommand( object, item, valueBefore );
-				cmd.updatable = false;
-				editor.execute( cmd );
-				assert.ok( object[ item ] == valueBefore, " OK, the attribute '" + item + "' is correct after first execute (expected: '" + valueBefore + "', actual: '" + object[ item ] + "')" );
-
-				var cmd = new SetValueCommand( object, item, valueAfter );
-				cmd.updatable = false;
-				editor.execute( cmd );
-				assert.ok( object[ item ] == valueAfter, " OK, the attribute '" + item + "' is correct after second execute (expected: '" + valueAfter + "', actual: '" + object[ item ] + "')" );
-
-				editor.undo();
-				assert.ok( object[ item ] == valueBefore, " OK, the attribute '" + item + "' is correct after undo (expected: '" + valueBefore + "', actual: '" + object[ item ] + "')" );
-
-				editor.redo();
-				assert.ok( object[ item ] == valueAfter, " OK, the attribute '" + item + "' is correct after redo (expected: '" + valueAfter + "', actual: '" + object[ item ] + "')" );
-
-			}
-
-		} );
-
-	} );
-
-
-
-
-} );

+ 0 - 334
test/unit/qunit-utils.js

@@ -1,334 +0,0 @@
-//
-// Custom QUnit assertions.
-//
-
-QUnit.assert.success = function( message ) {
-
-	// Equivalent to assert( true, message );
-	this.pushResult( {
-		result: true,
-		actual: undefined,
-		expected: undefined,
-		message: message
-	} );
-
-};
-
-QUnit.assert.fail = function( message ) {
-
-	// Equivalent to assert( false, message );
-	this.pushResult( {
-		result: false,
-		actual: undefined,
-		expected: undefined,
-		message: message
-	} );
-
-};
-
-QUnit.assert.numEqual = function( actual, expected, message ) {
-
-	var diff = Math.abs(actual - expected);
-	message = message || ( actual + " should be equal to " + expected );
-	this.pushResult( {
-		result: diff < 0.1,
-		actual: actual,
-		expected: expected,
-		message: message
-	} );
-
-};
-
-QUnit.assert.equalKey = function( obj, ref, key ) {
-
-	var actual = obj[key];
-	var expected = ref[key];
-	var message = actual + ' should be equal to ' + expected + ' for key "' + key + '"';
-	this.pushResult( {
-		result: actual == expected,
-		actual: actual,
-		expected: expected,
-		message: message
-	} );
-
-};
-
-QUnit.assert.smartEqual = function( actual, expected, message ) {
-
-	var cmp = new SmartComparer();
-
-	var same = cmp.areEqual(actual, expected);
-	var msg = cmp.getDiagnostic() || message;
-
-	this.pushResult( {
-		result: same,
-		actual: actual,
-		expected: expected,
-		message: msg
-	} );
-
-};
-
-
-
-//
-//	GEOMETRY TEST HELPERS
-//
-
-function checkGeometryClone( geom ) {
-
-	// Clone
-	var copy = geom.clone();
-	QUnit.assert.notEqual( copy.uuid, geom.uuid, "clone uuid should differ from original" );
-	QUnit.assert.notEqual( copy.id, geom.id, "clone id should differ from original" );
-
-	var excludedProperties = [ 'parameters', 'widthSegments', 'heightSegments', 'depthSegments' ];
-
-	var differingProp = getDifferingProp( geom, copy, excludedProperties );
-	QUnit.assert.ok( differingProp === undefined, 'properties are equal' );
-
-	differingProp = getDifferingProp( copy, geom, excludedProperties );
-	QUnit.assert.ok( differingProp === undefined, 'properties are equal' );
-
-	// json round trip with clone
-	checkGeometryJsonRoundtrip( copy );
-
-}
-
-function getDifferingProp( geometryA, geometryB, excludedProperties) {
-	excludedProperties = excludedProperties || [];
-
-	var geometryKeys = Object.keys( geometryA );
-	var cloneKeys = Object.keys( geometryB );
-
-	var differingProp = undefined;
-
-	for ( var i = 0, l = geometryKeys.length; i < l; i++ ) {
-
-		var key = geometryKeys[ i ];
-
-		if ( excludedProperties.indexOf(key) >= 0 ) {
-			continue;
-		}
-
-		if ( cloneKeys.indexOf( key ) < 0 ) {
-			differingProp = key;
-			break;
-		}
-
-	}
-
-	return differingProp;
-}
-
-// Compare json file with its source geometry.
-function checkGeometryJsonWriting( geom, json ) {
-
-	QUnit.assert.equal( json.metadata.version, "4.5", "check metadata version" );
-	QUnit.assert.equalKey( geom, json, 'type' );
-	QUnit.assert.equalKey( geom, json, 'uuid' );
-	QUnit.assert.equal( json.id, undefined, "should not persist id" );
-
-	var params = geom.parameters;
-	if ( !params ) {
-
-		return;
-
-	}
-
-	// All parameters from geometry should be persisted.
-	var keys = Object.keys( params );
-	for ( var i = 0, l = keys.length; i < l; i++ ) {
-
-		QUnit.assert.equalKey( params, json, keys[ i ] );
-
-	}
-
-	// All parameters from json should be transfered to the geometry.
-	// json is flat. Ignore first level json properties that are not parameters.
-	var notParameters = [ "metadata", "uuid", "type" ];
-	var keys = Object.keys( json );
-	for ( var i = 0, l = keys.length; i < l; i++ ) {
-
-		var key = keys[ i ];
-		if ( notParameters.indexOf( key) === -1 ) QUnit.assert.equalKey( params, json, key );
-
-	}
-}
-
-// Check parsing and reconstruction of json geometry
-function checkGeometryJsonReading( json, geom ) {
-
-	var wrap = [ json ];
-
-	var loader = new THREE.ObjectLoader();
-	var output = loader.parseGeometries( wrap );
-
-	QUnit.assert.ok( output[ geom.uuid ], 'geometry matching source uuid not in output' );
-	// QUnit.assert.smartEqual( output[ geom.uuid ], geom, 'Reconstruct geometry from ObjectLoader' );
-
-	var differing = getDifferingProp(output[ geom.uuid ], geom, ['bones']);
-	if (differing) {
-		console.log(differing);
-	}
-
-	var excludedProperties = [ 'bones' ];
-
-	var differingProp = getDifferingProp( output[ geom.uuid ], geom, excludedProperties );
-	QUnit.assert.ok( differingProp === undefined, 'properties are equal' );
-
-	differingProp = getDifferingProp( geom, output[ geom.uuid ], excludedProperties );
-	QUnit.assert.ok( differingProp === undefined, 'properties are equal' );
-}
-
-// Verify geom -> json -> geom
-function checkGeometryJsonRoundtrip( geom ) {
-
-	var json = geom.toJSON();
-	checkGeometryJsonWriting( geom, json );
-	checkGeometryJsonReading( json, geom );
-
-}
-
-// Look for undefined and NaN values in numerical fieds.
-function checkFinite( geom ) {
-
-	var allVerticesAreFinite = true;
-
-	var vertices = geom.vertices || [];
-
-	for ( var i = 0, l = vertices.length; i < l; i++ ) {
-
-		var v = geom.vertices[ i ];
-
-		if ( !( isFinite( v.x ) || isFinite( v.y ) || isFinite( v.z ) ) ) {
-
-			allVerticesAreFinite = false;
-			break;
-
-		}
-
-	}
-
-	// TODO Buffers, normal, etc.
-
-	QUnit.assert.ok( allVerticesAreFinite, "contains only finite coordinates" );
-
-}
-
-// Run common geometry tests.
-function runStdGeometryTests( assert, geometries ) {
-
-	for ( var i = 0, l = geometries.length; i < l; i++ ) {
-
-		var geom = geometries[ i ];
-
-		checkFinite( geom );
-
-		// Clone
-		checkGeometryClone( geom );
-
-		// json round trip
-		checkGeometryJsonRoundtrip( geom );
-
-	}
-
-}
-
-
-
-
-//
-//	LIGHT TEST HELPERS
-//
-
-// Run common light tests.
-function runStdLightTests( lights ) {
-
-	for ( var i = 0, l = lights.length; i < l; i ++ ) {
-
-		var light = lights[ i ];
-
-		// copy and clone
-		checkLightCopyClone( light );
-
-		// THREE.Light doesn't get parsed by ObjectLoader as it's only
-		// used as an abstract base class - so we skip the JSON tests
-		if ( light.type !== "Light" ) {
-
-			// json round trip
-			checkLightJsonRoundtrip( light );
-
-		}
-
-	}
-
-}
-
-function checkLightCopyClone( light ) {
-
-	// copy
-	var newLight = new light.constructor( 0xc0ffee );
-	newLight.copy( light );
-
-	QUnit.assert.notEqual( newLight.uuid, light.uuid, "Copied light's UUID differs from original" );
-	QUnit.assert.notEqual( newLight.id, light.id, "Copied light's id differs from original" );
-	QUnit.assert.smartEqual( newLight, light, "Copied light is equal to original" );
-
-	// real copy?
-	newLight.color.setHex( 0xc0ffee );
-	QUnit.assert.notStrictEqual(
-		newLight.color.getHex(), light.color.getHex(), "Copied light is independent from original"
-	);
-
-	// Clone
-	var clone = light.clone(); // better get a new var
-	QUnit.assert.notEqual( clone.uuid, light.uuid, "Cloned light's UUID differs from original" );
-	QUnit.assert.notEqual( clone.id, light.id, "Clone light's id differs from original" );
-	QUnit.assert.smartEqual( clone, light, "Clone light is equal to original" );
-
-	// real clone?
-	clone.color.setHex( 0xc0ffee );
-	QUnit.assert.notStrictEqual(
-		clone.color.getHex(), light.color.getHex(), "Clone light is independent from original"
-	);
-
-	if ( light.type !== "Light" ) {
-
-		// json round trip with clone
-		checkLightJsonRoundtrip( clone );
-
-	}
-
-}
-
-// Compare json file with its source Light.
-function checkLightJsonWriting( light, json ) {
-
-	QUnit.assert.equal( json.metadata.version, "4.5", "check metadata version" );
-
-	var object = json.object;
-	QUnit.assert.equalKey( light, object, 'type' );
-	QUnit.assert.equalKey( light, object, 'uuid' );
-	QUnit.assert.equal( object.id, undefined, "should not persist id" );
-
-}
-
-// Check parsing and reconstruction of json Light
-function checkLightJsonReading( json, light ) {
-
-	var loader = new THREE.ObjectLoader();
-	var outputLight = loader.parse( json );
-
-	QUnit.assert.smartEqual( outputLight, light, 'Reconstruct Light from ObjectLoader' );
-
-}
-
-// Verify light -> json -> light
-function checkLightJsonRoundtrip( light ) {
-
-	var json = light.toJSON();
-	checkLightJsonWriting( light, json );
-	checkLightJsonReading( json, light );
-
-}

+ 0 - 34
test/unit/src/animation/AnimationAction.js

@@ -1,34 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AnimationAction")
-
-//QUnit.module( "AnimationAction" );
-//
-//QUnit.test( "Instancing", function( assert ) {
-//
-//    var mixer = new THREE.AnimationMixer();
-//    var clip = new THREE.AnimationClip();
-//
-//    assert.throws(
-//        function() {
-//            new THREE.AnimationAction()
-//        },
-//        new Error("Mixer can't be null or undefined !"),
-//        "raised error instance about undefined or null mixer"
-//    );
-//
-//    assert.throws(
-//        function() {
-//            new THREE.AnimationAction(mixer)
-//        },
-//        new Error("Clip can't be null or undefined !"),
-//        "raised error instance about undefined or null clip"
-//    );
-//
-//    var animationAction = new THREE.AnimationAction(mixer, clip);
-//    assert.ok( animationAction, "animationAction instanciated" );
-//
-//} );

+ 0 - 6
test/unit/src/animation/AnimationClip.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AnimationClip")

+ 0 - 6
test/unit/src/animation/AnimationMixer.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AnimationMixer")

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

@@ -1,107 +0,0 @@
-/**
- * @author tschw
- */
-
-QUnit.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 );
-
-
-QUnit.test( "smoke test", function( assert ) {
-
-	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;
-
-		}
-
-		assert.ok( pathsOk, testIndex + " paths" );
-		assert.ok( nodesOk, testIndex + " nodes");
-		assert.ok( group.nCachedObjects_ === cached, testIndex + " cache size" );
-		assert.ok( bindings.length - group.nCachedObjects_ === roots.length, testIndex + " object count" );
-
-	};
-
-	// initial state
-
-	var groupA = new THREE.AnimationObjectGroup();
-	assert.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 );
-	assert.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 );
-	assert.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 - 6
test/unit/src/animation/AnimationUtils.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AnimationUtils")

+ 0 - 6
test/unit/src/animation/KeyframeTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of KeyframeTrack")

+ 0 - 6
test/unit/src/animation/KeyframeTrackConstructor.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of KeyframeTrackConstructor")

+ 0 - 6
test/unit/src/animation/KeyframeTrackPrototype.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of KeyframeTrackPrototype")

+ 0 - 259
test/unit/src/animation/PropertyBinding.js

@@ -1,259 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-QUnit.module( 'PropertyBinding' );
-
-QUnit.test( 'parseTrackName' , function( assert ) {
-
-	var paths = [
-
-		[
-			'.property',
-			{
-				nodeName: undefined,
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'nodeName.property',
-			{
-				nodeName: 'nodeName',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'a.property',
-			{
-				nodeName: 'a',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'no.de.Name.property',
-			{
-				nodeName: 'no.de.Name',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'no.d-e.Name.property',
-			{
-				nodeName: 'no.d-e.Name',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'nodeName.property[accessor]',
-			{
-				nodeName: 'nodeName',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: 'accessor'
-			}
-		],
-
-		[
-			'nodeName.material.property[accessor]',
-			{
-				nodeName: 'nodeName',
-				objectName: 'material',
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: 'accessor'
-			}
-		],
-
-		[
-			'no.de.Name.material.property',
-			{
-				nodeName: 'no.de.Name',
-				objectName: 'material',
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'no.de.Name.material[materialIndex].property',
-			{
-				nodeName: 'no.de.Name',
-				objectName: 'material',
-				objectIndex: 'materialIndex',
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'uuid.property[accessor]',
-			{
-				nodeName: 'uuid',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: 'accessor'
-			}
-		],
-
-		[
-			'uuid.objectName[objectIndex].propertyName[propertyIndex]',
-			{
-				nodeName: 'uuid',
-				objectName: 'objectName',
-				objectIndex: 'objectIndex',
-				propertyName: 'propertyName',
-				propertyIndex: 'propertyIndex'
-			}
-		],
-
-		[
-			'parentName/nodeName.property',
-			{
-				// directoryName is currently unused.
-				nodeName: 'nodeName',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'parentName/no.de.Name.property',
-			{
-				// directoryName is currently unused.
-				nodeName: 'no.de.Name',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'parentName/parentName/nodeName.property[index]',
-			{
-				// directoryName is currently unused.
-				nodeName: 'nodeName',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'property',
-				propertyIndex: 'index'
-			}
-		],
-
-		[
-			'.bone[Armature.DEF_cog].position',
-			{
-				nodeName: undefined,
-				objectName: 'bone',
-				objectIndex: 'Armature.DEF_cog',
-				propertyName: 'position',
-				propertyIndex: undefined
-			}
-		],
-
-		[
-			'scene:helium_balloon_model:helium_balloon_model.position',
-			{
-				nodeName: 'helium_balloon_model',
-				objectName: undefined,
-				objectIndex: undefined,
-				propertyName: 'position',
-				propertyIndex: undefined
-			}
-		]
-	];
-
-	paths.forEach( function ( path, i ) {
-
-		assert.smartEqual(
-			THREE.PropertyBinding.parseTrackName( path[ 0 ] ),
-			path[ 1 ],
-			'Parses track name: ' +  path[ 0 ]
-		);
-
-	} );
-});
-
-QUnit.test( 'sanitizeNodeName' , function( assert ) {
-
-	assert.equal(
-		THREE.PropertyBinding.sanitizeNodeName( 'valid-name-123_' ),
-		'valid-name-123_',
-		'Leaves valid name intact.'
-	);
-
-	assert.equal(
-		THREE.PropertyBinding.sanitizeNodeName( 'space separated name 123_ -' ),
-		'space_separated_name_123__-',
-		'Replaces spaces with underscores.'
-	);
-
-	assert.equal(
-		THREE.PropertyBinding.sanitizeNodeName( '"invalid" name %123%_' ),
-		'invalid_name_123_',
-		'Strips invalid characters.'
-	);
-
-} );
-
-QUnit.test( 'setValue', function( assert ) {
-
-	var paths = [
-		'.material.opacity',
-		'.material[opacity]'
-	];
-
-	paths.forEach( function ( path, i ) {
-
-		var originalValue = 0;
-		var expectedValue = 1;
-
-		var geometry = new THREE.BoxGeometry();
-		var material = new THREE.MeshBasicMaterial();
-		material.opacity = originalValue;
-		var mesh = new THREE.Mesh( geometry, material );
-
-		var binding = new THREE.PropertyBinding( mesh, path, null );
-		binding.bind();
-
-		assert.equal(
-			material.opacity,
-			originalValue,
-			'Sets property of material with "' + path + '" (pre-setValue)'
-		);
-
-		binding.setValue( [ expectedValue ], 0 );
-		assert.equal(
-			material.opacity,
-			expectedValue,
-			'Sets property of material with "' + path + '" (post-setValue)'
-		);
-
-	} );
-
-} );

+ 0 - 6
test/unit/src/animation/PropertyMixer.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of PropertyMixer")

+ 0 - 6
test/unit/src/animation/tracks/BooleanKeyframeTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of BooleanKeyframeTrack")

+ 0 - 6
test/unit/src/animation/tracks/ColorKeyframeTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of ColorKeyframeTrack")

+ 0 - 6
test/unit/src/animation/tracks/NumberKeyframeTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of NumberKeyframeTrack")

+ 0 - 6
test/unit/src/animation/tracks/QuaternionKeyframeTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of QuaternionKeyframeTrack")

+ 0 - 6
test/unit/src/animation/tracks/StringKeyframeTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of StringKeyframeTrack")

+ 0 - 6
test/unit/src/animation/tracks/VectorKeyFrameTrack.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of VectorKeyFrameTrack")

+ 0 - 6
test/unit/src/audio/Audio.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Audio")

+ 0 - 6
test/unit/src/audio/AudioAnalyser.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AudioAnalyser")

+ 0 - 6
test/unit/src/audio/AudioContext.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AudioContext")

+ 0 - 6
test/unit/src/audio/AudioListener.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of AudioListener")

+ 0 - 6
test/unit/src/audio/PositionalAudio.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of PositionalAudio")

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

@@ -1,25 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "Camera" );
-
-QUnit.test( "lookAt" , function( assert ) {
-	var cam = new THREE.Camera();
-	cam.lookAt(new THREE.Vector3(0, 1, -1));
-
-	assert.numEqual( cam.rotation.x * ( 180 / Math.PI ), 45, "x is equal" );
-});
-
-QUnit.test( "clone" , function( assert ) {
-	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();
-
-	assert.ok( cam.matrixWorldInverse.equals(clonedCam.matrixWorldInverse) , "matrixWorldInverse is equal" );
-	assert.ok( cam.projectionMatrix.equals(clonedCam.projectionMatrix) , "projectionMatrix is equal" );
-});

+ 0 - 6
test/unit/src/cameras/CubeCamera.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of CubeCamera")

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

@@ -1,41 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "OrthographicCamera" );
-
-QUnit.test( "updateProjectionMatrix" , function( assert ) {
-	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
-
-	assert.ok( pMatrix[0] === 2 / ( right - left ), "m[0,0] === 2 / (r - l)" );
-	assert.ok( pMatrix[5] === 2 / ( top - bottom ), "m[1,1] === 2 / (t - b)" );
-	assert.ok( pMatrix[10] === -2 / ( far - near ), "m[2,2] === -2 / (f - n)" );
-	assert.ok( pMatrix[12] === - ( ( right + left ) / ( right - left ) ), "m[3,0] === -(r+l/r-l)" );
-	assert.ok( pMatrix[13] === - ( ( top + bottom ) / ( top - bottom ) ), "m[3,1] === -(t+b/b-t)" );
-	assert.ok( pMatrix[14] === - ( ( far + near ) / ( far - near ) ), "m[3,2] === -(f+n/f-n)" );
-});
-
-QUnit.test( "clone" , function( assert ) {
-	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();
-
-	assert.ok( cam.left === clonedCam.left , "left is equal" );
-	assert.ok( cam.right === clonedCam.right , "right is equal" );
-	assert.ok( cam.top === clonedCam.top , "top is equal" );
-	assert.ok( cam.bottom === clonedCam.bottom , "bottom is equal" );
-	assert.ok( cam.near === clonedCam.near , "near is equal" );
-	assert.ok( cam.far === clonedCam.far , "far is equal" );
-	assert.ok( cam.zoom === clonedCam.zoom , "zoom is equal" );
-});

+ 0 - 76
test/unit/src/cameras/PerspectiveCamera.js

@@ -1,76 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "PerspectiveCamera" );
-
-// see e.g. math/Matrix4.js
-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;
-
-};
-
-QUnit.test( "updateProjectionMatrix", function ( assert ) {
-
-	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
-	);
-
-	// assert.ok( reference.equals(m) );
-	assert.ok( matrixEquals4( reference, m, 0.000001 ) );
-
-} );
-
-QUnit.test( "clone" , function( assert ) {
-	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();
-
-	assert.ok( cam.fov === clonedCam.fov , "fov is equal" );
-	assert.ok( cam.aspect === clonedCam.aspect , "aspect is equal" );
-	assert.ok( cam.near === clonedCam.near , "near is equal" );
-	assert.ok( cam.far === clonedCam.far , "far is equal" );
-	assert.ok( cam.zoom === clonedCam.zoom , "zoom is equal" );
-	assert.ok( cam.projectionMatrix.equals(clonedCam.projectionMatrix) , "projectionMatrix is equal" );
-});

+ 0 - 6
test/unit/src/cameras/StereoCamera.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of StereoCamera")

+ 0 - 6
test/unit/src/constants.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Constants")

+ 0 - 239
test/unit/src/core/BufferAttribute.js

@@ -1,239 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "BufferAttribute" );
-
-QUnit.test( "count" , function( assert ) {
-	assert.ok(
-		new THREE.BufferAttribute( new Float32Array( [1, 2, 3, 4, 5, 6] ), 3 ).count === 2,
-		'count is equal to the number of chunks'
-	);
-});
-
-QUnit.test( "copy" , function( assert ) {
-	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 );
-
-	assert.ok( attr.count === attrCopy.count, 'count is equal' );
-	assert.ok( attr.itemSize === attrCopy.itemSize, 'itemSize is equal' );
-	assert.ok( attr.dynamic === attrCopy.dynamic, 'dynamic is equal' );
-	assert.ok( attr.array.length === attrCopy.array.length, 'array length is equal' );
-	assert.ok( attr.version === 1 && attrCopy.version === 0, 'version is not copied which is good' );
-});
-
-QUnit.test( "copyAt" , function( assert ) {
-	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]
-
-	assert.ok( i2[0] === i[3] && i2[1] === i[4] && i2[2] === i[5], 'chunck copied to correct place' );
-	assert.ok( i2[3] === i[6] && i2[4] === i[7] && i2[5] === i[8], 'chunck copied to correct place' );
-	assert.ok( i2[6] === i[0] && i2[7] === i[1] && i2[8] === i[2], 'chunck copied to correct place' );
-});
-
-QUnit.test( "copyColorsArray" , function( assert ) {
-	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;
-	assert.ok( i[0] === 0 && i[1] === 0.5 && i[2] === 1, 'first color was copied correctly' );
-	assert.ok( i[3] === 0.25 && i[4] === 1 && i[5] === 0, 'second color was copied correctly' );
-});
-
-QUnit.test( "copyIndicesArray" , function( assert ) {
-	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;
-	assert.ok( i[0] === 1 && i[1] === 2 && i[2] === 3, 'first indices were copied correctly' );
-	assert.ok( i[3] === 4 && i[4] === 5 && i[5] === 6, 'second indices were copied correctly' );
-});
-
-QUnit.test( "copyVector2sArray" , function( assert ) {
-	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;
-	assert.ok( i[0] === 1 && i[1] === 2, 'first vector was copied correctly' );
-	assert.ok( i[2] === 4 && i[3] === 5, 'second vector was copied correctly' );
-});
-
-QUnit.test( "copyVector3sArray" , function( assert ) {
-	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;
-	assert.ok( i[0] === 1 && i[1] === 2 && i[2] === 3, 'first vector was copied correctly' );
-	assert.ok( i[3] === 10 && i[4] === 20 && i[5] === 30, 'second vector was copied correctly' );
-});
-
-QUnit.test( "copyVector4sArray" , function( assert ) {
-	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;
-	assert.ok( i[0] === 1 && i[1] === 2 && i[2] === 3 && i[3] === 4, 'first vector was copied correctly' );
-	assert.ok( i[4] === 10 && i[5] === 20 && i[6] === 30 && i[7] === 40, 'second vector was copied correctly' );
-});
-
-QUnit.test( "clone" , function( assert ) {
-	var attr = new THREE.BufferAttribute( new Float32Array([1, 2, 3, 4, 0.12, -12]), 2 );
-	var attrCopy = attr.clone();
-
-	assert.ok( attr.array.length === attrCopy.array.length, 'attribute was cloned' );
-	for ( var i = 0; i < attr.array.length; i++ ) {
-		assert.ok( attr.array[i] === attrCopy.array[i], 'array item is equal' );
-	}
-});
-
-QUnit.test( "constructor exception", function ( assert ) {
-
-	assert.throws(
-		function () {
-
-			var a = new THREE.BufferAttribute( [ 1, 2, 3, 4 ], 2, false );
-
-		},
-		/array should be a Typed Array/,
-		"Calling constructor with a simple array throws Error"
-	);
-
-} );
-
-QUnit.test( "setArray", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4 ] );
-	var a = new THREE.BufferAttribute( f32a, 2, false );
-
-	a.setArray( f32a, 2 );
-
-	assert.strictEqual( a.count, 2, "Check item count" );
-	assert.strictEqual( a.array, f32a, "Check array" );
-
-	assert.throws(
-		function () {
-
-			a.setArray( [ 1, 2, 3, 4 ] );
-
-		},
-		/array should be a Typed Array/,
-		"Calling setArray with a simple array throws Error"
-	);
-
-} );
-
-QUnit.test( "copyArray", function ( assert ) {
-
-	var f32a = new Float32Array( [ 5, 6, 7, 8 ] );
-	var a = new THREE.BufferAttribute( new Float32Array( [ 1, 2, 3, 4 ] ), 2, false );
-
-	a.copyArray( f32a );
-
-	assert.deepEqual( a.array, f32a, "Check array has new values" );
-
-} );
-
-QUnit.test( "set", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4 ] );
-	var a = new THREE.BufferAttribute( f32a, 2, false );
-	var expected = new Float32Array( [ 9, 2, 8, 4 ] );
-
-	a.set( [ 9 ] );
-	a.set( [ 8 ], 2 );
-
-	assert.deepEqual( a.array, expected, "Check array has expected values" );
-
-} );
-
-QUnit.test( "set[X, Y, Z, W, XYZ, XYZW]/get[X, Y, Z, W]", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4, 5, 6, 7, 8 ] );
-	var a = new THREE.BufferAttribute( f32a, 4, false );
-	var expected = new Float32Array( [ 1, 2, - 3, - 4, - 5, - 6, 7, 8 ] );
-
-	a.setX( 1, a.getX( 1 ) * - 1 );
-	a.setY( 1, a.getY( 1 ) * - 1 );
-	a.setZ( 0, a.getZ( 0 ) * - 1 );
-	a.setW( 0, a.getW( 0 ) * - 1 );
-
-	assert.deepEqual( a.array, expected, "Check all set* calls set the correct values" );
-
-} );
-
-QUnit.test( "setXY", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4 ] );
-	var a = new THREE.BufferAttribute( f32a, 2, false );
-	var expected = new Float32Array( [ - 1, - 2, 3, 4 ] );
-
-	a.setXY( 0, - 1, - 2 );
-
-	assert.deepEqual( a.array, expected, "Check for the correct values" );
-
-} );
-
-QUnit.test( "setXYZ", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4, 5, 6 ] );
-	var a = new THREE.BufferAttribute( f32a, 3, false );
-	var expected = new Float32Array( [ 1, 2, 3, - 4, - 5, - 6 ] );
-
-	a.setXYZ( 1, - 4, - 5, - 6 );
-
-	assert.deepEqual( a.array, expected, "Check for the correct values" );
-
-} );
-
-QUnit.test( "setXYZW", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4 ] );
-	var a = new THREE.BufferAttribute( f32a, 4, false );
-	var expected = new Float32Array( [ - 1, - 2, - 3, - 4 ] );
-
-	a.setXYZW( 0, - 1, - 2, - 3, - 4 );
-
-	assert.deepEqual( a.array, expected, "Check for the correct values" );
-
-} );
-
-QUnit.test( "onUpload", function ( assert ) {
-
-	var a = new THREE.BufferAttribute();
-	var func = function () { };
-
-	a.onUpload( func );
-
-	assert.strictEqual( a.onUploadCallback, func, "Check callback was set properly" );
-
-} );

+ 0 - 837
test/unit/src/core/BufferGeometry.js

@@ -1,837 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "BufferGeometry" );
-
-var DegToRad = Math.PI / 180;
-
-var bufferAttributeEquals = function ( a, b, tolerance ) {
-
-	tolerance = tolerance || 0.0001;
-
-	if ( a.count !== b.count || a.itemSize !== b.itemSize ) {
-
-		return false;
-
-	}
-
-	for ( var i = 0, il = a.count * a.itemSize; i < il; i ++ ) {
-
-		var delta = a[ i ] - b[ i ];
-		if ( delta > tolerance ) {
-
-			return false;
-
-		}
-
-	}
-
-	return true;
-
-};
-
-QUnit.test( "add / delete Attribute", function( assert ) {
-	var geometry = new THREE.BufferGeometry();
-	var attributeName = "position";
-
-	assert.ok ( geometry.attributes[attributeName] === undefined , 'no attribute defined' );
-
-	geometry.addAttribute( attributeName, new THREE.BufferAttribute( new Float32Array( [1, 2, 3], 1 ) ) );
-
-	assert.ok ( geometry.attributes[attributeName] !== undefined , 'attribute is defined' );
-
-	geometry.removeAttribute( attributeName );
-
-	assert.ok ( geometry.attributes[attributeName] === undefined , 'no attribute defined' );
-});
-
-QUnit.test( "applyMatrix" , function( assert ) {
-	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;
-	assert.ok( position[0] === m[12] && position[1] === m[13] && position[2] === m[14], "position was extracted from matrix" );
-	assert.ok( position[3] === m[12] && position[4] === m[13] && position[5] === m[14], "position was extracted from matrix twice" );
-	assert.ok( geometry.attributes.position.version === 1, "version was increased during update" );
-});
-
-QUnit.test( "rotateX/Y/Z", function( assert ) {
-	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
-	assert.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
-	assert.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
-	assert.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" );
-});
-
-
-QUnit.test( "translate" , function( assert ) {
-	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 );
-
-	assert.ok( pos[0] === 11 && pos[1] === 22 && pos[2] === 33 &&
-			pos[3] === 14 && pos[4] === 25 && pos[5] === 36, "vertices were translated" );
-});
-
-QUnit.test( "scale" , function( assert ) {
-	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 );
-
-	assert.ok( pos[0] === -1 && pos[1] === -2 && pos[2] === -3 &&
-			pos[3] === 2 && pos[4] === 4 && pos[5] === 6, "vertices were scaled" );
-});
-
-QUnit.test( "center" , function( assert ) {
-	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)
-	assert.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" );
-});
-
-QUnit.test( "setFromObject" , function( assert ) {
-	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;
-
-	assert.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" );
-
-	assert.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" );
-});
-
-QUnit.test( "computeBoundingBox" , function( assert ) {
-	var bb = getBBForVertices( [-1, -2, -3, 13, -2, -3.5, -1, -20, 0, -4, 5, 6] );
-
-	assert.ok( bb.min.x === -4 && bb.min.y === -20 && bb.min.z === -3.5, "min values are set correctly" );
-	assert.ok( bb.max.x === 13 && bb.max.y === 5 && bb.max.z === 6, "max values are set correctly" );
-
-
-	bb = getBBForVertices( [-1, -1, -1] );
-
-	assert.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" );
-	assert.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" );
-});
-
-QUnit.test( "computeBoundingSphere" , function( assert ) {
-	var bs = getBSForVertices( [-10, 0, 0, 10, 0, 0] );
-
-	assert.ok( bs.radius === (10 + 10) / 2, "radius is equal to deltaMinMax / 2" )
-	assert.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();
-
-	assert.ok( bs.radius === radius, "radius is equal to directionLength" )
-	assert.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;
-}
-
-QUnit.test( "computeVertexNormals" , function( assert ) {
-	// get normals for a counter clockwise created triangle
-	var normals = getNormalsForVertices([-1, 0, 0, 1, 0, 0, 0, 1, 0], assert);
-
-	assert.ok( normals[0] === 0 && normals[1] === 0 && normals[2] === 1,
-		"first normal is pointing to screen since the the triangle was created counter clockwise" );
-
-	assert.ok( normals[3] === 0 && normals[4] === 0 && normals[5] === 1,
-		"second normal is pointing to screen since the the triangle was created counter clockwise" );
-
-	assert.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], assert);
-
-	assert.ok( normals[0] === 0 && normals[1] === 0 && normals[2] === -1,
-		"first normal is pointing to screen since the the triangle was created clockwise" );
-
-	assert.ok( normals[3] === 0 && normals[4] === 0 && normals[5] === -1,
-		"second normal is pointing to screen since the the triangle was created clockwise" );
-
-	assert.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], assert);
-
-	// 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] ) );
-	assert.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], assert);
-	for (var i = 0; i < normals.length; i++) {
-		assert.ok ( !normals[i], "normals can't be calculated which is good");
-	}
-});
-
-function getNormalsForVertices(vertices, assert) {
-	var geometry = new THREE.BufferGeometry();
-
-	geometry.addAttribute( "position", new THREE.BufferAttribute( new Float32Array(vertices), 3 ) );
-
-	geometry.computeVertexNormals();
-
-	assert.ok( geometry.attributes.normal !== undefined, "normal attribute was created" );
-
-	return geometry.attributes.normal.array;
-}
-
-QUnit.test( "merge" , function( assert ) {
-	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++) {
-	  assert.ok( attr[i] === i + 1, "");
-	}
-
-	geometry1.merge(geometry2);
-	assert.ok( attr[0] === 4 && attr[1] === 5 && attr[2] === 6, "copied the 3 attributes without offset" );
-});
-
-QUnit.test( "copy" , function( assert ) {
-	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);
-
-	assert.ok( copy !== geometry && geometry.id !== copy.id, "new object was created" );
-
-	Object.keys(geometry.attributes).forEach(function(key) {
-		var attribute = geometry.attributes[key];
-		assert.ok( attribute !== undefined, "all attributes where copied");
-
-		for (var i = 0; i < attribute.array.length; i++) {
-			assert.ok( attribute.array[i] === copy.attributes[key].array[i], "values of the attribute are equal" );
-		}
-	});
-});
-
-QUnit.test( "setIndex/getIndex", function ( assert ) {
-
-	var a = new THREE.BufferGeometry();
-	var uint16 = [ 1, 2, 3 ];
-	var uint32 = [ 65535, 65536, 65537 ];
-	var str = "foo";
-
-	a.setIndex( uint16 );
-	assert.ok( a.getIndex() instanceof THREE.Uint16BufferAttribute, "Index has the right type" );
-	assert.deepEqual( a.getIndex().array, new Uint16Array( uint16 ), "Small index gets stored correctly" );
-
-	a.setIndex( uint32 );
-	assert.ok( a.getIndex() instanceof THREE.Uint32BufferAttribute, "Index has the right type" );
-	assert.deepEqual( a.getIndex().array, new Uint32Array( uint32 ), "Large index gets stored correctly" );
-
-	a.setIndex( str );
-	assert.strictEqual( a.getIndex(), str, "Weird index gets stored correctly" );
-
-} );
-
-QUnit.test( "addGroup", function ( assert ) {
-
-	var a = new THREE.BufferGeometry();
-	var expected = [
-		{ start: 0, count: 1, materialIndex: 0 },
-		{ start: 1, count: 2, materialIndex: 2 }
-	];
-
-	a.addGroup( 0, 1, 0 );
-	a.addGroup( 1, 2, 2 );
-
-	assert.deepEqual( a.groups, expected, "Check groups were stored correctly and in order" );
-
-	a.clearGroups();
-	assert.strictEqual( a.groups.length, 0, "Check groups were deleted correctly" );
-
-} );
-
-QUnit.test( "setDrawRange", function ( assert ) {
-
-	var a = new THREE.BufferGeometry();
-
-	a.setDrawRange( 1.0, 7 );
-
-	assert.deepEqual( a.drawRange, { start: 1, count: 7 }, "Check draw range was stored correctly" );
-
-} );
-
-QUnit.test( "lookAt", function ( assert ) {
-
-	var a = new THREE.BufferGeometry();
-	var vertices = new Float32Array( [
-		- 1.0, - 1.0, 1.0,
-		1.0, - 1.0, 1.0,
-		1.0, 1.0, 1.0,
-
-		1.0, 1.0, 1.0,
-		- 1.0, 1.0, 1.0,
-		- 1.0, - 1.0, 1.0
-	] );
-	a.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
-
-	var sqrt = Math.sqrt( 2 );
-	var expected = new Float32Array( [
-		1, 0, - sqrt,
-		- 1, 0, - sqrt,
-		- 1, sqrt, 0,
-
-		- 1, sqrt, 0,
-		1, sqrt, 0,
-		1, 0, - sqrt
-	] );
-
-	a.lookAt( new THREE.Vector3( 0, 1, - 1 ) );
-
-	assert.ok( bufferAttributeEquals( a.attributes.position.array, expected ), "Rotation is correct" );
-
-} );
-
-QUnit.test( "fromGeometry/fromDirectGeometry", function ( assert ) {
-
-	var a = new THREE.BufferGeometry();
-	// BoxGeometry is a bit too simple but works fine in a pinch
-	// var b = new THREE.BoxGeometry( 1, 1, 1 );
-	// b.mergeVertices();
-	// b.computeVertexNormals();
-	// b.computeBoundingBox();
-	// b.computeBoundingSphere();
-	var asyncDone = assert.async(); // tell QUnit we're done with asserts
-
-	var loader = new THREE.JSONLoader();
-	loader.load( "../../examples/models/skinned/simple/simple.js", function ( modelGeometry ) {
-
-		a.fromGeometry( modelGeometry );
-
-		var attr;
-		var geometry = new THREE.DirectGeometry().fromGeometry( modelGeometry );
-
-		var positions = new Float32Array( geometry.vertices.length * 3 );
-		attr = new THREE.BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices );
-		assert.ok( bufferAttributeEquals( a.attributes.position, attr ), "Vertices are identical" );
-
-		if ( geometry.normals.length > 0 ) {
-
-			var normals = new Float32Array( geometry.normals.length * 3 );
-			attr = new THREE.BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals );
-			assert.ok( bufferAttributeEquals( a.attributes.normal, attr ), "Normals are identical" );
-
-		}
-
-		if ( geometry.colors.length > 0 ) {
-
-			var colors = new Float32Array( geometry.colors.length * 3 );
-			attr = new THREE.BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors );
-			assert.ok( bufferAttributeEquals( a.attributes.color, attr ), "Colors are identical" );
-
-		}
-
-		if ( geometry.uvs.length > 0 ) {
-
-			var uvs = new Float32Array( geometry.uvs.length * 2 );
-			attr = new THREE.BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs );
-			assert.ok( bufferAttributeEquals( a.attributes.uv, attr ), "UVs are identical" );
-
-		}
-
-		if ( geometry.uvs2.length > 0 ) {
-
-			var uvs2 = new Float32Array( geometry.uvs2.length * 2 );
-			attr = new THREE.BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 );
-			assert.ok( bufferAttributeEquals( a.attributes.uv2, attr ), "UV2s are identical" );
-
-		}
-
-		if ( geometry.indices.length > 0 ) {
-
-			var TypeArray = THREE.arrayMax( geometry.indices ) > 65535 ? Uint32Array : Uint16Array;
-			var indices = new TypeArray( geometry.indices.length * 3 );
-			attr = new THREE.BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices );
-			assert.ok( bufferAttributeEquals( a.indices, attr ), "Indices are identical" );
-
-		}
-
-		// groups
-		assert.deepEqual( a.groups, geometry.groups, "Groups are identical" );
-
-		// morphs
-		if ( geometry.morphTargets !== undefined ) {
-
-			for ( var name in geometry.morphTargets ) {
-
-				var morphTargets = geometry.morphTargets[ name ];
-
-				for ( var i = 0, l = morphTargets.length; i < l; i ++ ) {
-
-					var morphTarget = morphTargets[ i ];
-
-					attr = new THREE.Float32BufferAttribute( morphTarget.length * 3, 3 );
-					attr.copyVector3sArray( morphTarget );
-
-					assert.ok(
-						bufferAttributeEquals( a.morphAttributes[ name ][ i ], attr ),
-						"MorphTargets #" + i + " are identical"
-					);
-
-				}
-
-			}
-
-		}
-
-		// skinning
-		if ( geometry.skinIndices.length > 0 ) {
-
-			attr = new THREE.Float32BufferAttribute( geometry.skinIndices.length * 4, 4 );
-			attr.copyVector4sArray( geometry.skinIndices );
-			assert.ok( bufferAttributeEquals( a.attributes.skinIndex, attr ), "SkinIndices are identical" );
-
-		}
-
-		if ( geometry.skinWeights.length > 0 ) {
-
-			attr = new THREE.Float32BufferAttribute( geometry.skinWeights.length * 4, 4 );
-			attr.copyVector4sArray( geometry.skinWeights );
-			assert.ok( bufferAttributeEquals( a.attributes.skinWeight, attr ), "SkinWeights are identical" );
-
-		}
-
-		// TODO
-		// DirectGeometry doesn't actually copy boundingSphere and boundingBox yet,
-		// so they're always null
-		if ( geometry.boundingSphere !== null ) {
-
-			assert.ok( a.boundingSphere.equals( geometry.boundingSphere ), "BoundingSphere is identical" );
-
-		}
-
-		if ( geometry.boundingBox !== null ) {
-
-			assert.ok( a.boundingBox.equals( geometry.boundingBox ), "BoundingBox is identical" );
-
-		}
-
-		asyncDone();
-
-	} );
-
-} );
-
-QUnit.test( "clone", function ( assert ) {
-
-	var a = new THREE.BufferGeometry();
-	a.addAttribute( "attribute1", new THREE.BufferAttribute( new Float32Array( [ 1, 2, 3, 4, 5, 6 ] ), 3 ) );
-	a.addAttribute( "attribute2", new THREE.BufferAttribute( new Float32Array( [ 0, 1, 3, 5, 6 ] ), 1 ) );
-	a.addGroup( 0, 1, 2 );
-	a.computeBoundingBox();
-	a.computeBoundingSphere();
-	a.setDrawRange( 0, 1 );
-	var b = a.clone();
-
-	assert.notEqual( a, b, "A new object was created" );
-	assert.notEqual( a.id, b.id, "New object has a different GUID" );
-
-	assert.strictEqual(
-		Object.keys( a.attributes ).count, Object.keys( b.attributes ).count,
-		"Both objects have the same amount of attributes"
-	);
-	assert.ok(
-		bufferAttributeEquals( a.getAttribute( "attribute1" ), b.getAttribute( "attribute1" ) ),
-		"First attributes buffer is identical"
-	);
-	assert.ok(
-		bufferAttributeEquals( a.getAttribute( "attribute2" ), b.getAttribute( "attribute2" ) ),
-		"Second attributes buffer is identical"
-	);
-
-	assert.deepEqual( a.groups, b.groups, "Groups are identical" );
-
-	assert.ok( a.boundingBox.equals( b.boundingBox ), "BoundingBoxes are equal" );
-	assert.ok( a.boundingSphere.equals( b.boundingSphere ), "BoundingSpheres are equal" );
-
-	assert.strictEqual( a.drawRange.start, b.drawRange.start, "DrawRange start is identical" );
-	assert.strictEqual( a.drawRange.count, b.drawRange.count, "DrawRange count is identical" );
-
-} );
-
-QUnit.test( "computeVertexNormals (indexed)", function ( assert ) {
-
-	var sqrt = 0.5 * Math.sqrt( 2 );
-	var normal = new THREE.BufferAttribute( new Float32Array( [
-		- 1, 0, 0, - 1, 0, 0, - 1, 0, 0,
-		sqrt, sqrt, 0, sqrt, sqrt, 0, sqrt, sqrt, 0,
-		- 1, 0, 0
-	] ), 3 );
-	var position = new THREE.BufferAttribute( new Float32Array( [
-		0.5, 0.5, 0.5, 0.5, 0.5, - 0.5, 0.5, - 0.5, 0.5,
-		0.5, - 0.5, - 0.5, - 0.5, 0.5, - 0.5, - 0.5, 0.5, 0.5,
-		- 0.5, - 0.5, - 0.5
-	] ), 3 );
-	var index = new THREE.BufferAttribute( new Uint16Array( [
-		0, 2, 1, 2, 3, 1, 4, 6, 5, 6, 7, 5
-	] ), 1 );
-
-	var a = new THREE.BufferGeometry();
-	a.addAttribute( "position", position );
-	a.computeVertexNormals();
-	assert.ok(
-		bufferAttributeEquals( normal, a.getAttribute( "normal" ) ),
-		"Regular geometry: first computed normals are correct"
-	);
-
-	// a second time to see if the existing normals get properly deleted
-	a.computeVertexNormals();
-	assert.ok(
-		bufferAttributeEquals( normal, a.getAttribute( "normal" ) ),
-		"Regular geometry: second computed normals are correct"
-	);
-
-	// indexed geometry
-	a = new THREE.BufferGeometry();
-	a.addAttribute( "position", position );
-	a.setIndex( index );
-	a.computeVertexNormals();
-	assert.ok( bufferAttributeEquals( normal, a.getAttribute( "normal" ) ), "Indexed geometry: computed normals are correct" );
-
-} );
-
-QUnit.test( "toJSON", function ( assert ) {
-
-	var index = new THREE.BufferAttribute( new Uint16Array( [ 0, 1, 2, 3 ] ), 1 );
-	var attribute1 = new THREE.BufferAttribute( new Uint16Array( [ 1, 3, 5, 7 ] ), 1 );
-	var a = new THREE.BufferGeometry();
-	a.name = "JSONtest";
-	// a.parameters = { "placeholder": 0 };
-	a.addAttribute( "attribute1", attribute1 );
-	a.setIndex( index );
-	a.addGroup( 0, 1, 2 );
-	a.boundingSphere = new THREE.Sphere( new THREE.Vector3( x, y, z ), 0.5 );
-	var j = a.toJSON();
-
-	var gold = {
-		"metadata": { "version": 4.5, "type": "BufferGeometry", "generator": "BufferGeometry.toJSON" },
-		"uuid": a.uuid,
-		"type": "BufferGeometry",
-		"name": "JSONtest",
-		"data": {
-			"attributes": {
-				"attribute1": {
-					"itemSize": 1,
-					"type": "Uint16Array",
-					"array": [ 1, 3, 5, 7 ],
-					"normalized": false
-				}
-			},
-			"index": { "type": "Uint16Array", "array": [ 0, 1, 2, 3 ] },
-			"groups": [ { "start": 0, "count": 1, "materialIndex": 2 } ],
-			"boundingSphere": { "center": [ 2, 3, 4 ], "radius": 0.5 }
-		}
-	};
-
-	assert.deepEqual( j, gold, "Generated JSON is as expected" );
-
-} );
-
-function comparePositions( pos, v ) {
-
-	return (
-		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
-	);
-
-}
-
-function compareColors( col, c ) {
-
-	return (
-		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
-	);
-
-}
-
-function compareUvs( uvs, u ) {
-
-	return (
-		uvs[ 0 ] === u[ 0 ].x && uvs[ 1 ] === u[ 0 ].y &&
-		uvs[ 2 ] === u[ 1 ].x && uvs[ 3 ] === u[ 1 ].y &&
-		uvs[ 4 ] === u[ 2 ].x && uvs[ 5 ] === u[ 2 ].y
-	);
-
-}
-
-QUnit.test( "setFromObject (more)", function ( assert ) {
-
-	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 )
-	);
-
-	lineGeo.computeBoundingBox();
-	lineGeo.computeBoundingSphere();
-
-	var line = new THREE.Line( lineGeo );
-	var geometry = new THREE.BufferGeometry().setFromObject( line );
-
-	assert.ok( geometry.boundingBox.equals( lineGeo.boundingBox ), "BoundingBox was set correctly" );
-	assert.ok( geometry.boundingSphere.equals( lineGeo.boundingSphere ), "BoundingSphere was set correctly" );
-
-	var pos = geometry.attributes.position.array;
-	var col = geometry.attributes.color.array;
-	var v = lineGeo.vertices;
-	var c = lineGeo.colors;
-
-	// adapted from setFromObject test (way up)
-	assert.notStrictEqual( pos, undefined, "Position attribute exists" );
-	assert.strictEqual( v.length * 3, pos.length, "Vertex arrays have the same size" );
-	assert.strictEqual( geometry.attributes.position.count, 3, "Correct number of vertices" );
-	assert.ok( comparePositions( pos, v ), "Positions are identical" );
-
-	assert.notStrictEqual( col, undefined, "Color attribute exists" );
-	assert.strictEqual( c.length * 3, col.length, "Color arrays have the same size" );
-	assert.strictEqual( geometry.attributes.color.count, 3, "Correct number of colors" );
-	assert.ok( compareColors( col, c ), "Colors are identical" );
-
-	// setFromObject with a Mesh as object
-	lineGeo.faces.push( new THREE.Face3( 0, 1, 2 ) );
-	var lineMesh = new THREE.Mesh( lineGeo );
-	geometry = new THREE.BufferGeometry().setFromObject( lineMesh );
-
-	// no colors
-	pos = geometry.attributes.position.array;
-	v = lineGeo.vertices;
-
-	assert.notStrictEqual( pos, undefined, "Mesh: position attribute exists" );
-	assert.strictEqual( v.length * 3, pos.length, "Mesh: vertex arrays have the same size" );
-	assert.strictEqual( geometry.attributes.position.count, 3, "Mesh: correct number of vertices" );
-	assert.ok( comparePositions( pos, v ), "Mesh: positions are identical" );
-
-} );
-
-QUnit.test( "updateFromObject", function ( assert ) {
-
-	var geo = new THREE.Geometry();
-
-	geo.vertices.push(
-		new THREE.Vector3( - 10, 0, 0 ),
-		new THREE.Vector3( 0, 10, 0 ),
-		new THREE.Vector3( 10, 0, 0 )
-	);
-
-	geo.faces.push( new THREE.Face3( 0, 1, 2 ) );
-
-	geo.faces[ 0 ].vertexColors.push(
-		new THREE.Color( 1, 0, 0 ),
-		new THREE.Color( 0, 1, 0 ),
-		new THREE.Color( 0, 0, 1 )
-	);
-
-	geo.faceVertexUvs[ 0 ] = [[
-		new THREE.Vector2( 0, 0 ),
-		new THREE.Vector2( 1, 0 ),
-		new THREE.Vector2( 1, 1 )
-	]];
-
-	geo.computeFaceNormals();
-	geo.computeVertexNormals();
-
-	geo.verticesNeedUpdate = true;
-	geo.normalsNeedUpdate = true;
-	geo.colorsNeedUpdate = true;
-	geo.uvsNeedUpdate = true;
-	geo.groupsNeedUpdate = true;
-
-	var mesh = new THREE.Mesh( geo );
-	var geometry = new THREE.BufferGeometry();
-
-	geometry.updateFromObject( mesh ); // first call to create the underlying structure (DirectGeometry)
-	geometry.updateFromObject( mesh ); // second time to actually go thru the motions and update
-
-	var pos = geometry.attributes.position.array;
-	var col = geometry.attributes.color.array;
-	var norm = geometry.attributes.normal.array;
-	var uvs = geometry.attributes.uv.array;
-	var v = geo.vertices;
-	var c = geo.faces[ 0 ].vertexColors;
-	var n = geo.faces[ 0 ].vertexNormals;
-	var u = geo.faceVertexUvs[ 0 ][ 0 ];
-
-	assert.notStrictEqual( pos, undefined, "Position attribute exists" );
-	assert.strictEqual( v.length * 3, pos.length, "Both arrays have the same size" );
-	assert.strictEqual( geometry.attributes.position.count, v.length, "Correct number of vertices" );
-	assert.ok( comparePositions( pos, v ), "Positions are identical" );
-
-	assert.notStrictEqual( col, undefined, "Color attribute exists" );
-	assert.strictEqual( c.length * 3, col.length, "Both arrays have the same size" );
-	assert.strictEqual( geometry.attributes.color.count, c.length, "Correct number of colors" );
-	assert.ok( compareColors( col, c ), "Colors are identical" );
-
-	assert.notStrictEqual( norm, undefined, "Normal attribute exists" );
-	assert.strictEqual( n.length * 3, norm.length, "Both arrays have the same size" );
-	assert.strictEqual( geometry.attributes.normal.count, n.length, "Correct number of normals" );
-	assert.ok( comparePositions( norm, n ), "Normals are identical" );
-
-	assert.notStrictEqual( uvs, undefined, "UV attribute exists" );
-	assert.strictEqual( u.length * 2, uvs.length, "Both arrays have the same size" );
-	assert.strictEqual( geometry.attributes.uv.count, u.length, "Correct number of UV coordinates" );
-	assert.ok( compareUvs( uvs, u ), "UVs are identical" );
-
-} );
-
-QUnit.test( "toNonIndexed", function ( assert ) {
-
-	var geometry = new THREE.BufferGeometry();
-	var vertices = new Float32Array( [
-		0.5, 0.5, 0.5, 0.5, 0.5, - 0.5, 0.5, - 0.5, 0.5, 0.5, - 0.5, - 0.5
-	] );
-	var index = new THREE.BufferAttribute( new Uint16Array( [ 0, 2, 1, 2, 3, 1 ] ) );
-	var expected = new Float32Array( [
-		0.5, 0.5, 0.5, 0.5, - 0.5, 0.5, 0.5, 0.5, - 0.5,
-		0.5, - 0.5, 0.5, 0.5, - 0.5, - 0.5, 0.5, 0.5, - 0.5
-	] );
-
-	geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
-	geometry.setIndex( index );
-
-	var nonIndexed = geometry.toNonIndexed();
-
-	assert.deepEqual( nonIndexed.getAttribute( "position" ).array, expected, "Expected vertices" );
-
-} );

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

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

+ 0 - 224
test/unit/src/core/DirectGeometry.js

@@ -1,224 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "DirectGeometry" );
-
-QUnit.test( "computeGroups", function ( assert ) {
-
-	var a = new THREE.DirectGeometry();
-	var b = new THREE.Geometry();
-	var expected = [
-		{ start: 0, materialIndex: 0, count: 3 },
-		{ start: 3, materialIndex: 1, count: 3 },
-		{ start: 6, materialIndex: 2, count: 6 }
-	];
-
-	// we only care for materialIndex
-	b.faces.push(
-		new THREE.Face3( 0, 0, 0, undefined, undefined, 0 ),
-		new THREE.Face3( 0, 0, 0, undefined, undefined, 1 ),
-		new THREE.Face3( 0, 0, 0, undefined, undefined, 2 ),
-		new THREE.Face3( 0, 0, 0, undefined, undefined, 2 )
-	);
-
-	a.computeGroups( b );
-
-	assert.deepEqual( a.groups, expected, "Groups are as expected" );
-
-} );
-
-QUnit.test( "fromGeometry", function ( assert ) {
-
-	var a = new THREE.DirectGeometry();
-
-	var asyncDone = assert.async(); // tell QUnit when we're done with async stuff
-
-	var loader = new THREE.JSONLoader();
-	loader.load( "../../examples/models/skinned/simple/simple.js", function ( geometry ) {
-
-		a.fromGeometry( geometry );
-
-		var tmp = new THREE.DirectGeometry();
-		tmp.computeGroups( geometry );
-		assert.deepEqual( a.groups, tmp.groups, "Check groups" );
-
-		var morphTargets = geometry.morphTargets;
-		var morphTargetsLength = morphTargets.length;
-
-		var morphTargetsPosition;
-
-		if ( morphTargetsLength > 0 ) {
-
-			morphTargetsPosition = [];
-
-			for ( var i = 0; i < morphTargetsLength; i ++ ) {
-
-				morphTargetsPosition[ i ] = [];
-
-			}
-
-			morphTargets.position = morphTargetsPosition;
-
-		}
-
-		var morphNormals = geometry.morphNormals;
-		var morphNormalsLength = morphNormals.length;
-
-		var morphTargetsNormal;
-
-		if ( morphNormalsLength > 0 ) {
-
-			morphTargetsNormal = [];
-
-			for ( var i = 0; i < morphNormalsLength; i ++ ) {
-
-				morphTargetsNormal[ i ] = [];
-
-			}
-
-			morphTargets.normal = morphTargetsNormal;
-
-		}
-
-		var vertices = [];
-		var normals = [];
-		var colors = [];
-		var uvs = [];
-		var uvs2 = [];
-		var skinIndices = [];
-		var skinWeights = [];
-
-		var hasFaceVertexUv = geometry.faceVertexUvs[ 0 ] && geometry.faceVertexUvs[ 0 ].length > 0;
-		var hasFaceVertexUv2 = geometry.faceVertexUvs[ 1 ] && geometry.faceVertexUvs[ 1 ].length > 0;
-
-		var hasSkinIndices = geometry.skinIndices.length === geometry.vertices.length;
-		var hasSkinWeights = geometry.skinWeights.length === geometry.vertices.length;
-
-		for ( var i = 0; i < geometry.faces.length; i ++ ) {
-
-			var face = geometry.faces[ i ];
-
-			vertices.push(
-				geometry.vertices[ face.a ],
-				geometry.vertices[ face.b ],
-				geometry.vertices[ face.c ]
-			);
-
-			var vertexNormals = face.vertexNormals;
-
-			if ( vertexNormals.length === 3 ) {
-
-				normals.push( vertexNormals[ 0 ], vertexNormals[ 1 ], vertexNormals[ 2 ] );
-
-			} else {
-
-				normals.push( face.normal, face.normal, face.normal );
-
-			}
-
-			var vertexColors = face.vertexColors;
-
-			if ( vertexColors.length === 3 ) {
-
-				colors.push( vertexColors[ 0 ], vertexColors[ 1 ], vertexColors[ 2 ] );
-
-			} else {
-
-				colors.push( face.color, face.color, face.color );
-
-			}
-
-			if ( hasFaceVertexUv === true ) {
-
-				var vertexUvs = geometry.faceVertexUvs[ 0 ][ i ];
-
-				if ( vertexUvs !== undefined ) {
-
-					uvs.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] );
-
-				} else {
-
-					uvs.push( new Vector2(), new Vector2(), new Vector2() );
-
-				}
-
-			}
-
-			if ( hasFaceVertexUv2 === true ) {
-
-				var vertexUvs = geometry.faceVertexUvs[ 1 ][ i ];
-
-				if ( vertexUvs !== undefined ) {
-
-					uvs2.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] );
-
-				} else {
-
-					uvs2.push( new Vector2(), new Vector2(), new Vector2() );
-
-				}
-
-			}
-
-			// morphs
-
-			for ( var j = 0; j < morphTargetsLength; j ++ ) {
-
-				var morphTarget = morphTargets[ j ].vertices;
-
-				morphTargetsPosition[ j ].push(
-					morphTarget[ face.a ],
-					morphTarget[ face.b ],
-					morphTarget[ face.c ]
-				);
-
-			}
-
-			for ( var j = 0; j < morphNormalsLength; j ++ ) {
-
-				var morphNormal = morphNormals[ j ].vertexNormals[ i ];
-
-				morphTargetsNormal[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c );
-
-			}
-
-			// skins
-
-			if ( hasSkinIndices ) {
-
-				skinIndices.push(
-					geometry.skinIndices[ face.a ],
-					geometry.skinIndices[ face.b ],
-					geometry.skinIndices[ face.c ]
-				);
-
-			}
-
-			if ( hasSkinWeights ) {
-
-				skinWeights.push(
-					geometry.skinWeights[ face.a ],
-					geometry.skinWeights[ face.b ],
-					geometry.skinWeights[ face.c ]
-				);
-
-			}
-
-		}
-
-		assert.deepEqual( a.vertices, vertices, "Vertices are identical" );
-		assert.deepEqual( a.normals, normals, "Normals are identical" );
-		assert.deepEqual( a.colors, colors, "Colors are identical" );
-		assert.deepEqual( a.uvs, uvs, "UV coordinates are identical" );
-		assert.deepEqual( a.uvs2, uvs2, "UV(2) coordinates are identical" );
-		assert.deepEqual( a.skinIndices, skinIndices, "SkinIndices are identical" );
-		assert.deepEqual( a.skinWeights, skinWeights, "SkinWeights are identical" );
-		assert.deepEqual( a.morphTargetsPosition, morphTargetsPosition, "MorphTargets (Position) are identical" );
-		assert.deepEqual( a.morphTargetsNormal, morphTargetsNormal, "MorphTargets (Normals) are identical" );
-
-		asyncDone();
-
-	} );
-
-} );

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

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

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

@@ -1,58 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "Face3" );
-
-QUnit.test( "copy" , function( assert ) {
-	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, assert);
-	checkVertexAndColors(copiedInstance, assert);
-});
-
-QUnit.test( "copy" , function( assert ) {
-	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, assert);
-	checkVertexAndColorArrays(copiedInstance, assert);
-});
-
-QUnit.test( "clone" , function( assert ) {
-	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, assert);
-	checkVertexAndColors(copiedInstance, assert);
-});
-
-function checkCopy(copiedInstance, assert) {
-	assert.ok( copiedInstance instanceof THREE.Face3, "copy created the correct type" );
-	assert.ok(
-		copiedInstance.a === 0 &&
-		copiedInstance.b === 1 &&
-		copiedInstance.c === 2 &&
-		copiedInstance.materialIndex === 2
-		,"properties where copied" );
-}
-
-function checkVertexAndColors(copiedInstance, assert) {
-	assert.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, assert) {
-	assert.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 - 360
test/unit/src/core/Geometry.js

@@ -1,360 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "Geometry" );
-
-QUnit.test( "rotateX" , function( assert ) {
-	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];
-	assert.ok( v0.x === -0.5 && v0.y === 0 && v0.z === 0, "first vertex was rotated" );
-	assert.ok( v1.x === 0.5 && v1.y === 0 && v1.z === 0, "second vertex was rotated" );
-	assert.ok( v2.x === 0 && v2.y < Number.EPSILON && v2.z === 1, "third vertex was rotated" );
-});
-
-QUnit.test( "rotateY" , function( assert ) {
-	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];
-	assert.ok( v0.x === 0.5 && v0.y === 0 && v0.z < Number.EPSILON, "first vertex was rotated" );
-	assert.ok( v1.x === -0.5 && v1.y === 0 && v1.z < Number.EPSILON, "second vertex was rotated" );
-	assert.ok( v2.x === 0 && v2.y === 1 && v2.z === 0, "third vertex was rotated" );
-});
-
-QUnit.test( "rotateZ" , function( assert ) {
-	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];
-	assert.ok( v0.x < Number.EPSILON && v0.y === 0.5 && v0.z === 0, "first vertex was rotated" );
-	assert.ok( v1.x < Number.EPSILON && v1.y === -0.5 && v1.z === 0, "second vertex was rotated" );
-	assert.ok( v2.x === 1 && v2.y < Number.EPSILON && v2.z === 0, "third vertex was rotated" );
-});
-
-QUnit.test( "fromBufferGeometry" , function( assert ) {
-	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;
-	assert.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;
-	assert.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;
-	assert.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" );
-});
-
-QUnit.test( "normalize" , function( assert ) {
-	var geometry = getGeometry();
-	geometry.computeLineDistances();
-
-	var distances = geometry.lineDistances;
-	assert.ok( distances[0] === 0, "distance to the 1st point is 0" );
-	assert.ok( distances[1] === 1 + distances[0], "distance from the 1st to the 2nd is sqrt(2nd - 1st) + distance - 1" );
-	assert.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 );
-}
-
-QUnit.test( "applyMatrix", function ( assert ) {
-
-	var geometry = getGeometry();
-	geometry.faces.push( new THREE.Face3( 0, 1, 2 ) );
-	var m = new THREE.Matrix4();
-	var expectedVerts = [
-		new THREE.Vector3( 1.5, 3, 4 ),
-		new THREE.Vector3( 2.5, 3, 4 ),
-		new THREE.Vector3( 2, 3, 5 )
-	];
-	var v1, v2, v3;
-
-	m.makeRotationX( Math.PI / 2 );
-	m.setPosition( new THREE.Vector3( x, y, z ) );
-
-	geometry.applyMatrix( m );
-
-	v0 = geometry.vertices[ 0 ];
-	v1 = geometry.vertices[ 1 ];
-	v2 = geometry.vertices[ 2 ];
-	assert.ok(
-		Math.abs( v0.x - expectedVerts[ 0 ].x ) <= eps &&
-		Math.abs( v0.y - expectedVerts[ 0 ].y ) <= eps &&
-		Math.abs( v0.z - expectedVerts[ 0 ].z ) <= eps,
-		"First vertex is as expected"
-	);
-	assert.ok(
-		Math.abs( v1.x - expectedVerts[ 1 ].x ) <= eps &&
-		Math.abs( v1.y - expectedVerts[ 1 ].y ) <= eps &&
-		Math.abs( v1.z - expectedVerts[ 1 ].z ) <= eps,
-		"Second vertex is as expected"
-	);
-	assert.ok(
-		Math.abs( v2.x - expectedVerts[ 2 ].x ) <= eps &&
-		Math.abs( v2.y - expectedVerts[ 2 ].y ) <= eps &&
-		Math.abs( v2.z - expectedVerts[ 2 ].z ) <= eps,
-		"Third vertex is as expected"
-	);
-
-} );
-
-QUnit.test( "translate", function ( assert ) {
-
-	var a = getGeometry();
-	var expected = [
-		new THREE.Vector3( - 2.5, 3, - 4 ),
-		new THREE.Vector3( - 1.5, 3, - 4 ),
-		new THREE.Vector3( - 2, 4, - 4 )
-	];
-	var v;
-
-	a.translate( - x, y, - z );
-
-	for ( var i = 0; i < a.vertices.length; i ++ ) {
-
-		v = a.vertices[ i ];
-		assert.ok(
-			Math.abs( v.x - expected[ i ].x ) <= eps &&
-			Math.abs( v.y - expected[ i ].y ) <= eps &&
-			Math.abs( v.z - expected[ i ].z ) <= eps,
-			"Vertex #" + i + " was translated as expected"
-		);
-
-	}
-
-} );
-
-QUnit.test( "lookAt", function ( assert ) {
-
-	var a = getGeometry();
-	var expected = [
-		new THREE.Vector3( - 0.5, 0, 0 ),
-		new THREE.Vector3( 0.5, 0, 0 ),
-		new THREE.Vector3( 0, 0.5 * Math.sqrt( 2 ), 0.5 * Math.sqrt( 2 ) )
-	];
-
-	a.lookAt( new THREE.Vector3( 0, - 1, 1 ) );
-
-	for ( var i = 0; i < a.vertices.length; i ++ ) {
-
-		v = a.vertices[ i ];
-		assert.ok(
-			Math.abs( v.x - expected[ i ].x ) <= eps &&
-			Math.abs( v.y - expected[ i ].y ) <= eps &&
-			Math.abs( v.z - expected[ i ].z ) <= eps,
-			"Vertex #" + i + " was adjusted as expected"
-		);
-
-	}
-
-} );
-
-QUnit.test( "scale", function ( assert ) {
-
-	var a = getGeometry();
-	var expected = [
-		new THREE.Vector3( - 1, 0, 0 ),
-		new THREE.Vector3( 1, 0, 0 ),
-		new THREE.Vector3( 0, 3, 0 )
-	];
-	var v;
-
-	a.scale( 2, 3, 4 );
-
-	for ( var i = 0; i < a.vertices.length; i ++ ) {
-
-		v = a.vertices[ i ];
-		assert.ok(
-			Math.abs( v.x - expected[ i ].x ) <= eps &&
-			Math.abs( v.y - expected[ i ].y ) <= eps &&
-			Math.abs( v.z - expected[ i ].z ) <= eps,
-			"Vertex #" + i + " was scaled as expected"
-		);
-
-	}
-
-} );
-
-QUnit.test( "normalize (actual)", function ( assert ) {
-
-	var a = getGeometry();
-	var sqrt = 0.5 * Math.sqrt( 2 );
-	var expected = [
-		new THREE.Vector3( - sqrt, - sqrt, 0 ),
-		new THREE.Vector3( sqrt, - sqrt, 0 ),
-		new THREE.Vector3( 0, sqrt, 0 )
-	];
-	var v;
-
-	a.normalize();
-
-	for ( var i = 0; i < a.vertices.length; i ++ ) {
-
-		v = a.vertices[ i ];
-		assert.ok(
-			Math.abs( v.x - expected[ i ].x ) <= eps &&
-			Math.abs( v.y - expected[ i ].y ) <= eps &&
-			Math.abs( v.z - expected[ i ].z ) <= eps,
-			"Vertex #" + i + " was normalized as expected"
-		);
-
-	}
-
-} );
-
-QUnit.test( "toJSON", function ( assert ) {
-
-	var a = getGeometry();
-	var gold = {
-		"metadata": {
-			"version": 4.5,
-			"type": "Geometry",
-			"generator": "Geometry.toJSON"
-		},
-		"uuid": null,
-		"type": "Geometry",
-		"data": {
-			"vertices": [ - 0.5, 0, 0, 0.5, 0, 0, 0, 1, 0 ],
-			"normals": [ 0, 0, 1 ],
-			"faces": [ 50, 0, 1, 2, 0, 0, 0, 0, 0 ]
-		}
-	};
-	var json;
-
-	a.faces.push( new THREE.Face3( 0, 1, 2 ) );
-	a.computeFaceNormals();
-	a.computeVertexNormals();
-
-	json = a.toJSON();
-	json.uuid = null;
-	assert.deepEqual( json, gold, "Generated JSON is as expected" );
-
-} );
-
-QUnit.test( "mergeVertices", function ( assert ) {
-
-	var a = new THREE.Geometry();
-	var b = new THREE.BoxBufferGeometry( 1, 1, 1 );
-	var verts, faces, removed;
-
-	a.fromBufferGeometry( b );
-
-	removed = a.mergeVertices();
-	verts = a.vertices.length;
-	faces = a.faces.length;
-
-	assert.strictEqual( removed, 16, "Removed the expected number of vertices" );
-	assert.strictEqual( verts, 8, "Minimum number of vertices remaining" );
-	assert.strictEqual( faces, 12, "Minimum number of faces remaining" );
-
-} );
-
-QUnit.test( "sortFacesByMaterialIndex", function ( assert ) {
-
-	var box = new THREE.BoxBufferGeometry( 1, 1, 1 );
-	var a = new THREE.Geometry().fromBufferGeometry( box );
-	var expected = [ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 ];
-
-	a.faces.reverse(); // a bit too simple probably, still missing stuff like checking new UVs
-	a.sortFacesByMaterialIndex();
-
-	var indices = [];
-
-	for ( var i = 0; i < a.faces.length; i ++ ) {
-
-		indices.push( a.faces[ i ].materialIndex );
-
-	}
-
-	assert.deepEqual( indices, expected, "Faces in correct order" );
-
-} );
-
-QUnit.test( "computeBoundingBox", function ( assert ) {
-
-	var a = new THREE.DodecahedronGeometry();
-
-	a.computeBoundingBox();
-	assert.strictEqual( a.boundingBox.isEmpty(), false, "Bounding box isn't empty" );
-
-	var allIn = true;
-	for ( var i = 0; i < a.vertices.length; i ++ ) {
-
-		if ( ! a.boundingBox.containsPoint( a.vertices[ i ] ) ) {
-
-			allIn = false;
-
-		}
-
-	}
-	assert.strictEqual( allIn, true, "All vertices are inside the box" );
-
-} );
-
-QUnit.test( "computeBoundingSphere", function ( assert ) {
-
-	var a = new THREE.DodecahedronGeometry();
-
-	a.computeBoundingSphere();
-
-	var allIn = true;
-	for ( var i = 0; i < a.vertices.length; i ++ ) {
-
-		if ( ! a.boundingSphere.containsPoint( a.vertices[ i ] ) ) {
-
-			allIn = false;
-
-		}
-
-	}
-	assert.strictEqual( allIn, true, "All vertices are inside the bounding sphere" );
-
-} );

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

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

+ 0 - 52
test/unit/src/core/InstancedBufferGeometry.js

@@ -1,52 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "InstancedBufferGeometry" );
-
-function createClonableMock() {
-	return {
-		callCount: 0,
-
-		clone: function() {
-			this.callCount++;
-
-			return this;
-		}
-	}
-}
-
-QUnit.test( "copy" , function( assert ) {
-	var instanceMock1 = {};
-	var instanceMock2 = {};
-	var indexMock = createClonableMock();
-	var defaultAttribute1 = new THREE.BufferAttribute( new Float32Array( [ 1 ] ) );
-	var defaultAttribute2 = new THREE.BufferAttribute( new Float32Array( [ 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 = new THREE.InstancedBufferGeometry().copy( instance );
-
-	assert.ok( copiedInstance instanceof THREE.InstancedBufferGeometry, "the clone has the correct type" );
-
-	assert.equal( copiedInstance.index, indexMock, "index was copied" );
-	assert.equal( copiedInstance.index.callCount, 1, "index.clone was called once" );
-
-	assert.ok( copiedInstance.attributes['defaultAttribute1'] instanceof THREE.BufferAttribute, "attribute was created" );
-	assert.deepEqual( copiedInstance.attributes['defaultAttribute1'].array, defaultAttribute1.array, "attribute was copied" );
-	assert.deepEqual( copiedInstance.attributes['defaultAttribute2'].array, defaultAttribute2.array, "attribute was copied" );
-
-	assert.equal( copiedInstance.groups[0].start, 0, "group was copied" );
-	assert.equal( copiedInstance.groups[0].count, 10, "group was copied" );
-	assert.equal( copiedInstance.groups[0].materialIndex, instanceMock1, "group was copied" );
-
-	assert.equal( copiedInstance.groups[1].start, 10, "group was copied" );
-	assert.equal( copiedInstance.groups[1].count, 5, "group was copied" );
-	assert.equal( copiedInstance.groups[1].materialIndex, instanceMock2, "group was copied" );
-});

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

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

+ 0 - 108
test/unit/src/core/InterleavedBuffer.js

@@ -1,108 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "InterleavedBuffer" );
-
-function checkInstanceAgainstCopy( instance, copiedInstance, assert ) {
-	assert.ok( copiedInstance instanceof THREE.InterleavedBuffer, "the clone has the correct type" );
-
-	for ( var i = 0; i < instance.array.length; i++ ) {
-		assert.ok( copiedInstance.array[i] === instance.array[i], "array was copied" );
-	}
-
-	assert.ok( copiedInstance.stride === instance.stride, "stride was copied" );
-	assert.ok( copiedInstance.dynamic === true, "dynamic was copied" );
-}
-
-QUnit.test( "count", function( assert ) {
-	var instance = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-
-	assert.equal( instance.count, 2, "count is calculated via array length / stride" );
-});
-
-QUnit.test( "copy" , function( assert ) {
-	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 ), assert );
-});
-
-QUnit.test( "clone" , function( assert ) {
-	var array = new Float32Array( [1, 2, 3, 7, 8 ,9] );
-	var instance = new THREE.InterleavedBuffer( array, 3 );
-	instance.setDynamic( true );
-
-	checkInstanceAgainstCopy( instance, instance.clone(), assert );
-});
-
-QUnit.test( "set" , function( assert ) {
-	var instance = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-
-	instance.set( [0, -1] );
-	assert.ok( instance.array[0] === 0 && instance.array[1] === -1, "replace at first by default" );
-});
-
-QUnit.test( "needsUpdate", function ( assert ) {
-
-	var a = new THREE.InterleavedBuffer( new Float32Array( [ 1, 2, 3, 4 ], 2 ) );
-
-	a.needsUpdate = true;
-
-	assert.strictEqual( a.version, 1, "Check version increased" );
-
-} );
-
-QUnit.test( "setArray", function ( assert ) {
-
-	var f32a = new Float32Array( [ 1, 2, 3, 4 ] );
-	var f32b = new Float32Array( [ ] );
-	var a = new THREE.InterleavedBuffer( f32a, 2, false );
-
-	a.setArray( f32a );
-
-	assert.strictEqual( a.count, 2, "Check item count for non-empty array" );
-	assert.strictEqual( a.array, f32a, "Check array itself" );
-
-	a.setArray( f32b );
-
-	assert.strictEqual( a.count, 0, "Check item count for empty array" );
-	assert.strictEqual( a.array, f32b, "Check array itself" );
-
-	assert.throws(
-		function () {
-
-			a.setArray( [ 1, 2, 3, 4 ] );
-
-		},
-		/array should be a Typed Array/,
-		"Calling setArray with a non-typed array throws Error"
-	);
-
-} );
-
-QUnit.test( "copyAt", function ( assert ) {
-
-	var a = new THREE.InterleavedBuffer( new Float32Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ), 3 );
-	var b = new THREE.InterleavedBuffer( new Float32Array( 9 ), 3 );
-	var expected = new Float32Array( [ 4, 5, 6, 7, 8, 9, 1, 2, 3 ] );
-
-	b.copyAt( 1, a, 2 );
-	b.copyAt( 0, a, 1 );
-	b.copyAt( 2, a, 0 );
-
-	assert.deepEqual( b.array, expected, "Check the right values were replaced" );
-
-} );
-
-QUnit.test( "onUpload", function ( assert ) {
-
-	var a = new THREE.InterleavedBuffer();
-	var func = function () { };
-
-	a.onUpload( func );
-
-	assert.strictEqual( a.onUploadCallback, func, "Check callback was set properly" );
-
-} );

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

@@ -1,36 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "InterleavedBufferAttribute" );
-
-QUnit.test( "length and count", function( assert ) {
-	var buffer = new THREE.InterleavedBuffer( new Float32Array( [1, 2, 3, 7, 8 ,9] ), 3 );
-	var instance = new THREE.InterleavedBufferAttribute( buffer, 2, 0 );
-
-	assert.ok( instance.count === 2, "count is calculated via array length / stride" );
-});
-
-QUnit.test( "setX" , function( assert ) {
-	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 );
-
-	assert.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
-	assert.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 - 101
test/unit/src/core/Layers.js

@@ -1,101 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "Layers" );
-
-QUnit.test( "set", function ( assert ) {
-
-	var a = new THREE.Layers();
-
-	a.set( 0 );
-	assert.strictEqual( a.mask, 1, "Set channel 0" );
-
-	a.set( 1 );
-	assert.strictEqual( a.mask, 2, "Set channel 1" );
-
-	a.set( 2 );
-	assert.strictEqual( a.mask, 4, "Set channel 2" );
-
-} );
-
-QUnit.test( "enable", function ( assert ) {
-
-	var a = new THREE.Layers();
-
-	a.set( 0 );
-	a.enable( 0 );
-	assert.strictEqual( a.mask, 1, "Enable channel 0 with mask 0" );
-
-	a.set( 0 );
-	a.enable( 1 );
-	assert.strictEqual( a.mask, 3, "Enable channel 1 with mask 0" );
-
-	a.set( 1 );
-	a.enable( 0 );
-	assert.strictEqual( a.mask, 3, "Enable channel 0 with mask 1" );
-
-	a.set( 1 );
-	a.enable( 1 );
-	assert.strictEqual( a.mask, 2, "Enable channel 1 with mask 1" );
-
-} );
-
-QUnit.test( "disable", function ( assert ) {
-
-	var a = new THREE.Layers();
-
-	a.set( 0 );
-	a.disable( 0 );
-	assert.strictEqual( a.mask, 0, "Disable channel 0 with mask 0" );
-
-	a.set( 0 );
-	a.disable( 1 );
-	assert.strictEqual( a.mask, 1, "Disable channel 1 with mask 0" );
-
-	a.set( 1 );
-	a.disable( 0 );
-	assert.strictEqual( a.mask, 2, "Disable channel 0 with mask 1" );
-
-	a.set( 1 );
-	a.disable( 1 );
-	assert.strictEqual( a.mask, 0, "Disable channel 1 with mask 1" );
-
-} );
-
-QUnit.test( "toggle", function ( assert ) {
-
-	var a = new THREE.Layers();
-
-	a.set( 0 );
-	a.toggle( 0 );
-	assert.strictEqual( a.mask, 0, "Toggle channel 0 with mask 0" );
-
-	a.set( 0 );
-	a.toggle( 1 );
-	assert.strictEqual( a.mask, 3, "Toggle channel 1 with mask 0" );
-
-	a.set( 1 );
-	a.toggle( 0 );
-	assert.strictEqual( a.mask, 3, "Toggle channel 0 with mask 1" );
-
-	a.set( 1 );
-	a.toggle( 1 );
-	assert.strictEqual( a.mask, 0, "Toggle channel 1 with mask 1" );
-
-} );
-
-QUnit.test( "test", function ( assert ) {
-
-	var a = new THREE.Layers();
-	var b = new THREE.Layers();
-
-	assert.ok( a.test( b ), "Start out true" );
-
-	a.set( 1 );
-	assert.notOk( a.test( b ), "Set channel 1 in a and fail the test" );
-
-	b.toggle( 1 );
-	assert.ok( a.test( b ), "Toggle channel 1 in b and pass again" );
-
-} );

+ 0 - 482
test/unit/src/core/Object3D.js

@@ -1,482 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "Object3D" );
-
-var RadToDeg = 180 / Math.PI;
-
-var eulerEquals = function ( a, b, tolerance ) {
-
-	tolerance = tolerance || 0.0001;
-
-	if ( a.order != b.order ) {
-
-		return false;
-
-	}
-
-	return (
-		Math.abs( a.x - b.x ) <= tolerance &&
-		Math.abs( a.y - b.y ) <= tolerance &&
-		Math.abs( a.z - b.z ) <= tolerance
-	);
-
-};
-
-QUnit.test( "rotateX" , function( assert ) {
-	var obj = new THREE.Object3D();
-
-	var angleInRad = 1.562;
-	obj.rotateX(angleInRad);
-
-	assert.numEqual( obj.rotation.x, angleInRad, "x is equal" );
-});
-
-QUnit.test( "rotateY" , function( assert ) {
-	var obj = new THREE.Object3D();
-
-	var angleInRad = -0.346;
-	obj.rotateY(angleInRad);
-
-	assert.numEqual( obj.rotation.y, angleInRad, "y is equal" );
-});
-
-QUnit.test( "rotateZ" , function( assert ) {
-	var obj = new THREE.Object3D();
-
-	var angleInRad = 1;
-	obj.rotateZ(angleInRad);
-
-	assert.numEqual( obj.rotation.z, angleInRad, "z is equal" );
-});
-
-QUnit.test( "translateOnAxis" , function( assert ) {
-	var obj = new THREE.Object3D();
-
-	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);
-
-	assert.propEqual( obj.position, { x: 1, y: 1.23, z: -4.56 } );
-});
-
-QUnit.test( "translateX" , function( assert ) {
-	var obj = new THREE.Object3D();
-	obj.translateX(1.234);
-
-	assert.numEqual( obj.position.x, 1.234, "x is equal" );
-});
-
-QUnit.test( "translateY" , function( assert ) {
-	var obj = new THREE.Object3D();
-	obj.translateY(1.234);
-
-	assert.numEqual( obj.position.y, 1.234, "y is equal" );
-});
-
-QUnit.test( "translateZ" , function( assert ) {
-	var obj = new THREE.Object3D();
-	obj.translateZ(1.234);
-
-	assert.numEqual( obj.position.z, 1.234, "z is equal" );
-});
-
-QUnit.test( "lookAt" , function( assert ) {
-	var obj = new THREE.Object3D();
-	obj.lookAt(new THREE.Vector3(0, -1, 1));
-
-	assert.numEqual( obj.rotation.x * RadToDeg, 45, "x is equal" );
-});
-
-QUnit.test( "getWorldRotation" , function( assert ) {
-	var obj = new THREE.Object3D();
-
-	obj.lookAt(new THREE.Vector3(0, -1, 1));
-	assert.numEqual( obj.getWorldRotation().x * RadToDeg, 45, "x is equal" );
-
-	obj.lookAt(new THREE.Vector3(1, 0, 0));
-	assert.numEqual( obj.getWorldRotation().y * RadToDeg, 90, "y is equal" );
-});
-
-QUnit.test( "getObjectById/getObjectByName/getObjectByProperty", function ( assert ) {
-
-	var parent = new THREE.Object3D();
-	var childName = new THREE.Object3D();
-	var childId = new THREE.Object3D(); // id = parent.id + 2
-	var childNothing = new THREE.Object3D();
-
-	parent.prop = true;
-	childName.name = "foo";
-	parent.add( childName, childId, childNothing );
-
-	assert.strictEqual( parent.getObjectByProperty( 'prop', true ), parent, "Get parent by its own property" );
-	assert.strictEqual( parent.getObjectByName( "foo" ), childName, "Get child by name" );
-	assert.strictEqual( parent.getObjectById( parent.id + 2 ), childId, "Get child by Id" );
-	assert.strictEqual(
-		parent.getObjectByProperty( 'no-property', 'no-value' ), undefined,
-		"Unknown property results in undefined"
-	);
-
-} );
-
-QUnit.test( "setRotationFromAxisAngle", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var axis = new THREE.Vector3( 0, 1, 0 );
-	var angle = Math.PI;
-	var expected = new THREE.Euler( - Math.PI, 0, - Math.PI );
-
-	a.setRotationFromAxisAngle( axis, angle );
-	assert.ok( eulerEquals( a.getWorldRotation(), expected ), "Correct values after rotation" );
-
-	axis.set( 1, 0, 0 );
-	angle = 0;
-	expected.set( 0, 0, 0 );
-
-	a.setRotationFromAxisAngle( axis, angle );
-	assert.ok( eulerEquals( a.getWorldRotation(), expected ), "Correct values after zeroing" );
-
-} );
-
-QUnit.test( "setRotationFromEuler", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var rotation = new THREE.Euler( THREE.Math.degToRad( 45 ), 0, Math.PI );
-	var expected = rotation.clone(); // bit obvious
-
-	a.setRotationFromEuler( rotation );
-	assert.ok( eulerEquals( a.getWorldRotation(), expected ), "Correct values after rotation" );
-
-} );
-
-QUnit.test( "setRotationFromQuaternion", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var rotation = new THREE.Quaternion().setFromEuler( new THREE.Euler( Math.PI, 0, - Math.PI ) );
-	var expected = new THREE.Euler( Math.PI, 0, - Math.PI );
-
-	a.setRotationFromQuaternion( rotation );
-	assert.ok( eulerEquals( a.getWorldRotation(), expected ), "Correct values after rotation" );
-
-} );
-
-QUnit.test( "setRotationFromMatrix", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var m = new THREE.Matrix4();
-	var eye = new THREE.Vector3( 0, 0, 0 );
-	var target = new THREE.Vector3( 0, 1, - 1 );
-	var up = new THREE.Vector3( 0, 1, 0 );
-
-	m.lookAt( eye, target, up );
-	a.setRotationFromMatrix( m );
-	assert.numEqual( a.getWorldRotation().x * RadToDeg, 45, "Correct rotation angle" );
-
-} );
-
-QUnit.test( "copy", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var b = new THREE.Object3D();
-	var child = new THREE.Object3D();
-	var childChild = new THREE.Object3D();
-
-	a.name = "original";
-	b.name = "to-be-copied";
-
-	b.position.set( x, y, z );
-	b.quaternion.set( x, y, z, w );
-	b.scale.set( 2, 3, 4 );
-
-	// bogus test values
-	b.matrix.set( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 );
-	b.matrixWorld.set( 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 );
-
-	b.matrixAutoUpdate = false;
-	b.matrixWorldNeedsUpdate = true;
-
-	b.layers.mask = 2;
-	b.visible = false;
-
-	b.castShadow = true;
-	b.receiveShadow = true;
-
-	b.frustumCulled = false;
-	b.renderOrder = 1;
-
-	b.userData[ "foo" ] = "bar";
-
-	child.add( childChild );
-	b.add( child );
-
-	assert.notDeepEqual( a, b, "Objects are not equal pre-copy()" );
-	a.copy( b, true );
-
-	// check they're all unique instances
-	assert.ok(
-		a.uuid !== b.uuid &&
-		a.children[ 0 ].uuid !== b.children[ 0 ].uuid &&
-		a.children[ 0 ].children[ 0 ].uuid !== b.children[ 0 ].children[ 0 ].uuid,
-		"UUIDs are all different"
-	);
-
-	// and now fix that
-	a.uuid = b.uuid;
-	a.children[ 0 ].uuid = b.children[ 0 ].uuid;
-	a.children[ 0 ].children[ 0 ].uuid = b.children[ 0 ].children[ 0 ].uuid;
-
-	assert.deepEqual( a, b, "Objects are equal post-copy()" );
-
-} );
-
-QUnit.test( "clone", function ( assert ) {
-
-	var a;
-	var b = new THREE.Object3D();
-
-	assert.strictEqual( a, undefined, "Undefined pre-clone()" );
-
-	a = b.clone();
-	assert.notStrictEqual( a, b, "Defined but seperate instances post-clone()" );
-
-	a.uuid = b.uuid;
-	assert.deepEqual( a, b, "But identical properties" );
-
-} );
-
-QUnit.test( "toJSON", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var child = new THREE.Object3D();
-	var childChild = new THREE.Object3D();
-
-	a.name = "a's name";
-	a.matrix.set( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 );
-	a.visible = false;
-	a.castShadow = true;
-	a.receiveShadow = true;
-	a.userData[ "foo" ] = "bar";
-
-	child.uuid = "5D4E9AE8-DA61-4912-A575-71A5BE3D72CD";
-	childChild.uuid = "B43854B3-E970-4E85-BD41-AAF8D7BFA189";
-	child.add( childChild );
-	a.add( child );
-
-	var gold = {
-		"metadata": {
-			"version": 4.5,
-			"type": "Object",
-			"generator": "Object3D.toJSON"
-		},
-		"object": {
-			"uuid": "0A1E4F43-CB5B-4097-8F82-DC2969C0B8C2",
-			"type": "Object3D",
-			"name": "a's name",
-			"castShadow": true,
-			"receiveShadow": true,
-			"visible": false,
-			"userData": { "foo": "bar" },
-			"matrix": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],
-			"children": [
-				{
-					"uuid": "5D4E9AE8-DA61-4912-A575-71A5BE3D72CD",
-					"type": "Object3D",
-					"matrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
-					"children": [
-						{
-							"uuid": "B43854B3-E970-4E85-BD41-AAF8D7BFA189",
-							"type": "Object3D",
-							"matrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]
-						}
-					]
-				}
-			]
-		}
-	};
-
-	// hacks
-	var out = a.toJSON();
-	out.object.uuid = "0A1E4F43-CB5B-4097-8F82-DC2969C0B8C2";
-
-	assert.deepEqual( out, gold, "JSON is as expected" );
-
-} );
-
-QUnit.test( "add/remove", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var child1 = new THREE.Object3D();
-	var child2 = new THREE.Object3D();
-
-	assert.strictEqual( a.children.length, 0, "Starts with no children" );
-
-	a.add( child1 );
-	assert.strictEqual( a.children.length, 1, "The first child was added" );
-	assert.strictEqual( a.children[ 0 ], child1, "It's the right one" );
-
-	a.add( child2 );
-	assert.strictEqual( a.children.length, 2, "The second child was added" );
-	assert.strictEqual( a.children[ 1 ], child2, "It's the right one" );
-	assert.strictEqual( a.children[ 0 ], child1, "The first one is still there" );
-
-	a.remove( child1 );
-	assert.strictEqual( a.children.length, 1, "The first child was removed" );
-	assert.strictEqual( a.children[ 0 ], child2, "The second one is still there" );
-
-	a.add( child1 );
-	a.remove( child1, child2 );
-	assert.strictEqual( a.children.length, 0, "Both children were removed at once" );
-
-	child1.add( child2 );
-	assert.strictEqual( child1.children.length, 1, "The second child was added to the first one" );
-	a.add( child2 );
-	assert.strictEqual( a.children.length, 1, "The second one was added to the parent (no remove)" );
-	assert.strictEqual( a.children[ 0 ], child2, "The second one is now the parent's child again" );
-	assert.strictEqual( child1.children.length, 0, "The first one no longer has any children" );
-
-} );
-
-QUnit.test( "applyQuaternion", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var sqrt = 0.5 * Math.sqrt( 2 );
-	var quat = new THREE.Quaternion( 0, sqrt, 0, sqrt );
-	var expected = new THREE.Quaternion( sqrt / 2, sqrt / 2, 0, 0 );
-
-	a.quaternion.set( 0.25, 0.25, 0.25, 0.25 );
-	a.applyQuaternion( quat );
-
-	assert.ok(
-		Math.abs( a.quaternion.x - expected.x ) <= eps &&
-		Math.abs( a.quaternion.y - expected.y ) <= eps &&
-		Math.abs( a.quaternion.z - expected.z ) <= eps,
-		"Quaternion has the expected values"
-	);
-
-} );
-
-QUnit.test( "applyMatrix", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var m = new THREE.Matrix4();
-	var expectedPos = new THREE.Vector3( x, y, z );
-	var expectedQuat = new THREE.Quaternion( 0.5 * Math.sqrt( 2 ), 0, 0, 0.5 * Math.sqrt( 2 ) );
-
-	m.makeRotationX( Math.PI / 2 );
-	m.setPosition( new THREE.Vector3( x, y, z ) );
-
-	a.applyMatrix( m );
-
-	assert.deepEqual( a.position, expectedPos, "Position has the expected values" );
-	assert.ok(
-		Math.abs( a.quaternion.x - expectedQuat.x ) <= eps &&
-		Math.abs( a.quaternion.y - expectedQuat.y ) <= eps &&
-		Math.abs( a.quaternion.z - expectedQuat.z ) <= eps,
-		"Quaternion has the expected values"
-	);
-
-} );
-
-QUnit.test( "getWorldPosition", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var b = new THREE.Object3D();
-	var expectedSingle = new THREE.Vector3( x, y, z );
-	var expectedParent = new THREE.Vector3( x, y, 0 );
-	var expectedChild = new THREE.Vector3( x, y, 7 + ( z - z ) );
-
-	a.translateX( x );
-	a.translateY( y );
-	a.translateZ( z );
-
-	assert.deepEqual(
-		a.getWorldPosition(), expectedSingle,
-		"WorldPosition as expected for single object"
-	);
-
-	// translate child and then parent
-	b.translateZ( 7 );
-	a.add( b );
-	a.translateZ( - z );
-
-	assert.deepEqual( a.getWorldPosition(), expectedParent, "WorldPosition as expected for parent" );
-	assert.deepEqual( b.getWorldPosition(), expectedChild, "WorldPosition as expected for child" );
-
-} );
-
-QUnit.test( "getWorldScale", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var m = new THREE.Matrix4().makeScale( x, y, z );
-	var expected = new THREE.Vector3( x, y, z );
-
-	a.applyMatrix( m );
-
-	assert.deepEqual( a.getWorldScale(), expected, "WorldScale as expected" );
-
-} );
-
-QUnit.test( "getWorldDirection", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var expected = new THREE.Vector3( 0, - 0.5 * Math.sqrt( 2 ), 0.5 * Math.sqrt( 2 ) );
-	var dir;
-
-	a.lookAt( new THREE.Vector3( 0, - 1, 1 ) );
-	dir = a.getWorldDirection();
-
-	assert.ok(
-		Math.abs( dir.x - expected.x ) <= eps &&
-		Math.abs( dir.y - expected.y ) <= eps &&
-		Math.abs( dir.z - expected.z ) <= eps,
-		"Direction has the expected values"
-	);
-
-} );
-
-QUnit.test( "traverse/traverseVisible/traverseAncestors", function ( assert ) {
-
-	var a = new THREE.Object3D();
-	var b = new THREE.Object3D();
-	var c = new THREE.Object3D();
-	var d = new THREE.Object3D();
-	var names = [];
-	var expectedNormal = [ "parent", "child", "childchild 1", "childchild 2" ];
-	var expectedVisible = [ "parent", "child", "childchild 2" ];
-	var expectedAncestors = [ "child", "parent" ];
-
-	a.name = "parent";
-	b.name = "child";
-	c.name = "childchild 1";
-	c.visible = false;
-	d.name = "childchild 2";
-
-	b.add( c );
-	b.add( d );
-	a.add( b );
-
-	a.traverse( function ( obj ) {
-
-		names.push( obj.name );
-
-	} );
-	assert.deepEqual( names, expectedNormal, "Traversed objects in expected order" );
-
-	names = [];
-	a.traverseVisible( function ( obj ) {
-
-		names.push( obj.name );
-
-	} );
-	assert.deepEqual( names, expectedVisible, "Traversed visible objects in expected order" );
-
-	names = [];
-	c.traverseAncestors( function ( obj ) {
-
-		names.push( obj.name );
-
-	} );
-	assert.deepEqual( names, expectedAncestors, "Traversed ancestors in expected order" );
-
-} );

+ 0 - 152
test/unit/src/core/Raycaster.js

@@ -1,152 +0,0 @@
-/**
- * @author simonThiele / https://github.com/simonThiele
- */
-
-QUnit.module( "Raycaster" );
-
-QUnit.test( "intersectObjects" , function( assert ) {
-	var raycaster = getRaycaster();
-	var objectsToCheck = getObjectsToCheck();
-
-	assert.ok( raycaster.intersectObjects( objectsToCheck ).length === 1,
-		"no recursive search should lead to one hit" );
-
-	assert.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++ ) {
-
-	  assert.ok( intersections[ i ].distance <= intersections[ i + 1 ].distance, "intersections are sorted" );
-
-	}
-});
-
-QUnit.test( "intersectObject" , function( assert ) {
-	var raycaster = getRaycaster();
-	var objectsToCheck = getObjectsToCheck();
-
-	assert.ok( raycaster.intersectObject( objectsToCheck[ 0 ] ).length === 1,
-		"no recursive search should lead to one hit" );
-
-	assert.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++ ) {
-
-	  assert.ok( intersections[ i ].distance <= intersections[ i + 1 ].distance, "intersections are sorted" );
-
-	}
-});
-
-QUnit.test( "setFromCamera" , function( assert ) {
-	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 );
-	assert.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, assert );
-
-		}
-
-	}
-});
-
-function checkRayDirectionAgainstReferenceVector( rayDirection, refVector, assert ) {
-	assert.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 ) );
-}
-
-QUnit.test( "set", function ( assert ) {
-
-	var origin = new THREE.Vector3( 0, 0, 0 );
-	var direction = new THREE.Vector3( 0, 0, - 1 );
-	var a = new THREE.Raycaster( origin.clone(), direction.clone() );
-
-	assert.deepEqual( a.ray.origin, origin, "Origin is correct" );
-	assert.deepEqual( a.ray.direction, direction, "Direction is correct" );
-
-	origin.set( 1, 1, 1 );
-	direction.set( - 1, 0, 0 );
-	a.set( origin, direction );
-
-	assert.deepEqual( a.ray.origin, origin, "Origin was set correctly" );
-	assert.deepEqual( a.ray.direction, direction, "Direction was set correctly" );
-
-} );
-
-QUnit.test( "setFromCamera (Orthographic)", function ( assert ) {
-
-	var raycaster = new THREE.Raycaster();
-	var rayOrigin = raycaster.ray.origin;
-	var rayDirection = raycaster.ray.direction;
-	var camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1000 );
-	var expectedOrigin = new THREE.Vector3( 0, 0, 0 );
-	var expectedDirection = new THREE.Vector3( 0, 0, - 1 );
-
-	raycaster.setFromCamera( { x: 0, y: 0 }, camera );
-	assert.deepEqual( rayOrigin, expectedOrigin, "Ray origin has the right coordinates" );
-	assert.deepEqual( rayDirection, expectedDirection, "Camera and Ray are pointing towards -z" );
-
-} );

+ 0 - 32
test/unit/src/core/Uniform.js

@@ -1,32 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "Uniform" );
-
-QUnit.test( "constructor", function ( assert ) {
-
-	var a;
-	var b = new THREE.Vector3( x, y, z );
-
-	a = new THREE.Uniform( 5 );
-	assert.strictEqual( a.value, 5, "New constructor works with simple values" );
-
-	a = new THREE.Uniform( b );
-	assert.ok( a.value.equals( b ), "New constructor works with complex values" );
-
-} );
-
-QUnit.test( "clone", function ( assert ) {
-
-	var a = new THREE.Uniform( 23 );
-	var b = a.clone();
-
-	assert.strictEqual( b.value, a.value, "clone() with simple values works" );
-
-	a = new THREE.Uniform( new THREE.Vector3( 1, 2, 3 ) );
-	b = a.clone();
-
-	assert.ok( b.value.equals( a.value ), "clone() with complex values works" );
-
-} );

+ 0 - 6
test/unit/src/extras/SceneUtils.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of SceneUtils")

+ 0 - 6
test/unit/src/extras/ShapeUtils.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of ShapeUtils")

+ 0 - 6
test/unit/src/extras/core/Curve.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Curve")

+ 0 - 6
test/unit/src/extras/core/CurvePath.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of CurvePath")

+ 0 - 6
test/unit/src/extras/core/Font.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Font")

+ 0 - 6
test/unit/src/extras/core/Interpolations.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Interpolations")

+ 0 - 6
test/unit/src/extras/core/Path.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Path")

+ 0 - 6
test/unit/src/extras/core/PathPrototype.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of PathPrototype")

+ 0 - 6
test/unit/src/extras/core/Shape.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of Shape")

+ 0 - 6
test/unit/src/extras/core/ShapePath.js

@@ -1,6 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
-
-//Todo
-console.warn("Todo: Unit tests of ShapePath")

+ 0 - 341
test/unit/src/extras/curves/CatmullRomCurve3.js

@@ -1,341 +0,0 @@
-/**
- * @author zz85 / http://joshuakoo.com
- */
-
-QUnit.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 )
-];
-
-QUnit.test( "catmullrom check", function( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var expectedPoints = [
-
-		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, - 2.720000000000023, - 67.68 ),
-		new THREE.Vector3( 65.75999999999999, - 51.04000000000001, - 65.75999999999999 ),
-		new THREE.Vector3( 60, - 100, - 60 )
-
-	];
-
-	var points = curve.getPoints( 10 );
-
-	assert.equal( points.length, expectedPoints.length, 'correct number of points.' );
-
-	points.forEach( function ( point, i ) {
-
-		assert.numEqual( point.x, expectedPoints[ i ].x, 'points[' + i + '].x' );
-		assert.numEqual( point.y, expectedPoints[ i ].y, 'points[' + i + '].y' );
-		assert.numEqual( point.z, expectedPoints[ i ].z, 'points[' + i + '].z' );
-
-	} );
-
-} );
-
-QUnit.test( "chordal basic check", function( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-
-	curve.type = 'chordal';
-
-	var expectedPoints = [
-		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, - 1.137153397546383, - 63.542500175682434 ),
-		new THREE.Vector3( 62.65687513176183, - 49.85286504815978, - 62.65687513176183 ),
-		new THREE.Vector3( 60.00000000000001, - 100, - 60.00000000000001 )
-	];
-
-	var points = curve.getPoints( 10 );
-
-	assert.equal( points.length, expectedPoints.length, 'correct number of points.' );
-
-	points.forEach( function ( point, i ) {
-
-		assert.numEqual( point.x, expectedPoints[ i ].x, 'points[' + i + '].x' );
-		assert.numEqual( point.y, expectedPoints[ i ].y, 'points[' + i + '].y' );
-		assert.numEqual( point.z, expectedPoints[ i ].z, 'points[' + i + '].z' );
-
-	} );
-
-} );
-
-QUnit.test( "centripetal basic check", function( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'centripetal';
-
-	var expectedPoints = [
-		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, - 1.646250966068339, - 65.25545512241153 ),
-		new THREE.Vector3( 63.94159134180865, - 50.234688224551256, - 63.94159134180865 ),
-		new THREE.Vector3( 59.99999999999999, - 100, - 59.99999999999999 ),
-	];
-
-	var points = curve.getPoints( 10 );
-
-	assert.equal( points.length, expectedPoints.length, 'correct number of points.' );
-
-	points.forEach( function ( point, i ) {
-
-		assert.numEqual( point.x, expectedPoints[ i ].x, 'points[' + i + '].x' );
-		assert.numEqual( point.y, expectedPoints[ i ].y, 'points[' + i + '].y' );
-		assert.numEqual( point.z, expectedPoints[ i ].z, 'points[' + i + '].z' );
-
-	} );
-
-} );
-
-QUnit.test( "closed catmullrom basic check", function( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-	curve.closed = true;
-
-	var expectedPoints = [
-		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 points = curve.getPoints( 10 );
-
-	assert.equal( points.length, expectedPoints.length, 'correct number of points.' );
-
-	points.forEach( function ( point, i ) {
-
-		assert.numEqual( point.x, expectedPoints[ i ].x, 'points[' + i + '].x' );
-		assert.numEqual( point.y, expectedPoints[ i ].y, 'points[' + i + '].y' );
-		assert.numEqual( point.z, expectedPoints[ i ].z, 'points[' + i + '].z' );
-
-	} );
-
-} );
-
-
-//
-// curve.type = 'catmullrom'; only from here on
-//
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var length = curve.getLength();
-	var expectedLength = 551.549686276872;
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var expectedLengths = [
-		0,
-		120,
-		220,
-		416.9771560359221,
-		536.9771560359221
-	];
-	var lengths = curve.getLengths( expectedLengths.length - 1 );
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPointAt", function ( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var expectedPoints = [
-		new THREE.Vector3( - 60, - 100, 60 ),
-		new THREE.Vector3( - 64.84177333183106, 64.86956465359813, 64.84177333183106 ),
-		new THREE.Vector3( - 28.288507045700854, 104.83101184518996, 28.288507045700854 ),
-		new THREE.Vector3( 60, - 100, - 60 )
-	];
-
-	var points = [
-		curve.getPointAt( 0 ),
-		curve.getPointAt( 0.3 ),
-		curve.getPointAt( 0.5 ),
-		curve.getPointAt( 1 )
-	];
-
-	assert.deepEqual( points, expectedPoints, "Correct points" );
-
-} );
-
-QUnit.test( "getTangent/getTangentAt", function ( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var expectedTangents = [
-		new THREE.Vector3( 0, 1, 0 ),
-		new THREE.Vector3( - 0.0001090274561657922, 0.9999999881130137, 0.0001090274561657922 ),
-		new THREE.Vector3( 0.7071067811865475, - 2.0930381713877622e-13, - 0.7071067811865475 ),
-		new THREE.Vector3( 0.43189437062802816, - 0.7917919583070032, - 0.43189437062802816 ),
-		new THREE.Vector3( - 0.00019991333100812723, - 0.9999999600346592, 0.00019991333100812723 )
-	];
-
-	var tangents = [
-		curve.getTangent( 0 ),
-		curve.getTangent( 0.25 ),
-		curve.getTangent( 0.5 ),
-		curve.getTangent( 0.75 ),
-		curve.getTangent( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangent #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangent #" + i + ": y correct" );
-
-	} );
-
-	//
-
-	expectedTangents = [
-		new THREE.Vector3( 0, 1, 0 ),
-		new THREE.Vector3( - 0.10709018822205997, 0.9884651653817284, 0.10709018822205997 ),
-		new THREE.Vector3( 0.6396363672964268, - 0.4262987629159402, - 0.6396363672964268 ),
-		new THREE.Vector3( 0.5077298411616501, - 0.6960034603275557, - 0.5077298411616501 ),
-		new THREE.Vector3( - 0.00019991333100812723, - 0.9999999600346592, 0.00019991333100812723 )
-	];
-
-	tangents = [
-		curve.getTangentAt( 0 ),
-		curve.getTangentAt( 0.25 ),
-		curve.getTangentAt( 0.5 ),
-		curve.getTangentAt( 0.75 ),
-		curve.getTangentAt( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangentAt #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangentAt #" + i + ": y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "computeFrenetFrames", function ( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var expected = {
-		binormals: [
-			new THREE.Vector3( - 1, 0, 0 ),
-			new THREE.Vector3( - 0.28685061854203, 0.6396363672964267, - 0.7131493814579701 ),
-			new THREE.Vector3( - 1.9982670528160395e-8, - 0.0001999133310081272, - 0.9999999800173295 )
-		],
-		normals: [
-			new THREE.Vector3( 0, 0, - 1 ),
-			new THREE.Vector3( - 0.7131493814579699, - 0.6396363672964268, - 0.2868506185420297 ),
-			new THREE.Vector3( - 0.9999999800173294, 0.00019991333100810582, - 1.99826701852146e-8 )
-		],
-		tangents: [
-			new THREE.Vector3( 0, 1, 0 ),
-			new THREE.Vector3( 0.6396363672964269, - 0.4262987629159403, - 0.6396363672964269 ),
-			new THREE.Vector3( - 0.0001999133310081273, - 0.9999999600346594, 0.0001999133310081273 )
-		]
-	};
-
-	var frames = curve.computeFrenetFrames( 2, false );
-
-	Object.keys( expected ).forEach( function ( group, i ) {
-
-		expected[ group ].forEach( function ( vec, j ) {
-
-			assert.numEqual( frames[ group ][ j ].x, vec.x, "Frenet frames [" + i + ", " + j + "].x correct" );
-			assert.numEqual( frames[ group ][ j ].y, vec.y, "Frenet frames [" + i + ", " + j + "].y correct" );
-			assert.numEqual( frames[ group ][ j ].z, vec.z, "Frenet frames [" + i + ", " + j + "].z correct" );
-
-		} );
-
-	} );
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.5, 500 );
-
-	var expectedSomewhere = 0.8964116382083199;
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, expectedSomewhere, "getUtoTmapping( 0.5, 500 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = new THREE.CatmullRomCurve3( positions );
-	curve.type = 'catmullrom';
-
-	var expectedPoints = [
-		new THREE.Vector3( - 60, - 100, 60 ),
-		new THREE.Vector3( - 60, 10.311489426555056, 60 ),
-		new THREE.Vector3( - 65.05889864636504, 117.99691802595966, 65.05889864636504 ),
-		new THREE.Vector3( 6.054276900088592, 78.7153118386369, - 6.054276900088592 ),
-		new THREE.Vector3( 64.9991491385602, 8.386980812799566, - 64.9991491385602 ),
-		new THREE.Vector3( 60, - 100, - 60 )
-	];
-
-	var points = curve.getSpacedPoints();
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-} );

+ 0 - 192
test/unit/src/extras/curves/CubicBezierCurve.js

@@ -1,192 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "CubicBezierCurve", {
-
-	before: function () {
-
-		// from the docs
-		this.curve = new THREE.CubicBezierCurve(
-			new THREE.Vector2( - 10, 0 ),
-			new THREE.Vector2( - 5, 15 ),
-			new THREE.Vector2( 20, 15 ),
-			new THREE.Vector2( 10, 0 )
-		);
-
-	}
-
-} );
-
-QUnit.test( "Simple curve", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( - 3.359375, 8.4375 ),
-		new THREE.Vector2( 5.625, 11.25 ),
-		new THREE.Vector2( 11.796875, 8.4375 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = curve.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-	// symmetry
-	var curveRev = new THREE.CubicBezierCurve(
-		curve.v3, curve.v2, curve.v1, curve.v0
-	);
-
-	points = curveRev.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Reversed: Correct number of points" );
-	assert.deepEqual( points, expectedPoints.reverse(), "Reversed: Correct points curve" );
-
-} );
-
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = this.curve;
-
-	var length = curve.getLength();
-	var expectedLength = 36.64630888504102;
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var expectedLengths = [
-		0,
-		10.737285813492393,
-		20.15159143794633,
-		26.93408340370825,
-		35.56079575637337
-	];
-	var lengths = curve.getLengths( expectedLengths.length - 1 );
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPointAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( - 3.3188282598022596, 8.463722639089221 ),
-		new THREE.Vector2( 3.4718554735926617, 11.07899406116314 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = [
-		curve.getPointAt( 0 ),
-		curve.getPointAt( 0.3 ),
-		curve.getPointAt( 0.5 ),
-		curve.getPointAt( 1 )
-	];
-
-	assert.deepEqual( points, expectedPoints, "Correct points" );
-
-} );
-
-QUnit.test( "getTangent/getTangentAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedTangents = [
-		new THREE.Vector2( 0.316370061632252, 0.9486358543207215 ),
-		new THREE.Vector2( 0.838961283088303, 0.5441911111721949 ),
-		new THREE.Vector2( 1, 0 ),
-		new THREE.Vector2( 0.47628313192245453, - 0.8792919755383518 ),
-		new THREE.Vector2( - 0.5546041767829665, - 0.8321142992972107 )
-	];
-
-	var tangents = [
-		curve.getTangent( 0 ),
-		curve.getTangent( 0.25 ),
-		curve.getTangent( 0.5 ),
-		curve.getTangent( 0.75 ),
-		curve.getTangent( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangent #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangent #" + i + ": y correct" );
-
-	} );
-
-	//
-
-	expectedTangents = [
-		new THREE.Vector2( 0.316370061632252, 0.9486358543207215 ),
-		new THREE.Vector2( 0.7794223085548987, 0.6264988945935596 ),
-		new THREE.Vector2( 0.988266153082452, 0.15274164681452052 ),
-		new THREE.Vector2( 0.5004110404199416, - 0.8657879593906534 ),
-		new THREE.Vector2( - 0.5546041767829665, - 0.8321142992972107 )
-	];
-
-	tangents = [
-		curve.getTangentAt( 0 ),
-		curve.getTangentAt( 0.25 ),
-		curve.getTangentAt( 0.5 ),
-		curve.getTangentAt( 0.75 ),
-		curve.getTangentAt( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangentAt #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangentAt #" + i + ": y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = this.curve;
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.5, 1 );
-
-	var expectedSomewhere = 0.02130029182257093;
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, expectedSomewhere, "getUtoTmapping( 0.5, 1 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( - 6.16826457740703, 6.17025727295411 ),
-		new THREE.Vector2( - 0.058874033259857184, 10.1240558653185 ),
-		new THREE.Vector2( 7.123523032625162, 11.154913869041575 ),
-		new THREE.Vector2( 12.301846885754463, 6.808865855469985 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = curve.getSpacedPoints();
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-} );

+ 0 - 230
test/unit/src/extras/curves/CubicBezierCurve3.js

@@ -1,230 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "CubicBezierCurve3", {
-
-	before: function () {
-
-		// modified from the docs
-		this.curve = new THREE.CubicBezierCurve3(
-			new THREE.Vector3( - 10, 0, 2 ),
-			new THREE.Vector3( - 5, 15, 4 ),
-			new THREE.Vector3( 20, 15, - 5 ),
-			new THREE.Vector3( 10, 0, 10 )
-		);
-
-	}
-
-} );
-
-QUnit.test( "Simple curve", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector3( - 10, 0, 2 ),
-		new THREE.Vector3( - 3.359375, 8.4375, 1.984375 ),
-		new THREE.Vector3( 5.625, 11.25, 1.125 ),
-		new THREE.Vector3( 11.796875, 8.4375, 2.703125 ),
-		new THREE.Vector3( 10, 0, 10 )
-	];
-
-	var points = curve.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-	// symmetry
-	var curveRev = new THREE.CubicBezierCurve3(
-		curve.v3, curve.v2, curve.v1, curve.v0
-	);
-
-	points = curveRev.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Reversed: Correct number of points" );
-	assert.deepEqual( points, expectedPoints.reverse(), "Reversed: Correct points curve" );
-
-} );
-
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = this.curve;
-
-	var length = curve.getLength();
-	var expectedLength = 39.58103024989427;
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var expectedLengths = [
-		0,
-		10.73729718231036,
-		20.19074500737662,
-		27.154413277853756,
-		38.453287150114214
-	];
-	var lengths = curve.getLengths( expectedLengths.length - 1 );
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPointAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector3( - 10, 0, 2 ),
-		new THREE.Vector3( - 2.591880240484318, 8.908333501170798, 1.8953420625251136 ),
-		new THREE.Vector3( 4.866251460832755, 11.22787914038507, 1.150832855206874 ),
-		new THREE.Vector3( 10, 0, 10 )
-	];
-
-	var points = [
-		curve.getPointAt( 0 ),
-		curve.getPointAt( 0.3 ),
-		curve.getPointAt( 0.5 ),
-		curve.getPointAt( 1 )
-	];
-
-	assert.deepEqual( points, expectedPoints, "Correct points" );
-
-} );
-
-QUnit.test( "getTangent/getTangentAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedTangents = [
-		new THREE.Vector3( 0.3138715439944244, 0.9411440474105875, 0.12542940601858074 ),
-		new THREE.Vector3( 0.8351825262580098, 0.54174002562179, - 0.09480449605683638 ),
-		new THREE.Vector3( 0.9997531780538501, 0, - 0.02221672728433752 ),
-		new THREE.Vector3( 0.40693407933981185, - 0.7512629496079668, 0.5196235518317053 ),
-		new THREE.Vector3( - 0.42632467075185815, - 0.6396469221230213, 0.6396085444448543 )
-	];
-
-	var tangents = [
-		curve.getTangent( 0 ),
-		curve.getTangent( 0.25 ),
-		curve.getTangent( 0.5 ),
-		curve.getTangent( 0.75 ),
-		curve.getTangent( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangent #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangent #" + i + ": y correct" );
-
-	} );
-
-	//
-
-	expectedTangents = [
-		new THREE.Vector3( 0.3138715439944244, 0.9411440474105875, 0.12542940601858074 ),
-		new THREE.Vector3( 0.8016539573770751, 0.5918626760037707, - 0.08396133262002324 ),
-		new THREE.Vector3( 0.997337559412928, 0.05740742907719314, - 0.044968652092444425 ),
-		new THREE.Vector3( 0.1389373097746809, - 0.7882209938358005, 0.5995032016837588 ),
-		new THREE.Vector3( - 0.42632467075185815, - 0.6396469221230213, 0.6396085444448543 )
-	];
-
-	tangents = [
-		curve.getTangentAt( 0 ),
-		curve.getTangentAt( 0.25 ),
-		curve.getTangentAt( 0.5 ),
-		curve.getTangentAt( 0.75 ),
-		curve.getTangentAt( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangentAt #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangentAt #" + i + ": y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = this.curve;
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.5, 1 );
-
-	var expectedSomewhere = 0.021163245321323316;
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, expectedSomewhere, "getUtoTmapping( 0.5, 1 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector3( - 10, 0, 2 ),
-		new THREE.Vector3( - 5.756524515061918, 6.568020242700483, 2.22116711170301 ),
-		new THREE.Vector3( 1.0003511895116906, 10.49656064587831, 1.4727101010850698 ),
-		new THREE.Vector3( 8.767656412295171, 10.784286845278622, 1.2873599519775174 ),
-		new THREE.Vector3( 12.306772513558396, 5.545103788071547, 4.909948454535794 ),
-		new THREE.Vector3( 10, 0, 10 )
-	];
-
-	var points = curve.getSpacedPoints();
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-} );
-
-QUnit.test( "computeFrenetFrames", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expected = {
-		binormals: [
-			new THREE.Vector3( - 0.9486358543207215, 0.316370061632252, - 6.938893903907228e-18 ),
-			new THREE.Vector3( - 0.05491430765311864, 0.9969838307670049, 0.054842137122173326 ),
-			new THREE.Vector3( 0.5944656510461876, 0.334836503700931, 0.7310917216844742 )
-		],
-		normals: [
-			new THREE.Vector3( 0.03968210891259515, 0.11898683173537697, - 0.9921025471723304 ),
-			new THREE.Vector3( - 0.047981365124836806, 0.05222670079466692, - 0.9974819097732357 ),
-			new THREE.Vector3( 0.6818048583242511, - 0.6919077473246573, - 0.23749906180354932 )
-		],
-		tangents: [
-			new THREE.Vector3( 0.3138715439944244, 0.9411440474105875, 0.12542940601858074 ),
-			new THREE.Vector3( 0.9973375594129282, 0.05740742907719315, - 0.04496865209244443 ),
-			new THREE.Vector3( - 0.42632467075185815, - 0.6396469221230213, 0.6396085444448543 )
-		]
-	};
-
-	var frames = curve.computeFrenetFrames( 2, false );
-
-	Object.keys( expected ).forEach( function ( group, i ) {
-
-		expected[ group ].forEach( function ( vec, j ) {
-
-			assert.numEqual( frames[ group ][ j ].x, vec.x, "Frenet frames [" + i + ", " + j + "].x correct" );
-			assert.numEqual( frames[ group ][ j ].y, vec.y, "Frenet frames [" + i + ", " + j + "].y correct" );
-			assert.numEqual( frames[ group ][ j ].z, vec.z, "Frenet frames [" + i + ", " + j + "].z correct" );
-
-		} );
-
-	} );
-
-} );

+ 0 - 173
test/unit/src/extras/curves/EllipseCurve.js

@@ -1,173 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "EllipseCurve", {
-
-	before: function () {
-
-		// from the docs
-		this.curve = new THREE.EllipseCurve(
-			0, 0, // ax, aY
-			10, 10, // xRadius, yRadius
-			0, 2 * Math.PI, // aStartAngle, aEndAngle
-			false, // aClockwise
-			0 // aRotation
-		);
-
-	}
-
-} );
-
-QUnit.test( "Simple curve", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( 10, 0 ),
-		new THREE.Vector2( 0, 10 ),
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( 0, - 10 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = curve.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-
-	points.forEach( function ( point, i ) {
-
-		assert.numEqual( point.x, expectedPoints[ i ].x, "point[" + i + "].x correct" );
-		assert.numEqual( point.y, expectedPoints[ i ].y, "point[" + i + "].y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = this.curve;
-
-	var length = curve.getLength();
-	var expectedLength = 62.829269247282795;
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var lengths = curve.getLengths( 5 );
-	var expectedLengths = [
-		0,
-		11.755705045849462,
-		23.51141009169892,
-		35.26711513754839,
-		47.02282018339785,
-		58.77852522924731
-	];
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPoint/getPointAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var testValues = [ 0, 0.3, 0.5, 0.7, 1 ];
-
-	testValues.forEach( function ( val, i ) {
-
-		var expectedX = Math.cos( val * Math.PI * 2 ) * 10;
-		var expectedY = Math.sin( val * Math.PI * 2 ) * 10;
-
-		var p = curve.getPoint( val );
-		var a = curve.getPointAt( val );
-
-		assert.numEqual( p.x, expectedX, "getPoint(" + val + ").x correct" );
-		assert.numEqual( p.y, expectedY, "getPoint(" + val + ").y correct" );
-
-		assert.numEqual( a.x, expectedX, "getPointAt(" + val + ").x correct" );
-		assert.numEqual( a.y, expectedY, "getPointAt(" + val + ").y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getTangent", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedTangents = [
-		new THREE.Vector2( - 0.000314159260186071, 0.9999999506519786 ),
-		new THREE.Vector2( - 1, 0 ),
-		new THREE.Vector2( 0, - 1 ),
-		new THREE.Vector2( 1, 0 ),
-		new THREE.Vector2( 0.00031415926018600165, 0.9999999506519784 )
-	];
-
-	var tangents = [
-		curve.getTangent( 0 ),
-		curve.getTangent( 0.25 ),
-		curve.getTangent( 0.5 ),
-		curve.getTangent( 0.75 ),
-		curve.getTangent( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangent #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangent #" + i + ": y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = this.curve;
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.7, 1 );
-
-	var expectedSomewhere = 0.01591614882650014;
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, expectedSomewhere, "getUtoTmapping( 0.7, 1 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( 10, 0 ),
-		new THREE.Vector2( 3.0901699437494603, 9.51056516295154 ),
-		new THREE.Vector2( - 8.090169943749492, 5.877852522924707 ),
-		new THREE.Vector2( - 8.090169943749459, - 5.877852522924751 ),
-		new THREE.Vector2( 3.0901699437494807, - 9.510565162951533 ),
-		new THREE.Vector2( 10, - 2.4492935982947065e-15 )
-	];
-
-	var points = curve.getSpacedPoints();
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-
-	expectedPoints.forEach( function ( exp, i ) {
-
-		var point = points[ i ];
-
-		assert.numEqual( point.x, exp.x, "Point #" + i + ": x correct" );
-		assert.numEqual( point.y, exp.y, "Point #" + i + ": y correct" );
-
-	} );
-
-} );

+ 0 - 152
test/unit/src/extras/curves/LineCurve.js

@@ -1,152 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "LineCurve", {
-
-	before: function () {
-
-		this.points = [
-			new THREE.Vector2( 0, 0 ),
-			new THREE.Vector2( 10, 10 ),
-			new THREE.Vector2( - 10, 10 ),
-			new THREE.Vector2( - 8, 5 )
-		];
-
-		this.curve = new THREE.LineCurve( this.points[ 0 ], this.points[ 1 ] );
-
-	}
-
-} );
-
-QUnit.test( "Simple curve", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( 0, 0 ),
-		new THREE.Vector2( 2, 2 ),
-		new THREE.Vector2( 4, 4 ),
-		new THREE.Vector2( 6, 6 ),
-		new THREE.Vector2( 8, 8 ),
-		new THREE.Vector2( 10, 10 )
-	];
-
-	var points = curve.getPoints();
-
-	assert.deepEqual( points, expectedPoints, "Correct points for first curve" );
-
-	//
-
-	curve = new THREE.LineCurve( this.points[ 1 ], this.points[ 2 ] );
-
-	expectedPoints = [
-		new THREE.Vector2( 10, 10 ),
-		new THREE.Vector2( 6, 10 ),
-		new THREE.Vector2( 2, 10 ),
-		new THREE.Vector2( - 2, 10 ),
-		new THREE.Vector2( - 6, 10 ),
-		new THREE.Vector2( - 10, 10 )
-	];
-
-	points = curve.getPoints();
-
-	assert.deepEqual( points, expectedPoints, "Correct points for second curve" );
-
-} );
-
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = this.curve;
-
-	var length = curve.getLength();
-	var expectedLength = Math.sqrt( 200 );
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var lengths = curve.getLengths( 5 );
-	var expectedLengths = [
-		0.0,
-		Math.sqrt( 8 ),
-		Math.sqrt( 32 ),
-		Math.sqrt( 72 ),
-		Math.sqrt( 128 ),
-		Math.sqrt( 200 )
-	];
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPointAt", function ( assert ) {
-
-	var curve = new THREE.LineCurve( this.points[ 0 ], this.points[ 3 ] );
-
-	var expectedPoints = [
-		new THREE.Vector2( 0, 0 ),
-		new THREE.Vector2( - 2.4, 1.5 ),
-		new THREE.Vector2( - 4, 2.5 ),
-		new THREE.Vector2( - 8, 5 )
-	];
-
-	var points = [
-		curve.getPointAt( 0 ),
-		curve.getPointAt( 0.3 ),
-		curve.getPointAt( 0.5 ),
-		curve.getPointAt( 1 )
-	];
-
-	assert.deepEqual( points, expectedPoints, "Correct points" );
-
-} );
-
-QUnit.test( "getTangent", function ( assert ) {
-
-	var curve = this.curve;
-
-	var tangent = curve.getTangent( 0 );
-	var expectedTangent = Math.sqrt( 0.5 );
-
-	assert.numEqual( tangent.x, expectedTangent, "tangent.x correct" );
-	assert.numEqual( tangent.y, expectedTangent, "tangent.y correct" );
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = this.curve;
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.3, 0 );
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, 0.3, "getUtoTmapping( 0.3, 0 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( 0, 0 ),
-		new THREE.Vector2( 2.5, 2.5 ),
-		new THREE.Vector2( 5, 5 ),
-		new THREE.Vector2( 7.5, 7.5 ),
-		new THREE.Vector2( 10, 10 )
-	];
-
-	var points = curve.getSpacedPoints( 4 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-} );

+ 0 - 181
test/unit/src/extras/curves/LineCurve3.js

@@ -1,181 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "LineCurve3", {
-
-	before: function () {
-
-		this.points = [
-			new THREE.Vector3( 0, 0, 0 ),
-			new THREE.Vector3( 10, 10, 10 ),
-			new THREE.Vector3( - 10, 10, - 10 ),
-			new THREE.Vector3( - 8, 5, - 7 )
-		];
-
-		this.curve = new THREE.LineCurve3( this.points[ 0 ], this.points[ 1 ] );
-
-	}
-
-} );
-
-QUnit.test( "Simple curve", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector3( 0, 0, 0 ),
-		new THREE.Vector3( 2, 2, 2 ),
-		new THREE.Vector3( 4, 4, 4 ),
-		new THREE.Vector3( 6, 6, 6 ),
-		new THREE.Vector3( 8, 8, 8 ),
-		new THREE.Vector3( 10, 10, 10 )
-	];
-
-	var points = curve.getPoints();
-
-	assert.deepEqual( points, expectedPoints, "Correct points for first curve" );
-
-	//
-
-	curve = new THREE.LineCurve3( this.points[ 1 ], this.points[ 2 ] );
-
-	expectedPoints = [
-		new THREE.Vector3( 10, 10, 10 ),
-		new THREE.Vector3( 6, 10, 6 ),
-		new THREE.Vector3( 2, 10, 2 ),
-		new THREE.Vector3( - 2, 10, - 2 ),
-		new THREE.Vector3( - 6, 10, - 6 ),
-		new THREE.Vector3( - 10, 10, - 10 )
-	];
-
-	points = curve.getPoints();
-
-	assert.deepEqual( points, expectedPoints, "Correct points for second curve" );
-
-} );
-
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = this.curve;
-
-	var length = curve.getLength();
-	var expectedLength = Math.sqrt( 300 );
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var lengths = curve.getLengths( 5 );
-	var expectedLengths = [
-		0.0,
-		Math.sqrt( 12 ),
-		Math.sqrt( 48 ),
-		Math.sqrt( 108 ),
-		Math.sqrt( 192 ),
-		Math.sqrt( 300 )
-	];
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPointAt", function ( assert ) {
-
-	var curve = new THREE.LineCurve3( this.points[ 0 ], this.points[ 3 ] );
-
-	var expectedPoints = [
-		new THREE.Vector3( 0, 0, 0 ),
-		new THREE.Vector3( - 2.4, 1.5, - 2.1 ),
-		new THREE.Vector3( - 4, 2.5, - 3.5 ),
-		new THREE.Vector3( - 8, 5, - 7 )
-	];
-
-	var points = [
-		curve.getPointAt( 0 ),
-		curve.getPointAt( 0.3 ),
-		curve.getPointAt( 0.5 ),
-		curve.getPointAt( 1 )
-	];
-
-	assert.deepEqual( points, expectedPoints, "Correct getPointAt points" );
-
-} );
-
-QUnit.test( "getTangent/getTangentAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var tangent = curve.getTangent( 0.5 );
-	var expectedTangent = Math.sqrt( 1 / 3 );
-
-	assert.numEqual( tangent.x, expectedTangent, "tangent.x correct" );
-	assert.numEqual( tangent.y, expectedTangent, "tangent.y correct" );
-	assert.numEqual( tangent.z, expectedTangent, "tangent.z correct" );
-
-	tangent = curve.getTangentAt( 0.5 );
-
-	assert.numEqual( tangent.x, expectedTangent, "tangentAt.x correct" );
-	assert.numEqual( tangent.y, expectedTangent, "tangentAt.y correct" );
-	assert.numEqual( tangent.z, expectedTangent, "tangentAt.z correct" );
-
-} );
-
-QUnit.test( "computeFrenetFrames", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expected = {
-		binormals: new THREE.Vector3( - 0.5 * Math.sqrt( 2 ), 0.5 * Math.sqrt( 2 ), 0 ),
-		normals: new THREE.Vector3( Math.sqrt( 1 / 6 ), Math.sqrt( 1 / 6 ), - Math.sqrt( 2 / 3 ) ),
-		tangents: new THREE.Vector3( Math.sqrt( 1 / 3 ), Math.sqrt( 1 / 3 ), Math.sqrt( 1 / 3 ) )
-	};
-
-	var frames = curve.computeFrenetFrames( 1, false );
-
-	for ( var val in expected ) {
-
-		assert.numEqual( frames[ val ][ 0 ].x, expected[ val ].x, "Frenet frames " + val + ".x correct" );
-		assert.numEqual( frames[ val ][ 0 ].y, expected[ val ].y, "Frenet frames " + val + ".y correct" );
-		assert.numEqual( frames[ val ][ 0 ].z, expected[ val ].z, "Frenet frames " + val + ".z correct" );
-
-	}
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = this.curve;
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.7, 0 );
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, 0.7, "getUtoTmapping( 0.7, 0 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector3( 0, 0, 0 ),
-		new THREE.Vector3( 2.5, 2.5, 2.5 ),
-		new THREE.Vector3( 5, 5, 5 ),
-		new THREE.Vector3( 7.5, 7.5, 7.5 ),
-		new THREE.Vector3( 10, 10, 10 )
-	];
-
-	var points = curve.getSpacedPoints( 4 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-} );

+ 0 - 191
test/unit/src/extras/curves/QuadraticBezierCurve.js

@@ -1,191 +0,0 @@
-/**
- * @author moraxy / https://github.com/moraxy
- */
-
-QUnit.module( "QuadraticBezierCurve", {
-
-	before: function () {
-
-		// from the docs
-		this.curve = new THREE.QuadraticBezierCurve(
-			new THREE.Vector2( - 10, 0 ),
-			new THREE.Vector2( 20, 15 ),
-			new THREE.Vector2( 10, 0 )
-		);
-
-	}
-
-} );
-
-QUnit.test( "Simple curve", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( 2.5, 5.625 ),
-		new THREE.Vector2( 10, 7.5 ),
-		new THREE.Vector2( 12.5, 5.625 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = curve.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-	// symmetry
-	var curveRev = new THREE.QuadraticBezierCurve(
-		curve.v2, curve.v1, curve.v0
-	);
-
-	points = curveRev.getPoints( expectedPoints.length - 1 );
-
-	assert.strictEqual( points.length, expectedPoints.length, "Reversed: Correct number of points" );
-	assert.deepEqual( points, expectedPoints.reverse(), "Reversed: Correct points curve" );
-
-} );
-
-QUnit.test( "getLength/getLengths", function ( assert ) {
-
-	var curve = this.curve;
-
-	var length = curve.getLength();
-	var expectedLength = 31.269026549416683;
-
-	assert.numEqual( length, expectedLength, "Correct length of curve" );
-
-	var expectedLengths = [
-		0,
-		13.707320124663317,
-		21.43814317269643,
-		24.56314317269643,
-		30.718679298818998
-	];
-	var lengths = curve.getLengths( expectedLengths.length - 1 );
-
-	assert.strictEqual( lengths.length, expectedLengths.length, "Correct number of segments" );
-
-	lengths.forEach( function ( segment, i ) {
-
-		assert.numEqual( segment, expectedLengths[ i ], "segment[" + i + "] correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getPointAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( - 1.5127849599387615, 3.993582003773624 ),
-		new THREE.Vector2( 4.310076165722796, 6.269921971403917 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = [
-		curve.getPointAt( 0 ),
-		curve.getPointAt( 0.3 ),
-		curve.getPointAt( 0.5 ),
-		curve.getPointAt( 1 )
-	];
-
-	assert.deepEqual( points, expectedPoints, "Correct points" );
-
-} );
-
-QUnit.test( "getTangent/getTangentAt", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedTangents = [
-		new THREE.Vector2( 0.89443315420562, 0.44720166888975904 ),
-		new THREE.Vector2( 0.936329177569021, 0.3511234415884543 ),
-		new THREE.Vector2( 1, 0 ),
-		new THREE.Vector2( - 5.921189464667277e-13, - 1 ),
-		new THREE.Vector2( - 0.5546617882904897, - 0.8320758983472577 )
-	];
-
-	var tangents = [
-		curve.getTangent( 0 ),
-		curve.getTangent( 0.25 ),
-		curve.getTangent( 0.5 ),
-		curve.getTangent( 0.75 ),
-		curve.getTangent( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangent #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangent #" + i + ": y correct" );
-
-	} );
-
-	//
-
-	expectedTangents = [
-		new THREE.Vector2( 0.89443315420562, 0.44720166888975904 ),
-		new THREE.Vector2( 0.9125211423360805, 0.40902954024086674 ),
-		new THREE.Vector2( 0.9480289098765387, 0.3181842014278863 ),
-		new THREE.Vector2( 0.7969127189169473, - 0.6040944615111106 ),
-		new THREE.Vector2( - 0.5546617882904897, - 0.8320758983472577 )
-	];
-
-	tangents = [
-		curve.getTangentAt( 0 ),
-		curve.getTangentAt( 0.25 ),
-		curve.getTangentAt( 0.5 ),
-		curve.getTangentAt( 0.75 ),
-		curve.getTangentAt( 1 )
-	];
-
-	expectedTangents.forEach( function ( exp, i ) {
-
-		var tangent = tangents[ i ];
-
-		assert.numEqual( tangent.x, exp.x, "getTangentAt #" + i + ": x correct" );
-		assert.numEqual( tangent.y, exp.y, "getTangentAt #" + i + ": y correct" );
-
-	} );
-
-} );
-
-QUnit.test( "getUtoTmapping", function ( assert ) {
-
-	var curve = this.curve;
-
-	var start = curve.getUtoTmapping( 0, 0 );
-	var end = curve.getUtoTmapping( 0, curve.getLength() );
-	var somewhere = curve.getUtoTmapping( 0.5, 1 );
-
-	var expectedSomewhere = 0.015073978276116116;
-
-	assert.strictEqual( start, 0, "getUtoTmapping( 0, 0 ) is the starting point" );
-	assert.strictEqual( end, 1, "getUtoTmapping( 0, length ) is the ending point" );
-	assert.numEqual( somewhere, expectedSomewhere, "getUtoTmapping( 0.5, 1 ) is correct" );
-
-} );
-
-QUnit.test( "getSpacedPoints", function ( assert ) {
-
-	var curve = this.curve;
-
-	var expectedPoints = [
-		new THREE.Vector2( - 10, 0 ),
-		new THREE.Vector2( - 4.366603655406173, 2.715408933540383 ),
-		new THREE.Vector2( 1.3752241477827831, 5.191972084404416 ),
-		new THREE.Vector2( 7.312990279153634, 7.136310044848586 ),
-		new THREE.Vector2( 12.499856644824826, 5.653289188715387 ),
-		new THREE.Vector2( 10, 0 )
-	];
-
-	var points = curve.getSpacedPoints();
-
-	assert.strictEqual( points.length, expectedPoints.length, "Correct number of points" );
-	assert.deepEqual( points, expectedPoints, "Correct points calculated" );
-
-} );

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio