浏览代码

Merge branch 'dev' of https://github.com/mrdoob/three.js into dev

Andrii Iudin 8 年之前
父节点
当前提交
db2c935012
共有 100 个文件被更改,包括 620 次插入1426 次删除
  1. 5 5
      build/three.js
  2. 314 313
      build/three.min.js
  3. 5 5
      build/three.module.js
  4. 1 1
      docs/api/constants/CustomBlendingEquations.html
  5. 1 1
      docs/api/constants/Materials.html
  6. 8 3
      docs/api/constants/Textures.html
  7. 4 0
      docs/api/core/BufferAttribute.html
  8. 4 1
      docs/api/core/Object3D.html
  9. 2 2
      docs/api/extras/CurveUtils.html
  10. 6 6
      docs/api/extras/ShapeUtils.html
  11. 1 14
      docs/api/helpers/SkeletonHelper.html
  12. 1 1
      docs/api/helpers/SpotLightHelper.html
  13. 1 1
      docs/api/lights/DirectionalLight.html
  14. 1 1
      docs/api/loaders/AnimationLoader.html
  15. 1 1
      docs/api/loaders/AudioLoader.html
  16. 1 1
      docs/api/loaders/BufferGeometryLoader.html
  17. 1 1
      docs/api/loaders/CompressedTextureLoader.html
  18. 1 1
      docs/api/loaders/CubeTextureLoader.html
  19. 1 1
      docs/api/loaders/DataTextureLoader.html
  20. 3 3
      docs/api/loaders/FileLoader.html
  21. 1 1
      docs/api/loaders/FontLoader.html
  22. 1 1
      docs/api/loaders/JSONLoader.html
  23. 1 1
      docs/api/loaders/ObjectLoader.html
  24. 1 1
      docs/api/loaders/TextureLoader.html
  25. 1 1
      docs/api/materials/MeshBasicMaterial.html
  26. 1 1
      docs/api/materials/MeshLambertMaterial.html
  27. 1 1
      docs/api/materials/MeshPhongMaterial.html
  28. 6 2
      docs/api/materials/MeshStandardMaterial.html
  29. 1 1
      docs/api/objects/Group.html
  30. 0 128
      docs/examples/collada/Animation.html
  31. 0 102
      docs/examples/collada/AnimationHandler.html
  32. 0 116
      docs/examples/collada/KeyFrameAnimation.html
  33. 1 1
      docs/examples/loaders/BabylonLoader.html
  34. 5 0
      docs/examples/loaders/GLTF2Loader.html
  35. 1 1
      docs/examples/loaders/MTLLoader.html
  36. 1 1
      docs/examples/loaders/OBJLoader.html
  37. 1 1
      docs/examples/loaders/OBJLoader2.html
  38. 1 1
      docs/examples/loaders/PCDLoader.html
  39. 1 1
      docs/examples/loaders/PDBLoader.html
  40. 1 1
      docs/examples/loaders/SVGLoader.html
  41. 1 1
      docs/examples/loaders/TGALoader.html
  42. 0 6
      docs/list.js
  43. 1 2
      docs/manual/introduction/Animation-system.html
  44. 9 9
      docs/manual/introduction/Creating-a-scene.html
  45. 1 1
      docs/manual/introduction/Creating-text.html
  46. 0 8
      docs/manual/introduction/Useful-links.html
  47. 1 1
      docs/manual/introduction/WebGL-compatibility-check.html
  48. 0 2
      docs/scenes/bones-browser.html
  49. 4 1
      editor/index.html
  50. 1 1
      editor/js/History.js
  51. 15 1
      editor/js/Loader.js
  52. 0 23
      editor/js/Viewport.js
  53. 1 241
      editor/js/libs/tern-threejs/threejs.js
  54. 1 0
      examples/canvas_ascii_effect.html
  55. 3 19
      examples/canvas_camera_orthographic.html
  56. 3 19
      examples/canvas_camera_orthographic2.html
  57. 15 18
      examples/canvas_geometry_birds.html
  58. 1 1
      examples/canvas_geometry_earth.html
  59. 1 1
      examples/canvas_geometry_nurbs.html
  60. 1 1
      examples/canvas_geometry_panorama.html
  61. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  62. 1 1
      examples/canvas_geometry_shapes.html
  63. 1 1
      examples/canvas_geometry_terrain.html
  64. 1 1
      examples/canvas_interactive_cubes.html
  65. 1 1
      examples/canvas_interactive_cubes_tween.html
  66. 1 1
      examples/canvas_interactive_particles.html
  67. 3 19
      examples/canvas_interactive_voxelpainter.html
  68. 2 2
      examples/canvas_lights_pointlights.html
  69. 1 1
      examples/canvas_lines_colors.html
  70. 2 2
      examples/canvas_lines_colors_2d.html
  71. 1 1
      examples/canvas_lines_dashed.html
  72. 3 31
      examples/canvas_materials.html
  73. 2 2
      examples/canvas_materials_normal.html
  74. 2 2
      examples/canvas_materials_reflection.html
  75. 7 7
      examples/canvas_materials_video.html
  76. 1 1
      examples/canvas_morphtargets_horse.html
  77. 4 20
      examples/canvas_performance.html
  78. 15 160
      examples/canvas_sandbox.html
  79. 1 1
      examples/css3d_molecules.html
  80. 1 1
      examples/css3d_panorama.html
  81. 1 1
      examples/css3d_panorama_deviceorientation.html
  82. 1 1
      examples/css3d_periodictable.html
  83. 1 1
      examples/css3d_sandbox.html
  84. 1 1
      examples/css3d_sprites.html
  85. 1 0
      examples/css3d_youtube.html
  86. 9 6
      examples/files.js
  87. 1 1
      examples/js/Cloth.js
  88. 1 1
      examples/js/GPUParticleSystem.js
  89. 1 3
      examples/js/Mirror.js
  90. 1 1
      examples/js/TimelinerController.js
  91. 1 3
      examples/js/WaterShader.js
  92. 1 1
      examples/js/controls/EditorControls.js
  93. 3 2
      examples/js/crossfade/scenes.js
  94. 5 2
      examples/js/crossfade/transition.js
  95. 66 9
      examples/js/effects/VREffect.js
  96. 1 3
      examples/js/geometries/TeapotBufferGeometry.js
  97. 1 1
      examples/js/geometries/hilbert2D.js
  98. 26 0
      examples/js/libs/gunzip.min.js
  99. 0 51
      examples/js/libs/zlib_and_gzip.min.js
  100. 0 1
      examples/js/lights/RectAreaLightUniformsLib.js

文件差异内容过多而无法显示
+ 5 - 5
build/three.js


文件差异内容过多而无法显示
+ 314 - 313
build/three.min.js


文件差异内容过多而无法显示
+ 5 - 5
build/three.module.js


+ 1 - 1
docs/api/constants/CustomBlendingEquations.html

@@ -22,7 +22,7 @@
 		material.blending = THREE.CustomBlending;
 		material.blendEquation = THREE.AddEquation; //default
 		material.blendSrc = THREE.SrcAlphaFactor; //default
-		material.blendDst = THREE.OneMinusDstAlphaFactor; //default
+		material.blendDst = THREE.OneMinusSrcAlphaFactor; //default
 		</code>
 
 		<h2>Blending Equations</h2>

+ 1 - 1
docs/api/constants/Materials.html

@@ -87,7 +87,7 @@
 		[page:Materials LessEqualDepth] is the default and will return true if the incoming pixel Z-depth is less than or equal to the current buffer Z-depth.<br />
 		[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
 		[page:Materials GreaterDepth] will return true if the incoming pixel Z-depth is greater than the current buffer Z-depth.<br />
-		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is equal to the current buffer Z-depth.<br />
+		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is not equal to the current buffer Z-depth.<br />
 		</div>
 
 		<h2>Texture Combine Operations</h2>

+ 8 - 3
docs/api/constants/Textures.html

@@ -33,9 +33,14 @@
 		[page:Constant CubeReflectionMapping] is the default for a [page:CubeTexture CubeTexture]. <br /><br />
 
 		[page:Constant EquirectangularReflectionMapping] and [page:Constant EquirectangularRefractionMapping]
-		are for use with an equirectangular environment map.<br /><br />
-
-		[page:Constant SphericalReflectionMapping] is for use with a spherical reflection map.<br /><br />
+		are for use with an equirectangular environment map.  Also called a lat-long map, an equirectangular 
+		texture represents a 360-degree view along the horizontal centerline, and a 180-degree view along the 
+		vertical axis, with the top and bottom edges of the image corresponding to the north and south poles 
+		of a mapped sphere.<br /><br />
+
+		[page:Constant SphericalReflectionMapping] is for use with a spherical reflection map such as may be obtained
+		by cropping a photograph of a mirrored ball.  Sphere maps will be rendered "facing" the camera, irrespective
+		of the position of the camera relative to the cubemapped object or surface.<br /><br />
 
 		See the [example:webgl_materials_envmaps materials / envmaps] example.
 		</div>

+ 4 - 0
docs/api/core/BufferAttribute.html

@@ -78,6 +78,10 @@
 		<h3>[property:Integer itemSize]</h3>
 		<div>The length of vectors that are being stored in the [page:BufferAttribute.array array].</div>
 
+		<h3>[property:String name]</h3>
+		<div>
+		Optional name for this attribute instance. Default is an empty string.
+		</div>
 
 		<h3>[property:Boolean needsUpdate]</h3>
 		<div>

+ 4 - 1
docs/api/core/Object3D.html

@@ -196,7 +196,10 @@
 		</div>
 
 		<h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
-		<div>This updates the position, rotation and scale with the matrix.</div>
+		<div>Applies the matrix transform to the object and updates the object's position, rotation and scale.</div>
+
+		<h3>[method:Object3D applyQuaternion]( [page:Quaternion quaternion] )</h3>
+		<div>Applies the rotation represented by the quaternion to the object.</div>
 
 		<h3>[method:Object3D clone]( [page:Boolean recursive] )</h3>
 		<div>

+ 2 - 2
docs/api/extras/CurveUtils.html

@@ -11,9 +11,9 @@
 		<h1>[name]</h1>
 
 		<div class="desc">
-		A class containing utility functions for curves.<br />
+		A class containing utility functions for curves.<br /><br />
 
-		Note that these are all linear functions so it is neccessary to calculate seperately for
+		Note that these are all linear functions so it is neccessary to calculate separately for
 		x, y (and z, w if present) components of a curve.
 		</div>
 

+ 6 - 6
docs/api/extras/ShapeUtils.html

@@ -11,10 +11,10 @@
 		<h1>[name]</h1>
 
 		<div class="desc">
-		A class containing utility functions for shapes.<br />
+		A class containing utility functions for shapes.<br /><br />
 
-		Note that these are all linear functions so it is neccessary to calculate seperately for
-		x, y (an z, w if present) components of a vector.
+		Note that these are all linear functions so it is neccessary to calculate separately for
+		x, y (and z, w if present) components of a vector.
 		</div>
 
 
@@ -33,7 +33,7 @@
 		t -- number<br />
 		p0, p1, p2 -- x, y, z or w components of a quadratic bezier curve.<br /><br />
 
-		Note that this is a linear function so it is neccessary to calculate seperately for
+		Note that this is a linear function so it is neccessary to calculate separately for
 		x, y (and z for 3D curves) components of a curve.<br /><br />
 
 		Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve],
@@ -45,7 +45,7 @@
 		t -- number. <br />
 		p0, p1, p2, p3 -- x, y or z components of a cubic bezier curve..<br /><br />
 
-		Note that this is a linear function so it is neccessary to calculate seperately for
+		Note that this is a linear function so it is neccessary to calculate separately for
 		x, y (and z for 3D curves) components of a curve.<br /><br />
 
 		Used internally by [page:CubicBezierCurve CubicBezierCurve],
@@ -56,7 +56,7 @@
 		<div>
 		pts -- points defining a 2D polygon<br /><br />
 
-		Note that this is a linear function so it is neccessary to calculate seperately for
+		Note that this is a linear function so it is neccessary to calculate separately for
 		x, y  components of a polygon.<br /><br />
 
 		Used internally by [page:Path Path],

+ 1 - 14
docs/api/helpers/SkeletonHelper.html

@@ -53,20 +53,7 @@ scene.add( helper );
 		<div>
 		The object passed in the constructor.
 		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[method:Array getBoneList]( object )</h3>
-		<div>
-		getBoneList -- the object used in the constructor.<br /><br />
-
-		This is called automatically to generate a list of bones from the object passed in the constructor.
-		</div>
-
-		<h3>[method:null update]()</h3>
-		<div>
-		Update the helper. Call in the render loop if animating the model.
-		</div>
+		
 
 		<h2>Source</h2>
 

+ 1 - 1
docs/api/helpers/SpotLightHelper.html

@@ -62,7 +62,7 @@
 		<h2>Methods</h2>
 		<div>See the base [page:Object3D] class for common methods.</div>
 
-		<h3>[method:null update]()</h3>
+		<h3>[method:null dispose]()</h3>
 		<div>Disposes of the light helper.</div>
 
 		<h3>[method:null update]()</h3>

+ 1 - 1
docs/api/lights/DirectionalLight.html

@@ -43,7 +43,7 @@
 			[example:canvas_morphtargets_horse morphtargets / horse ]<br />
 			[example:misc_controls_fly controls / fly ]<br />
 			[example:misc_lights_test lights / test ]<br />
-			[example:vr_cubes cubes ]<br />
+			[example:webvr_cubes cubes ]<br />
 			[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]<br />
 			[example:webgl_effects_stereo effects / stereo ]<br />
 			[example:webgl_geometry_extrude_splines geometry / extrude / splines ]<br />

+ 1 - 1
docs/api/loaders/AnimationLoader.html

@@ -63,7 +63,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Animation animation].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called if load errors.<br /><br />
 
 		Begin loading from url and pass the loaded animation to onLoad.

+ 1 - 1
docs/api/loaders/AudioLoader.html

@@ -82,7 +82,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/api/loaders/BufferGeometryLoader.html

@@ -69,7 +69,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].d<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/api/loaders/CompressedTextureLoader.html

@@ -53,7 +53,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/api/loaders/CubeTextureLoader.html

@@ -76,7 +76,7 @@ scene.background = new THREE.CubeTextureLoader()
 		[page:String urls] — array of 6 urls to images, one for each side of the CubeTexture. These can also be
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/api/loaders/DataTextureLoader.html

@@ -49,7 +49,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 3 - 3
docs/api/loaders/FileLoader.html

@@ -12,7 +12,7 @@
 		<h1>[name]</h1>
 
 		<div class="desc">
-			A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.
+			A low level class for loading resources with XMLHttpRequest, used internaly by most loaders.
 			It can also be used directly to load any file type that does not have a loader.
 		</div>
 
@@ -100,8 +100,8 @@ loader.load(
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when loading completes. The argument will be the loaded response.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance,
-			that contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance,
+			which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called if an error occurs.<br /><br />
 
 		Load the URL and pass the response to the onLoad function.

+ 1 - 1
docs/api/loaders/FontLoader.html

@@ -71,7 +71,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br /><br />
 
 		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.

+ 1 - 1
docs/api/loaders/JSONLoader.html

@@ -74,7 +74,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/api/loaders/ObjectLoader.html

@@ -99,7 +99,7 @@ scene.add( object );
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/api/loaders/TextureLoader.html

@@ -86,7 +86,7 @@
 		[page:String url] — the path or URL to the file. This can also be a
 			[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br /><br />
 
 		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.

+ 1 - 1
docs/api/materials/MeshBasicMaterial.html

@@ -63,7 +63,7 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>

+ 1 - 1
docs/api/materials/MeshLambertMaterial.html

@@ -74,7 +74,7 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>

+ 1 - 1
docs/api/materials/MeshPhongMaterial.html

@@ -73,7 +73,7 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>

+ 6 - 2
docs/api/materials/MeshStandardMaterial.html

@@ -97,7 +97,7 @@
 		</div>
 
 		<h3>[property:Texture aoMap]</h3>
-		<div>The red channel of this texture is used as the ambient occlusion map. Default is null.</div>
+		<div>The red channel of this texture is used as the ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>
@@ -164,7 +164,11 @@
 		<div>Intensity of the emissive light. Modulates the emissive color. Default is 1.</div>
 
 		<h3>[property:TextureCube envMap]</h3>
-		<div>The environment map. Default is null.</div>
+		<div>The environment map. Default is null.  Note that in order for the material roughness 
+		property to correctly blur out the environment map, the shader must have access to mipmaps 
+		of the env texture.  TextureCubes created with default settings are correctly configured; 
+		if adjusting texture parameters manually, ensure minFilter is set to one of the MipMap options, 
+		and that mip maps have not been otherwise forcibly disabled.</div>
 
 		<h3>[property:Float envMapIntensity]</h3>
 		<div>Scales the effect of the environment map by multiplying its color.</div>

+ 1 - 1
docs/api/objects/Group.html

@@ -34,7 +34,7 @@
 		//These cubes can now be rotated / scaled etc as a group
 		var group = new THREE.Group();
 		group.add( cubeA );
-		group.add( cubeB )
+		group.add( cubeB );
 
 		scene.add( group );
 		</code>

+ 0 - 128
docs/examples/collada/Animation.html

@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<base href="../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		<h1>[name]</h1>
-
-		<div class="desc">This class animates an object based on an hierarchy. This hierarchy can be Object3ds or bones.</div>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]([page:Object3d root], [page:String name])</h3>
-		<div>
-		root -- The mesh to animate. <br />
-		name -- The name of the animation.
-		</div>
-		<div>
-		Creates an animation for root. The animation data is gathered from AnimationHandler based on its name.
-		</div>
-
-		<h2>Properties</h2>
-
-		<h3>[property:Object3d root]</h3>
-		<div>
-		The root object of the animation.
-		</div>
-
-		<h3>[property:Object data]</h3>
-		<div>
-		The data containing the animation.
-		</div>
-
-		<h3>[property:Array hierarchy]</h3>
-		<div>
-		The objects that are influenced by the animation.
-		</div>
-
-		<h3>[property:number currentTime]</h3>
-		<div>
-		The time elapsed since the last start/restart of the animation.
-		</div>
-
-		<h3>[property:number timeScale]</h3>
-		<div>
-		How much to scale the speed of the animation. Defaults to 1.
-		</div>
-
-		<h3>[property:boolean isPlaying]</h3>
-		<div>
-		Indicates whether the animation is playing. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean isPaused]</h3>
-		<div>
-		Indicates whether the animation is paused. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean loop]</h3>
-		<div>
-		Set to make the animation restart when the animation ends.
-		</div>
-
-		<h3>[property:number interpolationType]</h3>
-		<div>
-		The type to indicate how to interpolate between 2 data points.
-		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[method:null play]([page:Number startTime])</h3>
-		<div>
-		Starts the animation at the startTime (in seconds) of the animation.
-		</div>
-
-		<h3>[method:null stop]()</h3>
-		<div>
-		Stops the animation.
-		</div>
-
-		<h3>[method:Boolean update]([page:Number deltaTimeMS])</h3>
-		<div>
-		deltaTimeMS -- The time elapsed between the previous frame and this frame in milliseconds.
-		</div>
-		<div>
-		Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method.
-		</div>
-
-		<h3>[method:array interpolateCatmullRom]([page:Array points], [page:Number scale])</h3>
-		<div>
-		points -- The 4 control point to calculate CatMullRom. <br />
-		scale -- The scale between the previous key and the next key.
-		</div>
-		<div>
-		Interpolates the point based on the key. Is used in update.
-		</div>
-
-		<h3>[method:Object getNextKeyWith]([page:String type], [page:Object h], [page:Number key])</h3>
-		<div>
-		type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
-		h -- The object of the hierarchy that contains the key. <br />
-		key -- The index of the next possible key.
-		</div>
-		<div>
-		Gets the next key. Is used in Update.
-		</div>
-
-		<h3>[method:Object getPrevKeyWith]([page:String type], [page:Object h], [page:Number key])</h3>
-		<div>
-		type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
-		h -- The object of the hierarchy that contains the key. <br />
-		key -- The index of the prev possible key.
-		</div>
-		<div>
-		Gets the previous key. Is used in Update.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
-	</body>
-</html>

+ 0 - 102
docs/examples/collada/AnimationHandler.html

@@ -1,102 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<base href="../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		<h1>[name]</h1>
-
-		<div class="desc">
-		The AnimationHandler handles the initialisation of the Animation data and
-		the animations itself. It keeps track of every animation and if it's active or not.
-		It also update all animations which are active if its method *update* is called.
-		</div>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]()</h3>
-		<div>
-		The animationHandler can't be called as constructor.
-		</div>
-
-		<h2>Properties</h2>
-
-
-		<h3>[property:number CATMULLROM]</h3>
-		<div>
-		Enum Value to indicate that the animation needs to be interpolated as CATMULLROM.
-		</div>
-
-		<h3>[property:number CATMULLROM_FORWARD]</h3>
-		<div>
-		Enum Value to indicate that the animation needs to be interpolated as CATMULLROM_FORWARD.
-		</div>
-
-		<h3>[property:number LINEAR]</h3>
-		<div>
-		Enum Value to indicate that the animation needs to be interpolated as LINEAR.
-		</div>
-
-		<h2>Methods</h2>
-
-
-
-		<h3>[method:null removeFromUpdate]([page:Animation animation])</h3>
-		<div>
-		animation -- The Animation to remove from the update.
-		</div>
-		<div>
-		Removes the animation from the update cycle. This gets called when the animation stops. This shouldn't be called by usercode.
-		</div>
-
-		<h3>[method:Object get]([page:String name])</h3>
-		<div>
-		name -- The name of the animationData
-		</div>
-		<div>
-		Gets the animationData from its library.
-		</div>
-
-		<h3>[method:null update]([page:Number deltaTimeMS]) </h3>
-		<div>
-		deltaTimeMS -- Time elapsed since last update in milliseconds.
-		</div>
-		<div>
-		Updates all active animations with deltaTime.
-		</div>
-
-		<h3>[method:null parse]([page:Object root])</h3>
-		<div>
-		root -- object
-		</div>
-		<div>
-		Parses the object to get the hierachy.
-		</div>
-
-		<h3>[method:null add]([page:object data])</h3>
-		<div>
-		data -- The animationData
-		</div>
-		<div>
-		Adds the animationData from its library.
-		</div>
-
-		<h3>[method:null addToUpdate]([page:Animation animation]) </h3>
-		<div>
-		animation -- The Animation to add from the update.
-		</div>
-		<div>
-		Adds the animation from the update cycle. This gets called when the animation starts. This shouldn't be called by user code.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
-	</body>
-</html>

+ 0 - 116
docs/examples/collada/KeyFrameAnimation.html

@@ -1,116 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<base href="../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		<h1>[name]</h1>
-
-		<div class="desc">Runs a keyframe animation as imported from the [page:ColladaLoader].</div>
-
-		<h2>Examples</h2>
-
-		<div>[example:webgl_loader_collada_keyframe loader / collada / keyframe ]</div>
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]([page:Object data])</h3>
-		<div>
-		data -- An individual animation object from a the [page:ColladaLoader], e.g. loadedColladaObj.animations[0] <br />
-		</div>
-		<div>
-		Creates a new keyframe animation and initializes it to the first keyframes.
-		</div>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Object3D root]</h3>
-		<div>
-		The root object of the animation
-		</div>
-
-		<h3>[property:Object data]</h3>
-		<div>
-		The data containing the animation
-		</div>
-
-		<h3>[property:Array hierarchy]</h3>
-		<div>
-		The objects that are influenced by the animation.
-		</div>
-
-		<h3>[property:number currentTime]</h3>
-		<div>
-		The time elapsed since the last start/restart of the animation.
-		</div>
-
-		<h3>[property:number timeScale]</h3>
-		<div>
-		How much to scale the speed of the animation. Defaults to 1.
-		</div>
-
-		<h3>[property:boolean isPlaying]</h3>
-		<div>
-		Indicates whether the animation is playing. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean isPaused]</h3>
-		<div>
-		Indicates whether the animation is paused. This shouldn't be adapted by user code.
-		</div>
-
-		<h3>[property:boolean loop]</h3>
-		<div>
-		Set to make the animation restart when the animation ends.
-		</div>
-
-		<h2>Methods</h2>
-
-		<h3>[method:null play]([page:Number startTime])</h3>
-		<div>
-		Starts the animation at the startTime (in seconds) of the animation.
-		</div>
-
-		<h3>[method:null stop]()</h3>
-		<div>
-		Stops the animation.
-		</div>
-
-		<h3>[method:null update]([page:Float deltaTime])</h3>
-		<div>
-		deltaTime -- The change in time in seconds
-		</div>
-		<div>
-		Updates the keyframe animation
-		</div>
-
-		<h3>[method:Object getNextKeyWith]([page:String sid], [page:Integer h], [page:Integer key])</h3>
-		<div>
-		sid -- The string id <br />
-		h -- The index in the heirarchy to use<br />
-		key -- The index of which key to start from
-		</div>
-		<div>
-		Used internally to traverse the animation
-		</div>
-
-		<h3>[method:Object getPrevKeyWith]([page:String sid], [page:Integer h], [page:Integer key])</h3>
-		<div>
-		sid -- The string id <br />
-		h -- The index in the heirarchy to use<br />
-		key -- The index of which key to start from
-		</div>
-		<div>
-		Used internally to traverse the animation
-		</div>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
-	</body>
-</html>

+ 1 - 1
docs/examples/loaders/BabylonLoader.html

@@ -59,7 +59,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D].<br />
-		[page:function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 5 - 0
docs/examples/loaders/GLTF2Loader.html

@@ -40,6 +40,11 @@
 					KHR_materials_common
 				</a>
 			</li>
+			<li>
+				<a target="_blank" href="https://github.com/KhronosGroup/glTF/tree/2.0/extensions/Khronos/KHR_materials_pbrSpecularGlossiness">
+					KHR_materials_pbrSpecularGlossiness
+				</a>
+			</li>
 		</ul>
 
 		<h2>Example</h2>

+ 1 - 1
docs/examples/loaders/MTLLoader.html

@@ -33,7 +33,7 @@
 		<div>
 			[page:String url] — required<br />
 			[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br />
-			[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+			[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 			[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/OBJLoader.html

@@ -53,7 +53,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/OBJLoader2.html

@@ -50,7 +50,7 @@
 		<div>
 			[page:String url] — URL of the file to load<br />
 			[page:Function onLoad] — Called after loading was successfully completed. The argument will be the loaded [page:Object3D].<br />
-			[page:Function onProgress] — Called to report progress of loading. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+			[page:Function onProgress] — Called to report progress of loading. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 			[page:Function onError]  Called after an error occurred during loading.<br />
 			[page:boolean useArrayBuffer] — Set this to false to force string based parsing<br />
 		</div>

+ 1 - 1
docs/examples/loaders/PCDLoader.html

@@ -58,7 +58,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/PDBLoader.html

@@ -64,7 +64,7 @@
 		<div>
 		[page:String url] — required. URL to the <em>.pdb</em> file<br />
 		[page:Function onLoad] — Will be called when load completes. The arguments will be an [page:BufferGeometry geometryAtoms], [page:BufferGeometry geometryBonds] and the [page:Object JSON] structure.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/SVGLoader.html

@@ -33,7 +33,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:SVGDocument].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 1 - 1
docs/examples/loaders/TGALoader.html

@@ -62,7 +62,7 @@
 		<div>
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:DataTexture].<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
 		[page:Function onError] — Will be called when load errors.<br />
 		</div>
 		<div>

+ 0 - 6
docs/list.js

@@ -332,12 +332,6 @@ var list = {
 
 	"Examples": {
 
-		"Collada Animation": {
-			"ColladaAnimation": "examples/collada/Animation",
-			"AnimationHandler": "examples/collada/AnimationHandler",
-			"KeyFrameAnimation": "examples/collada/KeyFrameAnimation"
-		},
-
 		"Geometries": {
 			"ConvexBufferGeometry": "examples/geometries/ConvexBufferGeometry",
 			"ConvexGeometry": "examples/geometries/ConvexGeometry"

+ 1 - 2
docs/manual/introduction/Animation-system.html

@@ -94,7 +94,7 @@
 		<div class="desc">
 
 			If you want a group of objects to receive a shared animation state, you can use an
-			[page:AnimationObjectGroup]. 
+			[page:AnimationObjectGroup].
 
 		</div>
 
@@ -111,7 +111,6 @@
 				<li>[page:ObjectLoader THREE.ObjectLoader]</li>
 				<li>THREE.BVHLoader</li>
 				<li>THREE.FBXLoader</li>
-				<li>THREE.FBXLoader2</li>
 				<li>[page:GLTF2Loader THREE.GLTF2Loader]</li>
 				<li>THREE.MMDLoader</li>
 				<li>THREE.SEA3DLoader</li>

+ 9 - 9
docs/manual/introduction/Creating-a-scene.html

@@ -86,14 +86,14 @@
 
 		<h2>Rendering the scene</h2>
 
-		<div>If you copied the code from above into the HTML file we created earlier, you wouldn't be able to see anything. This is because we're not actually rendering anything yet. For that, we need what's called a <strong>render loop</strong>.</div>
+		<div>If you copied the code from above into the HTML file we created earlier, you wouldn't be able to see anything. This is because we're not actually rendering anything yet. For that, we need what's called a <strong>render or animate loop</strong>.</div>
 
 		<code>
-		function render() {
-			requestAnimationFrame( render );
+		function animate() {
+			requestAnimationFrame( animate );
 			renderer.render( scene, camera );
 		}
-		render();
+		animate();
 		</code>
 
 		<div>This will create a loop that causes the renderer to draw the scene 60 times per second. If you're new to writing games in the browser, you might say "why don't we just  create a <strong>setInterval</strong>? The thing is - we could, but <strong>requestAnimationFrame</strong> has a number of advantages. Perhaps the most important one is that it pauses when the user navigates to another browser tab, hence not wasting their precious processing power and battery life.</div>
@@ -102,14 +102,14 @@
 
 		<div>If you insert all the code above into the file you created before we began, you should see a green box. Let's make it all a little more interesting by rotating it.</div>
 
-		<div>Add the following right above the <strong>renderer.render</strong> call in your <strong>render</strong> function:</div>
+		<div>Add the following right above the <strong>renderer.render</strong> call in your <strong>animate</strong> function:</div>
 
 		<code>
 		cube.rotation.x += 0.1;
 		cube.rotation.y += 0.1;
 		</code>
 
-		<div>This will be run every frame (60 times per second), and give the cube a nice rotation animation. Basically, anything you want to move or change while the app is running has to go through the render loop. You can of course call other functions from there, so that you don't end up with a <strong>render</strong> function that's hundreds of lines.
+		<div>This will be run every frame (60 times per second), and give the cube a nice rotation animation. Basically, anything you want to move or change while the app is running has to go through the animate loop. You can of course call other functions from there, so that you don't end up with a <strong>animate</strong> function that's hundreds of lines.
 		</div>
 
 		<h2>The result</h2>
@@ -143,8 +143,8 @@
 
 					camera.position.z = 5;
 
-					var render = function () {
-						requestAnimationFrame( render );
+					var animate = function () {
+						requestAnimationFrame( animate );
 
 						cube.rotation.x += 0.1;
 						cube.rotation.y += 0.1;
@@ -152,7 +152,7 @@
 						renderer.render(scene, camera);
 					};
 
-					render();
+					animate();
 				&lt;/script&gt;
 			&lt;/body&gt;
 		&lt;/html&gt;

+ 1 - 1
docs/manual/introduction/Creating-text.html

@@ -68,7 +68,7 @@
 				<code>new THREE.TextGeometry( text, parameters );</code>
 			</p>
 			<p>
-				In order for this to work, however, your TextGeomety will need an instance of THREE.Font 
+				In order for this to work, however, your TextGeometry will need an instance of THREE.Font 
 				to be set on its "font" parameter.
 
 				See the [page:TextGeometry] page for more info on how this can be done, descriptions of each

+ 0 - 8
docs/manual/introduction/Useful-links.html

@@ -73,14 +73,6 @@
 
 		</ul>
 
-
-		<h2>More documentation</h2>
-		<ul>
-			<li>
-				[link:http://ushiroad.com/3j/ Three.js walking map] - a graphical breakdown of the structure of a three.js scene.
-			</li>
-		</ul>
-
 		<h2>News and Updates</h2>
 		<ul>
 			<li>

+ 1 - 1
docs/manual/introduction/WebGL-compatibility-check.html

@@ -21,7 +21,7 @@
 
 <code>
 if (Detector.webgl) {
-    init();
+    // Initiate function or other initializations here
     animate();
 } else {
     var warning = Detector.getWebGLErrorMessage();

+ 0 - 2
docs/scenes/bones-browser.html

@@ -253,8 +253,6 @@
 
 				}
 
-				skeletonHelper.update();
-
 				renderer.render( scene, camera );
 
 			}

+ 4 - 1
editor/index.html

@@ -16,11 +16,13 @@
 		<script src="../examples/js/controls/TransformControls.js"></script>
 
 		<script src="../examples/js/libs/jszip.min.js"></script>
+		<script src="../examples/js/libs/inflate.min.js"></script> <!-- FBX -->
+
 		<script src="../examples/js/loaders/AMFLoader.js"></script>
 		<script src="../examples/js/loaders/AWDLoader.js"></script>
 		<script src="../examples/js/loaders/BabylonLoader.js"></script>
 		<script src="../examples/js/loaders/ColladaLoader2.js"></script>
-		<script src="../examples/js/loaders/FBXLoader2.js"></script>
+		<script src="../examples/js/loaders/FBXLoader.js"></script>
 		<script src="../examples/js/loaders/GLTFLoader.js"></script>
 		<script src="../examples/js/loaders/KMZLoader.js"></script>
 		<script src="../examples/js/loaders/MD2Loader.js"></script>
@@ -29,6 +31,7 @@
 		<script src="../examples/js/loaders/PLYLoader.js"></script>
 		<script src="../examples/js/loaders/STLLoader.js"></script>
 		<script src="../examples/js/loaders/TGALoader.js"></script>
+		<script src="../examples/js/loaders/TDSLoader.js"></script>
 		<script src="../examples/js/loaders/UTF8Loader.js"></script>
 		<script src="../examples/js/loaders/VRMLLoader.js"></script>
 		<script src="../examples/js/loaders/VTKLoader.js"></script>

+ 1 - 1
editor/js/History.js

@@ -273,7 +273,7 @@ History.prototype = {
 
 				if ( cmd === undefined || id === cmd.id ) break;
 
-				cmd = this.undo();
+				this.undo();
 
 			}
 

+ 15 - 1
editor/js/Loader.js

@@ -25,6 +25,20 @@ var Loader = function ( editor ) {
 
 		switch ( extension ) {
 
+			case '3ds':
+
+				reader.addEventListener( 'load', function ( event ) {
+
+					var loader = new THREE.TDSLoader();
+					var object = loader.parse( event.target.result );
+
+					editor.execute( new AddObjectCommand( object ) );
+
+				}, false );
+				reader.readAsArrayBuffer( file );
+
+				break;
+
 			case 'amf':
 
 				reader.addEventListener( 'load', function ( event ) {
@@ -151,7 +165,7 @@ var Loader = function ( editor ) {
 					editor.execute( new AddObjectCommand( object ) );
 
 				}, false );
-				reader.readAsText( file );
+				reader.readAsArrayBuffer( file );
 
 				break;
 

+ 0 - 23
editor/js/Viewport.js

@@ -561,29 +561,6 @@ var Viewport = function ( editor ) {
 
 		requestAnimationFrame( animate );
 
-		/*
-
-		// animations
-
-		if ( THREE.AnimationHandler.animations.length > 0 ) {
-
-			THREE.AnimationHandler.update( 0.016 );
-
-			for ( var i = 0, l = sceneHelpers.children.length; i < l; i ++ ) {
-
-				var helper = sceneHelpers.children[ i ];
-
-				if ( helper instanceof THREE.SkeletonHelper ) {
-
-					helper.update();
-
-				}
-
-			}
-
-		}
-		*/
-
 		if ( vrEffect && vrEffect.isPresenting ) {
 
 			render();

+ 1 - 241
editor/js/libs/tern-threejs/threejs.js

@@ -969,246 +969,6 @@
       },
       "!doc": "A class containing useful utility functions for scene manipulation."
     },
-    "Animation": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/Animation",
-      "prototype": {
-        "root": {
-          "!type": "Object3d",
-          "!doc": "The root object of the animation."
-        },
-        "data": {
-          "!type": "object",
-          "!doc": "The data containing the animation"
-        },
-        "hierarchy": {
-          "!type": "[]",
-          "!doc": "The objects that are influenced by the animation."
-        },
-        "currentTime": {
-          "!type": "number",
-          "!doc": "The time elapsed since the last start/restart of the animation."
-        },
-        "timeScale": {
-          "!type": "number",
-          "!doc": "The timez"
-        },
-        "isPlaying": {
-          "!type": "boolean",
-          "!doc": "Indicates whether the animation is playing. This shouldn't be adapted by user code."
-        },
-        "isPaused": {
-          "!type": "boolean",
-          "!doc": "Indicates whether the animation is paused. This shouldn't be adapted by user code."
-        },
-        "loop": {
-          "!type": "boolean",
-          "!doc": "Set to make the animation restart when the animation ends."
-        },
-        "interpolationType": {
-          "!type": "number",
-          "!doc": "The type to indicate how to interpolate between 2 data points."
-        },
-        "play": {
-          "!type": "fn(startTime: number)",
-          "!doc": "Starts the animation from a moment startTime in the animation."
-        },
-        "stop": {
-          "!type": "fn()",
-          "!doc": "Stops the animation."
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: number) -> bool",
-          "!doc": "Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method."
-        },
-        "interpolateCatmullRom": {
-          "!type": "fn(points: [], scale: number) -> array",
-          "!doc": "Interpolates the point based on the key. Is used in update."
-        },
-        "getNextKeyWith": {
-          "!type": "fn(type: string, h: object, key: number) -> object",
-          "!doc": "Gets the next key. Is used in Update."
-        },
-        "getPrevKeyWith": {
-          "!type": "fn(type: string, h: object, key: number) -> object",
-          "!doc": "Gets the previous key. Is used in Update."
-        }
-      },
-      "!doc": "This class animates an object based on an hierarchy. This hierarchy can be Object3ds or bones.",
-      "!type": "fn(root: Object3d, name: string)"
-    },
-    "AnimationHandler": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/AnimationHandler",
-      "prototype": {
-        "CATMULLROM": {
-          "!type": "number",
-          "!doc": "Enum Value to indicate that the animation needs to be interpolated as CATMULLROM."
-        },
-        "CATMULLROM_FORWARD": {
-          "!type": "number",
-          "!doc": "Enum Value to indicate that the animation needs to be interpolated as CATMULLROM_FORWARD."
-        },
-        "LINEAR": {
-          "!type": "number",
-          "!doc": "Enum Value to indicate that the animation needs to be interpolated as LINEAR."
-        },
-        "removeFromUpdate": {
-          "!type": "fn(animation: +THREE.Animation)",
-          "!doc": "Removes the animation from the update cycle. This gets called when the animation stops. This shouldn't be called by usercode."
-        },
-        "get": {
-          "!type": "fn(name: string) -> object",
-          "!doc": "Gets the animationData from its library."
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: number)",
-          "!doc": "Updates all active animations with deltaTime."
-        },
-        "parse": {
-          "!type": "fn(root: object)",
-          "!doc": "Parses the object to get the hierachy."
-        },
-        "add": {
-          "!type": "fn(data: object)",
-          "!doc": "Adds the animationData from its library."
-        },
-        "addToUpdate": {
-          "!type": "fn(animation: +THREE.Animation)",
-          "!doc": "Adds the animation from the update cycle. This gets called when the animation starts. This shouldn't be called by user code."
-        }
-      },
-      "!doc": "The AnimationHandler handles the initialisation of the Animation data and \n\t\tthe animations itself. It keeps track of every animation and if it's active or not.\n\t\tIt also update all animations which are active if its method *update* is called.",
-      "!type": "fn()"
-    },
-    "AnimationMorphTarget": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/AnimationMorphTarget",
-      "prototype": {
-        "root": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "data": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "hierarchy": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "currentTime": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "timeScale": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "isPlaying": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "isPaused": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "loop": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "influence": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "play": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "pause": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "stop": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: todo) -> todo",
-          "!doc": "todo"
-        }
-      },
-      "!doc": "todo",
-      "!type": "fn(root: todo, data: todo)"
-    },
-    "KeyFrameAnimation": {
-      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/KeyFrameAnimation",
-      "prototype": {
-        "root": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "data": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "hierarchy": {
-          "!type": "todo",
-          "!doc": "todo"
-        },
-        "currentTime": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "timeScale": {
-          "!type": "number",
-          "!doc": "todo"
-        },
-        "isPlaying": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "isPaused": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "loop": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "JITCompile": {
-          "!type": "boolean",
-          "!doc": "todo"
-        },
-        "play": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "pause": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "stop": {
-          "!type": "fn() -> todo",
-          "!doc": "todo"
-        },
-        "update": {
-          "!type": "fn(deltaTimeMS: todo) -> todo",
-          "!doc": "todo"
-        },
-        "interpolateCatmullRom": {
-          "!type": "fn(points: todo, scale: todo) -> todo",
-          "!doc": "todo"
-        },
-        "getNextKeyWith": {
-          "!type": "fn(sid: todo, h: todo, key: todo) -> todo",
-          "!doc": "todo"
-        },
-        "getPrevKeyWith": {
-          "!type": "fn(sid: todo, h: todo, key: todo) -> todo",
-          "!doc": "todo"
-        }
-      },
-      "!doc": "todo",
-      "!type": "fn(root: todo, data: todo, JITCompile: todo)"
-    },
     "Curve": {
       "!url": "http://threejs.org/docs/#Reference/extras/core/Curve",
       "prototype": {
@@ -2523,7 +2283,7 @@
           "!doc": "[page:String value] — the empty string (default), \"arraybuffer\", \"blob\", \"document\", \"json\", or \"text\"."
         }
       },
-      "!doc": "A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.",
+      "!doc": "A low level class for loading resources with XMLHttpRequest, used internaly by most loaders.",
       "!type": "fn(manager: +THREE.LoadingManager)"
     },
     "GLTFLoader": {

+ 1 - 0
examples/canvas_ascii_effect.html

@@ -30,6 +30,7 @@
 			var container, stats;
 
 			var camera, controls, scene, renderer;
+			var effect;
 
 			var sphere, plane;
 

+ 3 - 19
examples/canvas_camera_orthographic.html

@@ -40,7 +40,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - orthographic view';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - orthographic view';
 				container.appendChild( info );
 
 				camera = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 500, 1000 );
@@ -52,24 +52,8 @@
 
 				// Grid
 
-				var size = 500, step = 50;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 20 );
+				scene.add( gridHelper );
 
 				// Cubes
 

+ 3 - 19
examples/canvas_camera_orthographic2.html

@@ -30,7 +30,7 @@
 		<script src="js/libs/stats.min.js"></script>
 
 		<div style="position: absolute; top: 10px; width: 100%; text-align: center; ">
-			<a href="http://threejs.org" target="_blank">three.js</a> - Combo Camera<br>
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - Combo Camera<br>
 			View: <a href="#" onclick="setOrthographic();return false;"> Orthographic</a> |
 				<a href="#" onclick="setPerspective();return false;">Perspective</a><br>
 			Lens: <a href="#" onclick="setLens(12);return false;">12mm</a> |
@@ -121,24 +121,8 @@
 
 				// Grid
 
-				var size = 500, step = 50;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 20 );
+				scene.add( gridHelper );
 
 				// Cubes
 

+ 15 - 18
examples/canvas_geometry_birds.html

@@ -26,7 +26,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - birds demo</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - birds demo</div>
 
 		<script src="../build/three.js"></script>
 
@@ -209,16 +209,15 @@
 
 				this.alignment = function ( boids ) {
 
-					var boid, velSum = new THREE.Vector3(),
-					count = 0;
+					var count = 0;
+					var velSum = new THREE.Vector3();
 
 					for ( var i = 0, il = boids.length; i < il; i++ ) {
 
 						if ( Math.random() > 0.6 ) continue;
 
-						boid = boids[ i ];
-
-						distance = boid.position.distanceTo( this.position );
+						var boid = boids[ i ];
+						var distance = boid.position.distanceTo( this.position );
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
@@ -249,17 +248,16 @@
 
 				this.cohesion = function ( boids ) {
 
-					var boid, distance,
-					posSum = new THREE.Vector3(),
-					steer = new THREE.Vector3(),
-					count = 0;
+					var count = 0;
+					var posSum = new THREE.Vector3();
+					var steer = new THREE.Vector3();
 
 					for ( var i = 0, il = boids.length; i < il; i ++ ) {
 
 						if ( Math.random() > 0.6 ) continue;
 
-						boid = boids[ i ];
-						distance = boid.position.distanceTo( this.position );
+						var boid = boids[ i ];
+						var distance = boid.position.distanceTo( this.position );
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
@@ -292,16 +290,15 @@
 
 				this.separation = function ( boids ) {
 
-					var boid, distance,
-					posSum = new THREE.Vector3(),
-					repulse = new THREE.Vector3();
+					var posSum = new THREE.Vector3();
+					var repulse = new THREE.Vector3();
 
 					for ( var i = 0, il = boids.length; i < il; i ++ ) {
 
 						if ( Math.random() > 0.6 ) continue;
 
-						boid = boids[ i ];
-						distance = boid.position.distanceTo( this.position );
+						var boid = boids[ i ];
+						var distance = boid.position.distanceTo( this.position );
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
@@ -432,7 +429,7 @@
 					bird = birds[ i ];
 					bird.position.copy( boids[ i ].position );
 
-					color = bird.material.color;
+					var color = bird.material.color;
 					color.r = color.g = color.b = ( 500 - bird.position.z ) / 1000;
 
 					bird.rotation.y = Math.atan2( - boid.velocity.z, boid.velocity.x );

+ 1 - 1
examples/canvas_geometry_earth.html

@@ -32,7 +32,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - earth demo</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - earth demo</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_nurbs.html

@@ -23,7 +23,7 @@
 	<body>
 		<canvas id="debug" style="position:absolute; left:100px"></canvas>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - NURBS curve example</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - NURBS curve example</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_panorama.html

@@ -30,7 +30,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - panorama demo. cubemap by <a href="http://www.zfight.com/" target="_blank">Jochum Skoglund</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - panorama demo. cubemap by <a href="http://www.zfight.com/" target="_blank" rel="noopener">Jochum Skoglund</a>.</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -30,7 +30,7 @@
 	<body>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - panorama fisheye demo. cubemap by <a href="http://www.zfight.com/" target="_blank">Jochum Skoglund</a>. (mousewheel: change fov)</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - panorama fisheye demo. cubemap by <a href="http://www.zfight.com/" target="_blank" rel="noopener">Jochum Skoglund</a>. (mousewheel: change fov)</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_shapes.html

@@ -23,7 +23,7 @@
 	<body>
 		<canvas id="debug" style="position:absolute; left:100px"></canvas>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - shape geometry</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - shape geometry</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_geometry_terrain.html

@@ -32,7 +32,7 @@
 	<body>
 
 		<div id="container"><br /><br /><br /><br /><br />Generating...</div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - terrain demo. <a href="canvas_geometry_terrain.html">generate another</a></div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - terrain demo. <a href="canvas_geometry_terrain.html">generate another</a></div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/canvas_interactive_cubes.html

@@ -46,7 +46,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - clickable objects';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - clickable objects';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );

+ 1 - 1
examples/canvas_interactive_cubes_tween.html

@@ -44,7 +44,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - clickable objects';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - clickable objects';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );

+ 1 - 1
examples/canvas_interactive_particles.html

@@ -64,7 +64,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> canvas - interactive particles';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> canvas - interactive particles';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );

+ 3 - 19
examples/canvas_interactive_voxelpainter.html

@@ -46,7 +46,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - voxel painter<br><strong>click</strong>: add voxel, <strong>shift + click</strong>: remove voxel, <a href="javascript:save()">save .png</a>';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - voxel painter<br><strong>click</strong>: add voxel, <strong>shift + click</strong>: remove voxel, <a href="javascript:save()">save .png</a>';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
@@ -57,24 +57,8 @@
 
 				// Grid
 
-				var size = 500, step = 50;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 20 );
+				scene.add( gridHelper );
 
 				//
 

+ 2 - 2
examples/canvas_lights_pointlights.html

@@ -35,8 +35,8 @@
 
 		<div id="container"></div>
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - point lights demo.<br />
-			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - point lights demo.<br />
+			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank" rel="noopener">David OReilly</a>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 1 - 1
examples/canvas_lines_colors.html

@@ -40,7 +40,7 @@
 	<body>
 
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - color lines
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - color lines
 			[<a href="http://en.wikipedia.org/wiki/Hilbert_curve">Hilbert curve</a> thanks to <a href="http://www.openprocessing.org/visuals/?visualID=15599">Thomas Diewald</a>]
 		</div>
 

+ 2 - 2
examples/canvas_lines_colors_2d.html

@@ -40,7 +40,7 @@
 	<body>
 
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - color lines WebGL demo
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - color lines WebGL demo
 			[<a href="http://en.wikipedia.org/wiki/Hilbert_curve">Hilbert curve</a> thanks to <a href="http://www.openprocessing.org/visuals/?visualID=15599">Thomas Diewald</a>]
 		</div>
 
@@ -86,7 +86,7 @@
 				container.appendChild( renderer.domElement );
 
 				var geometry3 = new THREE.Geometry(),
-					points = hilbert2D( new THREE.Vector3( 0,0,0 ), 400.0, 4, 0, 1, 2, 3, 4, 5, 6, 7 ),
+					points = hilbert2D( new THREE.Vector3( 0,0,0 ), 400.0, 4 ),
 					colors3 = [];
 
 				for ( i = 0; i < points.length; i ++ ) {

+ 1 - 1
examples/canvas_lines_dashed.html

@@ -28,7 +28,7 @@
 	</head>
 
 	<body>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - dashed lines example</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - dashed lines example</div>
 		<div id="container"></div>
 
 		<script src="../build/three.js"></script>

+ 3 - 31
examples/canvas_materials.html

@@ -44,24 +44,9 @@
 
 				// Grid
 
-				var size = 500, step = 100;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, - 120, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, - 120, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, - 120, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, - 120,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.2 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 10 );
+				gridHelper.position.y = - 120;
+				scene.add( gridHelper );
 
 				// Spheres
 
@@ -146,19 +131,6 @@
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				container.appendChild( renderer.domElement );
 
-				var debugCanvas = document.createElement( 'canvas' );
-				debugCanvas.width = 512;
-				debugCanvas.height = 512;
-				debugCanvas.style.position = 'absolute';
-				debugCanvas.style.top = '0px';
-				debugCanvas.style.left = '0px';
-
-				container.appendChild( debugCanvas );
-
-				debugContext = debugCanvas.getContext( '2d' );
-				debugContext.setTransform( 1, 0, 0, 1, 256, 256 );
-				debugContext.strokeStyle = '#000000';
-
 				stats = new Stats();
 				container.appendChild(stats.dom);
 

+ 2 - 2
examples/canvas_materials_normal.html

@@ -35,8 +35,8 @@
 
 		<div id="container"></div>
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - normal material.<br />
-			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - normal material.<br />
+			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank" rel="noopener">David OReilly</a>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 2 - 2
examples/canvas_materials_reflection.html

@@ -34,8 +34,8 @@
 
 		<div id="container"></div>
 		<div id="info">
-			<a href="http://threejs.org" target="_blank">three.js</a> - spherical reflection demo.<br />
-			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank">David OReilly</a>. Reflection texture by <a href="http://kewlers.scene.org/" target="_blank">Kewlers</a>.
+			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - spherical reflection demo.<br />
+			Walt Disney head by <a href="http://davidoreilly.com/post/18087489343/disneyhead" target="_blank" rel="noopener">David OReilly</a>. Reflection texture by <a href="http://kewlers.scene.org/" target="_blank" rel="noopener">Kewlers</a>.
 		</div>
 
 		<script src="../build/three.js"></script>

+ 7 - 7
examples/canvas_materials_video.html

@@ -60,7 +60,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> - video demo. playing <a href="http://durian.blender.org/" target="_blank">sintel</a> trailer';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - video demo. playing <a href="http://durian.blender.org/" target="_blank" rel="noopener">sintel</a> trailer';
 				container.appendChild( info );
 
 				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
@@ -138,12 +138,12 @@
 
 					for ( var iy = 0; iy < amounty; iy++ ) {
 
-						particle = new THREE.Sprite( material );
-						particle.position.x = ix * separation - ( ( amountx * separation ) / 2 );
-						particle.position.y = -153;
-						particle.position.z = iy * separation - ( ( amounty * separation ) / 2 );
-						particle.scale.x = particle.scale.y = 2;
-						scene.add( particle );
+						var sprite = new THREE.Sprite( material );
+						sprite.position.x = ix * separation - ( ( amountx * separation ) / 2 );
+						sprite.position.y = -153;
+						sprite.position.z = iy * separation - ( ( amounty * separation ) / 2 );
+						sprite.scale.setScalar( 2 );
+						scene.add( sprite );
 
 					}
 

+ 1 - 1
examples/canvas_morphtargets_horse.html

@@ -41,7 +41,7 @@
 				info.style.top = '10px';
 				info.style.width = '100%';
 				info.style.textAlign = 'center';
-				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> canvas - morph targets - horse. model by <a href="http://mirada.com/">mirada</a> from <a href="http://ro.me">rome</a>';
+				info.innerHTML = '<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> canvas - morph targets - horse. model by <a href="http://mirada.com/">mirada</a> from <a href="http://ro.me">rome</a>';
 				container.appendChild( info );
 
 				//

+ 4 - 20
examples/canvas_performance.html

@@ -47,29 +47,13 @@
 
 				// Grid
 
-				var size = 500, step = 100;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 10 );
+				scene.add( gridHelper );
 
 				// Spheres
 
-				geometry = new THREE.SphereGeometry( 100, 26, 18 );
-				material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
+				var geometry = new THREE.SphereGeometry( 100, 26, 18 );
+				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
 
 				for ( var i = 0; i < 20; i ++ ) {
 

+ 15 - 160
examples/canvas_sandbox.html

@@ -17,6 +17,7 @@
 
 		<script src="../build/three.js"></script>
 
+		<script src="js/controls/OrbitControls.js"></script>
 		<script src="js/renderers/Projector.js"></script>
 		<script src="js/renderers/CanvasRenderer.js"></script>
 
@@ -26,31 +27,8 @@
 
 			var container, stats;
 
-			var camera, scene, renderer, objects;
-			var pointLight;
-
-			var sphere;
-
-			var targetRotation = 0;
-			var targetRotationOnMouseDown = 0;
-
-			var mouseX = 0;
-			var mouseXOnMouseDown = 0;
-
-			var windowHalfX = window.innerWidth / 2;
-			var windowHalfY = window.innerHeight / 2;
-
-			var moveForward = false;
-			var moveBackwards = false;
-			var moveLeft = false;
-			var moveRight = false;
-			var moveUp = false;
-			var moveDown = false;
-
-			var targetMoveLeft = false;
-			var targetMoveRight = false;
-
-			var debugContext;
+			var camera, scene, renderer;
+			var controls, group;
 
 			init();
 			animate();
@@ -62,46 +40,31 @@
 
 				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera.position.set( 0, 150, 400 );
-				camera.target = new THREE.Vector3( 0, 150, 0 );
 
-				scene = new THREE.Scene();
+				var controls = new THREE.OrbitControls( camera );
 
+				scene = new THREE.Scene();
 
 				// Grid
 
-				var size = 500, step = 100;
-
-				var geometry = new THREE.Geometry();
-
-				for ( var i = - size; i <= size; i += step ) {
-
-					geometry.vertices.push( new THREE.Vector3( - size, 0, i ) );
-					geometry.vertices.push( new THREE.Vector3(   size, 0, i ) );
-
-					geometry.vertices.push( new THREE.Vector3( i, 0, - size ) );
-					geometry.vertices.push( new THREE.Vector3( i, 0,   size ) );
-
-				}
-
-				var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
-
-				var line = new THREE.LineSegments( geometry, material );
-				scene.add( line );
+				var gridHelper = new THREE.GridHelper( 1000, 10 );
+				scene.add( gridHelper );
 
 				// Spheres
 
-				objects = [];
+				group = new THREE.Group();
+				scene.add( group );
 
-				geometry = new THREE.IcosahedronGeometry( 100, 1 );
+				var geometry = new THREE.IcosahedronGeometry( 100, 1 );
 
 				var envMap = new THREE.TextureLoader().load( 'textures/metal.jpg' );
 				envMap.mapping = THREE.SphericalReflectionMapping;
 
-				material = new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } );
+				var material = new THREE.MeshBasicMaterial( { envMap: envMap, overdraw: 0.5 } );
 
 				for ( var i = 0; i < 10; i ++ ) {
 
-					sphere = new THREE.Mesh( geometry, material );
+					var sphere = new THREE.Mesh( geometry, material );
 
 					sphere.position.x = Math.random() * 1000 - 500;
 					sphere.position.y = Math.random() * 1000 - 500;
@@ -113,52 +76,19 @@
 
 					sphere.scale.x = sphere.scale.y = sphere.scale.z = Math.random() + 0.5;
 
-					objects.push( sphere );
-
-					scene.add( sphere );
+					group.add( sphere );
 
 				}
 
-				// Lights
-
-				var ambientLight = new THREE.AmbientLight( Math.random() * 0x202020 );
-				scene.add( ambientLight );
-
-				var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
-				directionalLight.position.x = Math.random() - 0.5;
-				directionalLight.position.y = Math.random() - 0.5;
-				directionalLight.position.z = Math.random() - 0.5;
-				directionalLight.position.normalize();
-				scene.add( directionalLight );
-
-				pointLight = new THREE.PointLight( 0xff0000, 1 );
-				scene.add( pointLight );
-
 				renderer = new THREE.CanvasRenderer();
 				renderer.setClearColor( 0xf0f0f0 );
 				renderer.setPixelRatio( window.devicePixelRatio );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				container.appendChild( renderer.domElement );
 
-				var debugCanvas = document.createElement( 'canvas' );
-				debugCanvas.width = 512;
-				debugCanvas.height = 512;
-				debugCanvas.style.position = 'absolute';
-				debugCanvas.style.top = '0px';
-				debugCanvas.style.left = '0px';
-
-				container.appendChild( debugCanvas );
-
-				debugContext = debugCanvas.getContext( '2d' );
-				debugContext.setTransform( 1, 0, 0, 1, 256, 256 );
-				debugContext.strokeStyle = '#000000';
-
 				stats = new Stats();
 				container.appendChild(stats.dom);
 
-				document.addEventListener( 'keydown', onDocumentKeyDown, false );
-				document.addEventListener( 'keyup', onDocumentKeyUp, false );
-
 				//
 
 				window.addEventListener( 'resize', onWindowResize, false );
@@ -167,9 +97,6 @@
 
 			function onWindowResize() {
 
-				windowHalfX = window.innerWidth / 2;
-				windowHalfY = window.innerHeight / 2;
-
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
@@ -177,40 +104,6 @@
 
 			}
 
-			function onDocumentKeyDown( event ) {
-
-				switch ( event.keyCode ) {
-
-					case 38: moveForward = true; break; // up
-					case 40: moveBackwards = true; break; // down
-					case 37: moveLeft = true; break; // left
-					case 39: moveRight = true; break; // right
-					case 87: moveUp = true; break; // w
-					case 83: moveDown = true; break; // s
-					case 65: targetMoveLeft = true; break; // a
-					case 68: targetMoveRight = true; break; // d
-
-				}
-
-			}
-
-			function onDocumentKeyUp( event ) {
-
-				switch ( event.keyCode ) {
-
-					case 38: moveForward = false; break; // up
-					case 40: moveBackwards = false; break; // down
-					case 37: moveLeft = false; break; // left
-					case 39: moveRight = false; break; // right
-					case 87: moveUp = false; break; // w
-					case 83: moveDown = false; break; // s
-					case 65: targetMoveLeft = false; break; // a
-					case 68: targetMoveRight = false; break; // d
-
-				}
-
-			}
-
 			//
 
 			function animate() {
@@ -224,54 +117,16 @@
 
 			function render() {
 
-				if ( moveForward ) camera.position.z -= 10;
-				if ( moveBackwards ) camera.position.z += 10;
+				for ( var i = 0, l = group.children.length; i < l; i++ ) {
 
-				if ( moveLeft ) camera.position.x -= 10;
-				if ( moveRight ) camera.position.x += 10;
-
-				if ( moveUp ) camera.position.y += 10;
-				if ( moveDown ) camera.position.y -= 10;
-
-				if ( targetMoveLeft ) camera.target.x -= 10;
-				if ( targetMoveRight ) camera.target.x += 10;
-
-				camera.lookAt( camera.target );
-
-				debugContext.clearRect( -256, -256, 512, 512 );
-
-				debugContext.beginPath();
-
-				// center
-				debugContext.moveTo( -10, 0 );
-				debugContext.lineTo( 10, 0 );
-				debugContext.moveTo( 0, -10 );
-				debugContext.lineTo( 0, 10 );
-
-				// camera
-
-				debugContext.moveTo( camera.position.x * 0.1, camera.position.z * 0.1 );
-				debugContext.lineTo( camera.target.x * 0.1, camera.target.z * 0.1 );
-				debugContext.rect( camera.position.x * 0.1 - 5, camera.position.z * 0.1 - 5, 10, 10 );
-				debugContext.rect( camera.target.x * 0.1 - 5, camera.target.z * 0.1 - 5, 10, 10 );
-				debugContext.rect( - 50, - 50, 100, 100 );
-
-				for ( var i = 0, l = objects.length; i < l; i++ ) {
-
-					var object = objects[ i ];
+					var object = group.children[ i ];
 
 					object.rotation.x += 0.01;
 					object.rotation.y += 0.005;
 					object.position.y = Math.sin( object.rotation.x ) * 200;
 
-					debugContext.rect( object.position.x * 0.1 - 5, object.position.z * 0.1 - 5, 10, 10 );
-
 				}
 
-
-				debugContext.closePath();
-				debugContext.stroke();
-
 				renderer.render( scene, camera );
 
 			}

+ 1 - 1
examples/css3d_molecules.html

@@ -92,7 +92,7 @@
 		<script src="js/loaders/PDBLoader.js"></script>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - molecules</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - molecules</div>
 		<div id="topmenu">
 			<button id="b_a">Atoms</button>
 			<button id="b_b">Bonds</button>

+ 1 - 1
examples/css3d_panorama.html

@@ -33,7 +33,7 @@
 		<script src="../build/three.js"></script>
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - panorama demo. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank">Humus</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - panorama demo. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank" rel="noopener">Humus</a>.</div>
 
 		<script>
 

+ 1 - 1
examples/css3d_panorama_deviceorientation.html

@@ -34,7 +34,7 @@
 		<script src="js/controls/DeviceOrientationControls.js"></script>
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - panorama - decideorientation. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank">Humus</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - panorama - decideorientation. cubemap by <a href="http://www.humus.name/index.php?page=Textures" target="_blank" rel="noopener">Humus</a>.</div>
 
 		<script>
 

+ 1 - 1
examples/css3d_periodictable.html

@@ -105,7 +105,7 @@
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - periodic table. <a href="https://plus.google.com/113862800338869870683/posts/QcFk5HrWran" target="_blank">info</a>.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - periodic table. <a href="https://plus.google.com/113862800338869870683/posts/QcFk5HrWran" target="_blank" rel="noopener">info</a>.</div>
 		<div id="menu">
 			<button id="table">TABLE</button>
 			<button id="sphere">SPHERE</button>

+ 1 - 1
examples/css3d_sandbox.html

@@ -28,7 +28,7 @@
 		</style>
 	</head>
 	<body>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - css3d sandbox</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - css3d sandbox</div>
 
 		<script src="../build/three.js"></script>
 

+ 1 - 1
examples/css3d_sprites.html

@@ -40,7 +40,7 @@
 		<script src="js/renderers/CSS3DRenderer.js"></script>
 
 		<div id="container"></div>
-		<div id="info"><a href="http://threejs.org" target="_blank">three.js css3d</a> - sprites.</div>
+		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js css3d</a> - sprites.</div>
 
 		<script>
 

+ 1 - 0
examples/css3d_youtube.html

@@ -30,6 +30,7 @@
 		<script>
 
 			var camera, scene, renderer;
+			var controls;
 
 			var Element = function ( id, x, y, z, ry ) {
 

+ 9 - 6
examples/files.js

@@ -6,6 +6,7 @@ var files = {
 		"webgl_animation_skinning_blending",
 		"webgl_animation_skinning_morph",
 		"webgl_camera",
+		"webgl_camera_array",
 		"webgl_camera_cinematic",
 		"webgl_camera_logarithmicdepthbuffer",
 		"webgl_clipping",
@@ -75,6 +76,7 @@ var files = {
 		"webgl_lines_dashed",
 		"webgl_lines_sphere",
 		"webgl_lines_splines",
+		"webgl_loader_3ds",
 		"webgl_loader_3mf",
 		"webgl_loader_amf",
 		"webgl_loader_assimp",
@@ -83,14 +85,12 @@ var files = {
 		"webgl_loader_babylon",
 		"webgl_loader_bvh",
 		"webgl_loader_collada",
-		"webgl_loader_collada_keyframe",
 		"webgl_loader_collada_kinematics",
 		"webgl_loader_collada_skinning",
 		"webgl_loader_ctm",
 		"webgl_loader_ctm_materials",
 		"webgl_loader_draco",
 		"webgl_loader_fbx",
-		"webgl_loader_gltf",
 		"webgl_loader_gltf2",
 		"webgl_loader_json_blender",
 		"webgl_loader_json_claraio",
@@ -152,13 +152,13 @@ var files = {
 		"webgl_materials_skin",
 		"webgl_materials_standard",
 		"webgl_materials_texture_anisotropy",
+		"webgl_materials_texture_canvas",
 		"webgl_materials_texture_compressed",
 		"webgl_materials_texture_filters",
 		"webgl_materials_texture_hdr",
 		"webgl_materials_texture_manualmipmap",
 		"webgl_materials_texture_pvrtc",
 		"webgl_materials_texture_tga",
-		"webgl_materials_texture_canvas",
 		"webgl_materials_transparency",
 		"webgl_materials_variations_basic",
 		"webgl_materials_variations_lambert",
@@ -194,11 +194,11 @@ var files = {
 		"webgl_performance",
 		"webgl_performance_doublesided",
 		"webgl_performance_static",
-		"webgl_physics_terrain",
-		"webgl_physics_rope",
 		"webgl_physics_cloth",
-		"webgl_physics_volume",
 		"webgl_physics_convex_break",
+		"webgl_physics_rope",
+		"webgl_physics_terrain",
+		"webgl_physics_volume",
 		"webgl_points_billboards",
 		"webgl_points_billboards_colors",
 		"webgl_points_dynamic",
@@ -277,9 +277,11 @@ var files = {
 	"webgl deferred": [
 		"webgldeferred_animation"
 	],
+	/*
 	"webgl2": [
 		"webgl2_sandbox"
 	],
+	*/
 	"webvr": [
 		"webvr_cubes",
 		"webvr_daydream",
@@ -364,6 +366,7 @@ var files = {
 		"software_sandbox"
 	],
 	"svg": [
+		"svg_lines",
 		"svg_sandbox"
 	]
 };

+ 1 - 1
examples/js/Cloth.js

@@ -286,7 +286,7 @@ function simulate( time ) {
 		for ( particles = cloth.particles, i = 0, il = particles.length; i < il; i ++ ) {
 
 			particle = particles[ i ];
-			pos = particle.position;
+			var pos = particle.position;
 			diff.subVectors( pos, ballPosition );
 			if ( diff.length() < ballSize ) {
 

+ 1 - 1
examples/js/GPUParticleSystem.js

@@ -330,7 +330,7 @@ THREE.GPUParticleContainer = function( maxParticles, particleSystem ) {
 
 		if ( this.DPR !== undefined ) size *= this.DPR;
 
-		i = this.PARTICLE_CURSOR;
+		var i = this.PARTICLE_CURSOR;
 
 		// position
 

+ 1 - 3
examples/js/Mirror.js

@@ -143,7 +143,6 @@ THREE.Mirror = function ( width, height, options ) {
 
 		mirrorCamera.updateProjectionMatrix();
 		mirrorCamera.updateMatrixWorld();
-		mirrorCamera.matrixWorldInverse.getInverse( mirrorCamera.matrixWorld );
 
 		// Update the texture matrix
 		textureMatrix.set(
@@ -171,8 +170,7 @@ THREE.Mirror = function ( width, height, options ) {
 		q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
 
 		// Calculate the scaled plane vector
-		var c = new THREE.Vector4();
-		c = clipPlane.multiplyScalar( 2.0 / clipPlane.dot( q ) );
+		var c = clipPlane.multiplyScalar( 2.0 / clipPlane.dot( q ) );
 
 		// Replacing the third row of the projection matrix
 		projectionMatrix.elements[ 2 ] = c.x;

+ 1 - 1
examples/js/TimelinerController.js

@@ -221,7 +221,7 @@ THREE.TimelinerController.prototype = {
 		for ( var i = 0, n = names.length; i !== n; ++ i ) {
 
 			var name = names[ i ],
-				track = tracks[ name ];
+				track = tracks[ name ],
 				data = channels[ name ];
 
 			this._setArray( track.times, data.times );

+ 1 - 3
examples/js/WaterShader.js

@@ -279,7 +279,6 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 
 	this.mirrorCamera.updateProjectionMatrix();
 	this.mirrorCamera.updateMatrixWorld();
-	this.mirrorCamera.matrixWorldInverse.getInverse( this.mirrorCamera.matrixWorld );
 
 	// Update the texture matrix
 	this.textureMatrix.set(
@@ -307,8 +306,7 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 	q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
 
 	// Calculate the scaled plane vector
-	var c = new THREE.Vector4();
-	c = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot( q ) );
+	var c = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot( q ) );
 
 	// Replacing the third row of the projection matrix
 	projectionMatrix.elements[ 2 ] = c.x;

+ 1 - 1
examples/js/controls/EditorControls.js

@@ -263,7 +263,7 @@ THREE.EditorControls = function ( object, domElement ) {
 			case 2:
 				touches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );
 				touches[ 1 ].set( event.touches[ 1 ].pageX, event.touches[ 1 ].pageY, 0 );
-				distance = touches[ 0 ].distanceTo( touches[ 1 ] );
+				var distance = touches[ 0 ].distanceTo( touches[ 1 ] );
 				scope.zoom( new THREE.Vector3( 0, 0, prevDistance - distance ) );
 				prevDistance = distance;
 

+ 3 - 2
examples/js/crossfade/scenes.js

@@ -86,11 +86,12 @@ function Scene ( type, numObjects, cameraZ, fov, rotationSpeed, clearColor ) {
 	this.scene.add( light );
 
 	this.rotationSpeed = rotationSpeed;
-	defaultMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } );
+
+	var defaultMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } );
 	this.mesh = new THREE.Mesh( generateGeometry( type, numObjects ), defaultMaterial );
 	this.scene.add( this.mesh );
 
-	renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };
+	var renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };
 	this.fbo = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, renderTargetParameters );
 
 	this.render = function( delta, rtt ) {

+ 5 - 2
examples/js/crossfade/transition.js

@@ -5,8 +5,11 @@ function Transition ( sceneA, sceneB ) {
 	this.cameraOrtho = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 10, 10 );
 
 	this.textures = [];
+
+	var loader = new THREE.TextureLoader();
+
 	for ( var i = 0; i < 6; i ++ )
-		this.textures[ i ] = new THREE.TextureLoader().load( 'textures/transition/transition' + ( i + 1 ) + '.png' );
+		this.textures[ i ] = loader.load( 'textures/transition/transition' + ( i + 1 ) + '.png' );
 
 	this.quadmaterial = new THREE.ShaderMaterial( {
 
@@ -79,7 +82,7 @@ function Transition ( sceneA, sceneB ) {
 
 	} );
 
-	quadgeometry = new THREE.PlaneBufferGeometry( window.innerWidth, window.innerHeight );
+	var quadgeometry = new THREE.PlaneBufferGeometry( window.innerWidth, window.innerHeight );
 
 	this.quad = new THREE.Mesh( quadgeometry, this.quadmaterial );
 	this.scene.add( this.quad );

+ 66 - 9
examples/js/effects/VREffect.js

@@ -14,6 +14,9 @@ THREE.VREffect = function ( renderer, onError ) {
 	var eyeTranslationL = new THREE.Vector3();
 	var eyeTranslationR = new THREE.Vector3();
 	var renderRectL, renderRectR;
+	var headMatrix = new THREE.Matrix4();
+	var eyeMatrixL = new THREE.Matrix4();
+	var eyeMatrixR = new THREE.Matrix4();
 
 	var frameData = null;
 
@@ -241,12 +244,6 @@ THREE.VREffect = function ( renderer, onError ) {
 
 			}
 
-			var eyeParamsL = vrDisplay.getEyeParameters( 'left' );
-			var eyeParamsR = vrDisplay.getEyeParameters( 'right' );
-
-			eyeTranslationL.fromArray( eyeParamsL.offset );
-			eyeTranslationR.fromArray( eyeParamsR.offset );
-
 			if ( Array.isArray( scene ) ) {
 
 				console.warn( 'THREE.VREffect.render() no longer supports arrays. Use object.layers instead.' );
@@ -310,9 +307,6 @@ THREE.VREffect = function ( renderer, onError ) {
 			cameraR.quaternion.copy( cameraL.quaternion );
 			cameraR.scale.copy( cameraL.scale );
 
-			cameraL.translateOnAxis( eyeTranslationL, cameraL.scale.x );
-			cameraR.translateOnAxis( eyeTranslationR, cameraR.scale.x );
-
 			if ( vrDisplay.getFrameData ) {
 
 				vrDisplay.depthNear = camera.near;
@@ -323,11 +317,30 @@ THREE.VREffect = function ( renderer, onError ) {
 				cameraL.projectionMatrix.elements = frameData.leftProjectionMatrix;
 				cameraR.projectionMatrix.elements = frameData.rightProjectionMatrix;
 
+				getEyeMatrices( frameData );
+
+				cameraL.updateMatrix();
+				cameraL.matrix.multiply( eyeMatrixL );
+				cameraL.matrix.decompose( cameraL.position, cameraL.quaternion, cameraL.scale );
+
+				cameraR.updateMatrix();
+				cameraR.matrix.multiply( eyeMatrixR );
+				cameraR.matrix.decompose( cameraR.position, cameraR.quaternion, cameraR.scale );
+
 			} else {
 
+				var eyeParamsL = vrDisplay.getEyeParameters( 'left' );
+				var eyeParamsR = vrDisplay.getEyeParameters( 'right' );
+
 				cameraL.projectionMatrix = fovToProjection( eyeParamsL.fieldOfView, true, camera.near, camera.far );
 				cameraR.projectionMatrix = fovToProjection( eyeParamsR.fieldOfView, true, camera.near, camera.far );
 
+				eyeTranslationL.fromArray( eyeParamsL.offset );
+				eyeTranslationR.fromArray( eyeParamsR.offset );
+
+				cameraL.translateOnAxis( eyeTranslationL, cameraL.scale.x );
+				cameraR.translateOnAxis( eyeTranslationR, cameraR.scale.x );
+
 			}
 
 			// render left eye
@@ -402,6 +415,50 @@ THREE.VREffect = function ( renderer, onError ) {
 
 	//
 
+	var poseOrientation = new THREE.Quaternion();
+	var posePosition = new THREE.Vector3();
+
+	// Compute model matrices of the eyes with respect to the head.
+	function getEyeMatrices( frameData ) {
+
+		// Compute the matrix for the position of the head based on the pose
+		if ( frameData.pose.orientation ) {
+
+			poseOrientation.fromArray( frameData.pose.orientation );
+			headMatrix.makeRotationFromQuaternion( poseOrientation );
+
+		}	else {
+
+			headMatrix.identity();
+
+		}
+
+		if ( frameData.pose.position ) {
+
+			posePosition.fromArray( frameData.pose.position );
+			headMatrix.setPosition( posePosition );
+
+		}
+
+		// The view matrix transforms vertices from sitting space to eye space. As such, the view matrix can be thought of as a product of two matrices:
+		// headToEyeMatrix * sittingToHeadMatrix
+
+		// The headMatrix that we've calculated above is the model matrix of the head in sitting space, which is the inverse of sittingToHeadMatrix.
+		// So when we multiply the view matrix with headMatrix, we're left with headToEyeMatrix:
+		// viewMatrix * headMatrix = headToEyeMatrix * sittingToHeadMatrix * headMatrix = headToEyeMatrix
+
+		eyeMatrixL.fromArray( frameData.leftViewMatrix );
+		eyeMatrixL.multiply( headMatrix );
+		eyeMatrixR.fromArray( frameData.rightViewMatrix );
+		eyeMatrixR.multiply( headMatrix );
+
+		// The eye's model matrix in head space is the inverse of headToEyeMatrix we calculated above.
+
+		eyeMatrixL.getInverse( eyeMatrixL );
+		eyeMatrixR.getInverse( eyeMatrixR );
+
+	}
+
 	function fovToNDCScaleOffset( fov ) {
 
 		var pxscale = 2.0 / ( fov.leftTan + fov.rightTan );

+ 1 - 3
examples/js/geometries/TeapotBufferGeometry.js

@@ -479,7 +479,7 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
 	var tcoord;
 
 	var sstep, tstep;
-	var vertPerRow, eps;
+	var vertPerRow;
 
 	var s, t, sval, tval, p;
 	var dsval = 0;
@@ -532,8 +532,6 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
 
 	vertPerRow = segments + 1;
 
-	eps = 0.0000001;
-
 	var surfCount = 0;
 
 	var vertCount = 0;

+ 1 - 1
examples/js/geometries/hilbert2D.js

@@ -15,7 +15,7 @@
  * @param v2         Corner index +X, +Z.
  * @param v3         Corner index +X, -Z.
  */
-function hilbert2D ( center, size, iterations, v0, v1, v2, v3 ) {
+function hilbert2D( center, size, iterations, v0, v1, v2, v3 ) {
 
 	// Default Vars
 	var center     = undefined !== center ? center : new THREE.Vector3( 0, 0, 0 ),

+ 26 - 0
examples/js/libs/gunzip.min.js

@@ -0,0 +1,26 @@
+/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function n(e){throw e;}var q=void 0,aa=this;function r(e,c){var d=e.split("."),b=aa;!(d[0]in b)&&b.execScript&&b.execScript("var "+d[0]);for(var a;d.length&&(a=d.shift());)!d.length&&c!==q?b[a]=c:b=b[a]?b[a]:b[a]={}};var u="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;new (u?Uint8Array:Array)(256);var v;for(v=0;256>v;++v)for(var w=v,ba=7,w=w>>>1;w;w>>>=1)--ba;function x(e,c,d){var b,a="number"===typeof c?c:c=0,f="number"===typeof d?d:e.length;b=-1;for(a=f&7;a--;++c)b=b>>>8^z[(b^e[c])&255];for(a=f>>3;a--;c+=8)b=b>>>8^z[(b^e[c])&255],b=b>>>8^z[(b^e[c+1])&255],b=b>>>8^z[(b^e[c+2])&255],b=b>>>8^z[(b^e[c+3])&255],b=b>>>8^z[(b^e[c+4])&255],b=b>>>8^z[(b^e[c+5])&255],b=b>>>8^z[(b^e[c+6])&255],b=b>>>8^z[(b^e[c+7])&255];return(b^4294967295)>>>0}
+var A=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
+2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
+2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
+2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
+3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
+936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],z=u?new Uint32Array(A):A;function B(){}B.prototype.getName=function(){return this.name};B.prototype.getData=function(){return this.data};B.prototype.H=function(){return this.I};r("Zlib.GunzipMember",B);r("Zlib.GunzipMember.prototype.getName",B.prototype.getName);r("Zlib.GunzipMember.prototype.getData",B.prototype.getData);r("Zlib.GunzipMember.prototype.getMtime",B.prototype.H);function D(e){var c=e.length,d=0,b=Number.POSITIVE_INFINITY,a,f,g,k,m,p,t,h,l,y;for(h=0;h<c;++h)e[h]>d&&(d=e[h]),e[h]<b&&(b=e[h]);a=1<<d;f=new (u?Uint32Array:Array)(a);g=1;k=0;for(m=2;g<=d;){for(h=0;h<c;++h)if(e[h]===g){p=0;t=k;for(l=0;l<g;++l)p=p<<1|t&1,t>>=1;y=g<<16|h;for(l=p;l<a;l+=m)f[l]=y;++k}++g;k<<=1;m<<=1}return[f,d,b]};var E=[],F;for(F=0;288>F;F++)switch(!0){case 143>=F:E.push([F+48,8]);break;case 255>=F:E.push([F-144+400,9]);break;case 279>=F:E.push([F-256+0,7]);break;case 287>=F:E.push([F-280+192,8]);break;default:n("invalid literal: "+F)}
+var ca=function(){function e(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,
+a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:n("invalid length: "+a)}}var c=[],d,b;for(d=3;258>=d;d++)b=e(d),c[d]=b[2]<<24|b[1]<<
+16|b[0];return c}();u&&new Uint32Array(ca);function G(e,c){this.i=[];this.j=32768;this.d=this.f=this.c=this.n=0;this.input=u?new Uint8Array(e):e;this.o=!1;this.k=H;this.z=!1;if(c||!(c={}))c.index&&(this.c=c.index),c.bufferSize&&(this.j=c.bufferSize),c.bufferType&&(this.k=c.bufferType),c.resize&&(this.z=c.resize);switch(this.k){case I:this.a=32768;this.b=new (u?Uint8Array:Array)(32768+this.j+258);break;case H:this.a=0;this.b=new (u?Uint8Array:Array)(this.j);this.e=this.F;this.q=this.B;this.l=this.D;break;default:n(Error("invalid inflate mode"))}}
+var I=0,H=1;
+G.prototype.g=function(){for(;!this.o;){var e=J(this,3);e&1&&(this.o=!0);e>>>=1;switch(e){case 0:var c=this.input,d=this.c,b=this.b,a=this.a,f=c.length,g=q,k=q,m=b.length,p=q;this.d=this.f=0;d+1>=f&&n(Error("invalid uncompressed block header: LEN"));g=c[d++]|c[d++]<<8;d+1>=f&&n(Error("invalid uncompressed block header: NLEN"));k=c[d++]|c[d++]<<8;g===~k&&n(Error("invalid uncompressed block header: length verify"));d+g>c.length&&n(Error("input buffer is broken"));switch(this.k){case I:for(;a+g>b.length;){p=
+m-a;g-=p;if(u)b.set(c.subarray(d,d+p),a),a+=p,d+=p;else for(;p--;)b[a++]=c[d++];this.a=a;b=this.e();a=this.a}break;case H:for(;a+g>b.length;)b=this.e({t:2});break;default:n(Error("invalid inflate mode"))}if(u)b.set(c.subarray(d,d+g),a),a+=g,d+=g;else for(;g--;)b[a++]=c[d++];this.c=d;this.a=a;this.b=b;break;case 1:this.l(da,ea);break;case 2:fa(this);break;default:n(Error("unknown BTYPE: "+e))}}return this.q()};
+var K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=u?new Uint16Array(K):K,N=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],O=u?new Uint16Array(N):N,P=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],Q=u?new Uint8Array(P):P,R=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ga=u?new Uint16Array(R):R,ha=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,
+13,13],U=u?new Uint8Array(ha):ha,V=new (u?Uint8Array:Array)(288),W,ia;W=0;for(ia=V.length;W<ia;++W)V[W]=143>=W?8:255>=W?9:279>=W?7:8;var da=D(V),X=new (u?Uint8Array:Array)(30),Y,ja;Y=0;for(ja=X.length;Y<ja;++Y)X[Y]=5;var ea=D(X);function J(e,c){for(var d=e.f,b=e.d,a=e.input,f=e.c,g=a.length,k;b<c;)f>=g&&n(Error("input buffer is broken")),d|=a[f++]<<b,b+=8;k=d&(1<<c)-1;e.f=d>>>c;e.d=b-c;e.c=f;return k}
+function Z(e,c){for(var d=e.f,b=e.d,a=e.input,f=e.c,g=a.length,k=c[0],m=c[1],p,t;b<m&&!(f>=g);)d|=a[f++]<<b,b+=8;p=k[d&(1<<m)-1];t=p>>>16;e.f=d>>t;e.d=b-t;e.c=f;return p&65535}
+function fa(e){function c(a,c,b){var d,e=this.w,f,g;for(g=0;g<a;)switch(d=Z(this,c),d){case 16:for(f=3+J(this,2);f--;)b[g++]=e;break;case 17:for(f=3+J(this,3);f--;)b[g++]=0;e=0;break;case 18:for(f=11+J(this,7);f--;)b[g++]=0;e=0;break;default:e=b[g++]=d}this.w=e;return b}var d=J(e,5)+257,b=J(e,5)+1,a=J(e,4)+4,f=new (u?Uint8Array:Array)(L.length),g,k,m,p;for(p=0;p<a;++p)f[L[p]]=J(e,3);if(!u){p=a;for(a=f.length;p<a;++p)f[L[p]]=0}g=D(f);k=new (u?Uint8Array:Array)(d);m=new (u?Uint8Array:Array)(b);e.w=
+0;e.l(D(c.call(e,d,g,k)),D(c.call(e,b,g,m)))}G.prototype.l=function(e,c){var d=this.b,b=this.a;this.r=e;for(var a=d.length-258,f,g,k,m;256!==(f=Z(this,e));)if(256>f)b>=a&&(this.a=b,d=this.e(),b=this.a),d[b++]=f;else{g=f-257;m=O[g];0<Q[g]&&(m+=J(this,Q[g]));f=Z(this,c);k=ga[f];0<U[f]&&(k+=J(this,U[f]));b>=a&&(this.a=b,d=this.e(),b=this.a);for(;m--;)d[b]=d[b++-k]}for(;8<=this.d;)this.d-=8,this.c--;this.a=b};
+G.prototype.D=function(e,c){var d=this.b,b=this.a;this.r=e;for(var a=d.length,f,g,k,m;256!==(f=Z(this,e));)if(256>f)b>=a&&(d=this.e(),a=d.length),d[b++]=f;else{g=f-257;m=O[g];0<Q[g]&&(m+=J(this,Q[g]));f=Z(this,c);k=ga[f];0<U[f]&&(k+=J(this,U[f]));b+m>a&&(d=this.e(),a=d.length);for(;m--;)d[b]=d[b++-k]}for(;8<=this.d;)this.d-=8,this.c--;this.a=b};
+G.prototype.e=function(){var e=new (u?Uint8Array:Array)(this.a-32768),c=this.a-32768,d,b,a=this.b;if(u)e.set(a.subarray(32768,e.length));else{d=0;for(b=e.length;d<b;++d)e[d]=a[d+32768]}this.i.push(e);this.n+=e.length;if(u)a.set(a.subarray(c,c+32768));else for(d=0;32768>d;++d)a[d]=a[c+d];this.a=32768;return a};
+G.prototype.F=function(e){var c,d=this.input.length/this.c+1|0,b,a,f,g=this.input,k=this.b;e&&("number"===typeof e.t&&(d=e.t),"number"===typeof e.A&&(d+=e.A));2>d?(b=(g.length-this.c)/this.r[2],f=258*(b/2)|0,a=f<k.length?k.length+f:k.length<<1):a=k.length*d;u?(c=new Uint8Array(a),c.set(k)):c=k;return this.b=c};
+G.prototype.q=function(){var e=0,c=this.b,d=this.i,b,a=new (u?Uint8Array:Array)(this.n+(this.a-32768)),f,g,k,m;if(0===d.length)return u?this.b.subarray(32768,this.a):this.b.slice(32768,this.a);f=0;for(g=d.length;f<g;++f){b=d[f];k=0;for(m=b.length;k<m;++k)a[e++]=b[k]}f=32768;for(g=this.a;f<g;++f)a[e++]=c[f];this.i=[];return this.buffer=a};
+G.prototype.B=function(){var e,c=this.a;u?this.z?(e=new Uint8Array(c),e.set(this.b.subarray(0,c))):e=this.b.subarray(0,c):(this.b.length>c&&(this.b.length=c),e=this.b);return this.buffer=e};function $(e){this.input=e;this.c=0;this.m=[];this.s=!1}$.prototype.G=function(){this.s||this.g();return this.m.slice()};
+$.prototype.g=function(){for(var e=this.input.length;this.c<e;){var c=new B,d=q,b=q,a=q,f=q,g=q,k=q,m=q,p=q,t=q,h=this.input,l=this.c;c.u=h[l++];c.v=h[l++];(31!==c.u||139!==c.v)&&n(Error("invalid file signature:"+c.u+","+c.v));c.p=h[l++];switch(c.p){case 8:break;default:n(Error("unknown compression method: "+c.p))}c.h=h[l++];p=h[l++]|h[l++]<<8|h[l++]<<16|h[l++]<<24;c.I=new Date(1E3*p);c.O=h[l++];c.N=h[l++];0<(c.h&4)&&(c.J=h[l++]|h[l++]<<8,l+=c.J);if(0<(c.h&8)){m=[];for(k=0;0<(g=h[l++]);)m[k++]=String.fromCharCode(g);
+c.name=m.join("")}if(0<(c.h&16)){m=[];for(k=0;0<(g=h[l++]);)m[k++]=String.fromCharCode(g);c.K=m.join("")}0<(c.h&2)&&(c.C=x(h,0,l)&65535,c.C!==(h[l++]|h[l++]<<8)&&n(Error("invalid header crc16")));d=h[h.length-4]|h[h.length-3]<<8|h[h.length-2]<<16|h[h.length-1]<<24;h.length-l-4-4<512*d&&(f=d);b=new G(h,{index:l,bufferSize:f});c.data=a=b.g();l=b.c;c.L=t=(h[l++]|h[l++]<<8|h[l++]<<16|h[l++]<<24)>>>0;x(a,q,q)!==t&&n(Error("invalid CRC-32 checksum: 0x"+x(a,q,q).toString(16)+" / 0x"+t.toString(16)));c.M=
+d=(h[l++]|h[l++]<<8|h[l++]<<16|h[l++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(c);this.c=l}this.s=!0;var y=this.m,s,M,S=0,T=0,C;s=0;for(M=y.length;s<M;++s)T+=y[s].data.length;if(u){C=new Uint8Array(T);for(s=0;s<M;++s)C.set(y[s].data,S),S+=y[s].data.length}else{C=[];for(s=0;s<M;++s)C[s]=y[s].data;C=Array.prototype.concat.apply([],C)}return C};r("Zlib.Gunzip",$);r("Zlib.Gunzip.prototype.decompress",$.prototype.g);r("Zlib.Gunzip.prototype.getMembers",$.prototype.G);}).call(this); //@ sourceMappingURL=gunzip.min.js.map

+ 0 - 51
examples/js/libs/zlib_and_gzip.min.js

@@ -1,51 +0,0 @@
-/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,u=!0,aa=this;function A(b,a){var c=b.split("."),d=aa;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&a!==t?d[e]=a:d=d[e]?d[e]:d[e]={}};var B="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function F(b,a){this.index="number"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error("invalid index"));this.buffer.length<=this.index&&this.f()}F.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a<c;++a)d[a]=b[a];return this.buffer=d};
-F.prototype.d=function(b,a,c){var d=this.buffer,e=this.index,f=this.m,g=d[e],k;c&&1<a&&(b=8<a?(H[b&255]<<24|H[b>>>8&255]<<16|H[b>>>16&255]<<8|H[b>>>24&255])>>32-a:H[b]>>8-a);if(8>a+f)g=g<<a|b,f+=a;else for(k=0;k<a;++k)g=g<<1|b>>a-k-1&1,8===++f&&(f=0,d[e++]=H[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};F.prototype.finish=function(){var b=this.buffer,a=this.index,c;0<this.m&&(b[a]<<=8-this.m,b[a]=H[b[a]],a++);B?c=b.subarray(0,a):(b.length=a,c=b);return c};
-var ba=new (B?Uint8Array:Array)(256),ca;for(ca=0;256>ca;++ca){for(var K=ca,da=K,ea=7,K=K>>>1;K;K>>>=1)da<<=1,da|=K&1,--ea;ba[ca]=(da<<ea&255)>>>0}var H=ba;function ja(b,a,c){var d,e="number"===typeof a?a:a=0,f="number"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^O[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^O[(d^b[a])&255],d=d>>>8^O[(d^b[a+1])&255],d=d>>>8^O[(d^b[a+2])&255],d=d>>>8^O[(d^b[a+3])&255],d=d>>>8^O[(d^b[a+4])&255],d=d>>>8^O[(d^b[a+5])&255],d=d>>>8^O[(d^b[a+6])&255],d=d>>>8^O[(d^b[a+7])&255];return(d^4294967295)>>>0}
-var ka=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
-2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
-2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
-2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
-3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
-936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],O=B?new Uint32Array(ka):ka;function P(){}P.prototype.getName=function(){return this.name};P.prototype.getData=function(){return this.data};P.prototype.Y=function(){return this.Z};A("Zlib.GunzipMember",P);A("Zlib.GunzipMember.prototype.getName",P.prototype.getName);A("Zlib.GunzipMember.prototype.getData",P.prototype.getData);A("Zlib.GunzipMember.prototype.getMtime",P.prototype.Y);function la(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}la.prototype.getParent=function(b){return 2*((b-2)/4|0)};la.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0<c;)if(d=this.getParent(c),e[c]>e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};
-la.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2<this.length&&c[e+2]>c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function ma(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,l,s,p,m,n;for(p=0;p<a;++p)b[p]>c&&(c=b[p]),b[p]<d&&(d=b[p]);e=1<<c;f=new (B?Uint32Array:Array)(e);g=1;k=0;for(h=2;g<=c;){for(p=0;p<a;++p)if(b[p]===g){l=0;s=k;for(m=0;m<g;++m)l=l<<1|s&1,s>>=1;n=g<<16|p;for(m=l;m<e;m+=h)f[m]=n;++k}++g;k<<=1;h<<=1}return[f,c,d]};function na(b,a){this.k=qa;this.I=0;this.input=B&&b instanceof Array?new Uint8Array(b):b;this.b=0;a&&(a.lazy&&(this.I=a.lazy),"number"===typeof a.compressionType&&(this.k=a.compressionType),a.outputBuffer&&(this.a=B&&a.outputBuffer instanceof Array?new Uint8Array(a.outputBuffer):a.outputBuffer),"number"===typeof a.outputIndex&&(this.b=a.outputIndex));this.a||(this.a=new (B?Uint8Array:Array)(32768))}var qa=2,ra={NONE:0,v:1,o:qa,ba:3},sa=[],S;
-for(S=0;288>S;S++)switch(u){case 143>=S:sa.push([S+48,8]);break;case 255>=S:sa.push([S-144+400,9]);break;case 279>=S:sa.push([S-256+0,7]);break;case 287>=S:sa.push([S-280+192,8]);break;default:q("invalid literal: "+S)}
-na.prototype.g=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c<d;){a=B?e.subarray(c,c+65535):e.slice(c,c+65535);c+=a.length;var f=a,g=c===d,k=t,h=t,l=t,s=t,p=t,m=this.a,n=this.b;if(B){for(m=new Uint8Array(this.a.buffer);m.length<=n+f.length+5;)m=new Uint8Array(m.length<<1);m.set(this.a)}k=g?1:0;m[n++]=k|0;h=f.length;l=~h+65536&65535;m[n++]=h&255;m[n++]=h>>>8&255;m[n++]=l&255;m[n++]=l>>>8&255;if(B)m.set(f,n),n+=f.length,m=m.subarray(0,n);else{s=0;for(p=f.length;s<p;++s)m[n++]=
-f[s];m.length=n}this.b=n;this.a=m}break;case 1:var r=new F(B?new Uint8Array(this.a.buffer):this.a,this.b);r.d(1,1,u);r.d(1,2,u);var v=ta(this,e),x,Q,y;x=0;for(Q=v.length;x<Q;x++)if(y=v[x],F.prototype.d.apply(r,sa[y]),256<y)r.d(v[++x],v[++x],u),r.d(v[++x],5),r.d(v[++x],v[++x],u);else if(256===y)break;this.a=r.finish();this.b=this.a.length;break;case qa:var E=new F(B?new Uint8Array(this.a.buffer):this.a,this.b),Ka,R,X,Y,Z,pb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa,La,ga,Ma,oa,wa=Array(19),
-Na,$,pa,C,Oa;Ka=qa;E.d(1,1,u);E.d(Ka,2,u);R=ta(this,e);fa=ua(this.W,15);La=va(fa);ga=ua(this.V,7);Ma=va(ga);for(X=286;257<X&&0===fa[X-1];X--);for(Y=30;1<Y&&0===ga[Y-1];Y--);var Pa=X,Qa=Y,J=new (B?Uint32Array:Array)(Pa+Qa),w,L,z,ha,I=new (B?Uint32Array:Array)(316),G,D,M=new (B?Uint8Array:Array)(19);for(w=L=0;w<Pa;w++)J[L++]=fa[w];for(w=0;w<Qa;w++)J[L++]=ga[w];if(!B){w=0;for(ha=M.length;w<ha;++w)M[w]=0}w=G=0;for(ha=J.length;w<ha;w+=L){for(L=1;w+L<ha&&J[w+L]===J[w];++L);z=L;if(0===J[w])if(3>z)for(;0<
-z--;)I[G++]=0,M[0]++;else for(;0<z;)D=138>z?z:138,D>z-3&&D<z&&(D=z-3),10>=D?(I[G++]=17,I[G++]=D-3,M[17]++):(I[G++]=18,I[G++]=D-11,M[18]++),z-=D;else if(I[G++]=J[w],M[J[w]]++,z--,3>z)for(;0<z--;)I[G++]=J[w],M[J[w]]++;else for(;0<z;)D=6>z?z:6,D>z-3&&D<z&&(D=z-3),I[G++]=16,I[G++]=D-3,M[16]++,z-=D}b=B?I.subarray(0,G):I.slice(0,G);oa=ua(M,7);for(C=0;19>C;C++)wa[C]=oa[pb[C]];for(Z=19;4<Z&&0===wa[Z-1];Z--);Na=va(oa);E.d(X-257,5,u);E.d(Y-1,5,u);E.d(Z-4,4,u);for(C=0;C<Z;C++)E.d(wa[C],3,u);C=0;for(Oa=b.length;C<
-Oa;C++)if($=b[C],E.d(Na[$],oa[$],u),16<=$){C++;switch($){case 16:pa=2;break;case 17:pa=3;break;case 18:pa=7;break;default:q("invalid code: "+$)}E.d(b[C],pa,u)}var Ra=[La,fa],Sa=[Ma,ga],N,Ta,ia,za,Ua,Va,Wa,Xa;Ua=Ra[0];Va=Ra[1];Wa=Sa[0];Xa=Sa[1];N=0;for(Ta=R.length;N<Ta;++N)if(ia=R[N],E.d(Ua[ia],Va[ia],u),256<ia)E.d(R[++N],R[++N],u),za=R[++N],E.d(Wa[za],Xa[za],u),E.d(R[++N],R[++N],u);else if(256===ia)break;this.a=E.finish();this.b=this.a.length;break;default:q("invalid compression type")}return this.a};
-function xa(b,a){this.length=b;this.Q=a}
-var ya=function(){function b(a){switch(u){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,
-a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q("invalid length: "+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<
-16|d[0];return a}(),Aa=B?new Uint32Array(ya):ya;
-function ta(b,a){function c(a,c){var b=a.Q,d=[],e=0,f;f=Aa[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-
-65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=
-b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q("invalid distance")}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var h,k;h=0;for(k=d.length;h<k;++h)m[n++]=d[h];v[d[0]]++;x[d[3]]++;r=a.length+c-1;p=null}var d,e,f,g,k,h={},l,s,p,m=B?new Uint16Array(2*a.length):[],n=0,r=0,v=new (B?Uint32Array:Array)(286),x=new (B?Uint32Array:Array)(30),Q=b.I,y;if(!B){for(f=0;285>=f;)v[f++]=0;for(f=0;29>=f;)x[f++]=0}v[256]=1;d=0;for(e=a.length;d<e;++d){f=k=0;
-for(g=3;f<g&&d+f!==e;++f)k=k<<8|a[d+f];h[k]===t&&(h[k]=[]);l=h[k];if(!(0<r--)){for(;0<l.length&&32768<d-l[0];)l.shift();if(d+3>=e){p&&c(p,-1);f=0;for(g=e-d;f<g;++f)y=a[d+f],m[n++]=y,++v[y];break}0<l.length?(s=Ba(a,d,l),p?p.length<s.length?(y=a[d-1],m[n++]=y,++v[y],c(s,0)):c(p,-1):s.length<Q?p=s:c(s,0)):p?c(p,-1):(y=a[d],m[n++]=y,++v[y])}l.push(d)}m[n++]=256;v[256]++;b.W=v;b.V=x;return B?m.subarray(0,n):m}
-function Ba(b,a,c){var d,e,f=0,g,k,h,l,s=b.length;k=0;l=c.length;a:for(;k<l;k++){d=c[l-k-1];g=3;if(3<f){for(h=f;3<h;h--)if(b[d+h-1]!==b[a+h-1])continue a;g=f}for(;258>g&&a+g<s&&b[d+g]===b[a+g];)++g;g>f&&(e=d,f=g);if(258===g)break}return new xa(f,a-e)}
-function ua(b,a){var c=b.length,d=new la(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,l;if(!B)for(h=0;h<c;h++)e[h]=0;for(h=0;h<c;++h)0<b[h]&&d.push(h,b[h]);f=Array(d.length/2);g=new (B?Uint32Array:Array)(d.length/2);if(1===f.length)return e[d.pop().index]=1,e;h=0;for(l=d.length/2;h<l;++h)f[h]=d.pop(),g[h]=f[h].value;k=Ca(g,g.length,a);h=0;for(l=f.length;h<l;++h)e[f[h].index]=k[h];return e}
-function Ca(b,a,c){function d(b){var c=h[b][l[b]];c===a?(d(b+1),d(b+1)):--g[c];++l[b]}var e=new (B?Uint16Array:Array)(c),f=new (B?Uint8Array:Array)(c),g=new (B?Uint8Array:Array)(a),k=Array(c),h=Array(c),l=Array(c),s=(1<<c)-a,p=1<<c-1,m,n,r,v,x;e[c-1]=a;for(n=0;n<c;++n)s<p?f[n]=0:(f[n]=1,s-=p),s<<=1,e[c-2-n]=(e[c-1-n]/2|0)+a;e[0]=f[0];k[0]=Array(e[0]);h[0]=Array(e[0]);for(n=1;n<c;++n)e[n]>2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(m=0;m<a;++m)g[m]=c;for(r=0;r<e[c-1];++r)k[c-
-1][r]=b[r],h[c-1][r]=r;for(m=0;m<c;++m)l[m]=0;1===f[c-1]&&(--g[0],++l[c-1]);for(n=c-2;0<=n;--n){v=m=0;x=l[n+1];for(r=0;r<e[n];r++)v=k[n+1][x]+k[n+1][x+1],v>b[m]?(k[n][r]=v,h[n][r]=a,x+=2):(k[n][r]=b[m],h[n][r]=m,++m);l[n]=0;1===f[n]&&d(n)}return g}
-function va(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f<g;f++)c[b[f]]=(c[b[f]]|0)+1;f=1;for(g=16;f<=g;f++)d[f]=e,e+=c[f]|0,e<<=1;f=0;for(g=b.length;f<g;f++){e=d[b[f]];d[b[f]]+=1;k=a[f]=0;for(h=b[f];k<h;k++)a[f]=a[f]<<1|e&1,e>>>=1}return a};function Da(b,a){this.input=b;this.b=this.c=0;this.i={};a&&(a.flags&&(this.i=a.flags),"string"===typeof a.filename&&(this.filename=a.filename),"string"===typeof a.comment&&(this.A=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}
-Da.prototype.g=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),l=0,s=this.input,p=this.c,m=this.filename,n=this.A;h[l++]=31;h[l++]=139;h[l++]=8;b=0;this.i.fname&&(b|=Ea);this.i.fcomment&&(b|=Fa);this.i.fhcrc&&(b|=Ga);h[l++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[l++]=a&255;h[l++]=a>>>8&255;h[l++]=a>>>16&255;h[l++]=a>>>24&255;h[l++]=0;h[l++]=Ha;if(this.i.fname!==t){g=0;for(k=m.length;g<k;++g)f=m.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}if(this.i.comment){g=
-0;for(k=n.length;g<k;++g)f=n.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}this.i.fhcrc&&(c=ja(h,0,l)&65535,h[l++]=c&255,h[l++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=l;e=new na(s,this.l);h=e.g();l=e.b;B&&(l+8>h.buffer.byteLength?(this.a=new Uint8Array(l+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ja(s,t,t);h[l++]=d&255;h[l++]=d>>>8&255;h[l++]=d>>>16&255;h[l++]=d>>>24&255;k=s.length;h[l++]=k&255;h[l++]=k>>>8&255;h[l++]=k>>>16&255;h[l++]=
-k>>>24&255;this.c=p;B&&l<h.length&&(this.a=h=h.subarray(0,l));return h};var Ha=255,Ga=2,Ea=8,Fa=16;A("Zlib.Gzip",Da);A("Zlib.Gzip.prototype.compress",Da.prototype.g);function T(b,a){this.p=[];this.q=32768;this.e=this.j=this.c=this.u=0;this.input=B?new Uint8Array(b):b;this.w=!1;this.r=Ia;this.M=!1;if(a||!(a={}))a.index&&(this.c=a.index),a.bufferSize&&(this.q=a.bufferSize),a.bufferType&&(this.r=a.bufferType),a.resize&&(this.M=a.resize);switch(this.r){case Ja:this.b=32768;this.a=new (B?Uint8Array:Array)(32768+this.q+258);break;case Ia:this.b=0;this.a=new (B?Uint8Array:Array)(this.q);this.f=this.U;this.B=this.R;this.s=this.T;break;default:q(Error("invalid inflate mode"))}}
-var Ja=0,Ia=1,Ya={O:Ja,N:Ia};
-T.prototype.h=function(){for(;!this.w;){var b=U(this,3);b&1&&(this.w=u);b>>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,l=t;this.e=this.j=0;c+1>=f&&q(Error("invalid uncompressed block header: LEN"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error("invalid uncompressed block header: NLEN"));k=a[c++]|a[c++]<<8;g===~k&&q(Error("invalid uncompressed block header: length verify"));c+g>a.length&&q(Error("input buffer is broken"));switch(this.r){case Ja:for(;e+g>d.length;){l=
-h-e;g-=l;if(B)d.set(a.subarray(c,c+l),e),e+=l,c+=l;else for(;l--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ia:for(;e+g>d.length;)d=this.f({F:2});break;default:q(Error("invalid inflate mode"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.s(Za,$a);break;case 2:ab(this);break;default:q(Error("unknown BTYPE: "+b))}}return this.B()};
-var bb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],cb=B?new Uint16Array(bb):bb,db=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],eb=B?new Uint16Array(db):db,fb=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],gb=B?new Uint8Array(fb):fb,hb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ib=B?new Uint16Array(hb):hb,jb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,
-10,11,11,12,12,13,13],kb=B?new Uint8Array(jb):jb,lb=new (B?Uint8Array:Array)(288),V,mb;V=0;for(mb=lb.length;V<mb;++V)lb[V]=143>=V?8:255>=V?9:279>=V?7:8;var Za=ma(lb),nb=new (B?Uint8Array:Array)(30),ob,qb;ob=0;for(qb=nb.length;ob<qb;++ob)nb[ob]=5;var $a=ma(nb);function U(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k;d<a;)f>=g&&q(Error("input buffer is broken")),c|=e[f++]<<d,d+=8;k=c&(1<<a)-1;b.j=c>>>a;b.e=d-a;b.c=f;return k}
-function rb(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],l,s;d<h&&!(f>=g);)c|=e[f++]<<d,d+=8;l=k[c&(1<<h)-1];s=l>>>16;b.j=c>>s;b.e=d-s;b.c=f;return l&65535}
-function ab(b){function a(a,b,c){var d,e=this.J,f,g;for(g=0;g<a;)switch(d=rb(this,b),d){case 16:for(f=3+U(this,2);f--;)c[g++]=e;break;case 17:for(f=3+U(this,3);f--;)c[g++]=0;e=0;break;case 18:for(f=11+U(this,7);f--;)c[g++]=0;e=0;break;default:e=c[g++]=d}this.J=e;return c}var c=U(b,5)+257,d=U(b,5)+1,e=U(b,4)+4,f=new (B?Uint8Array:Array)(cb.length),g,k,h,l;for(l=0;l<e;++l)f[cb[l]]=U(b,3);if(!B){l=e;for(e=f.length;l<e;++l)f[cb[l]]=0}g=ma(f);k=new (B?Uint8Array:Array)(c);h=new (B?Uint8Array:Array)(d);
-b.J=0;b.s(ma(a.call(b,c,g,k)),ma(a.call(b,d,g,h)))}T.prototype.s=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length-258,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d>=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};
-T.prototype.T=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d+h>e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};
-T.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;c<d;++c)b[c]=e[c+32768]}this.p.push(b);this.u+=b.length;if(B)e.set(e.subarray(a,a+32768));else for(c=0;32768>c;++c)e[c]=e[a+c];this.b=32768;return e};
-T.prototype.U=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&("number"===typeof b.F&&(c=b.F),"number"===typeof b.P&&(c+=b.P));2>c?(d=(g.length-this.c)/this.C[2],f=258*(d/2)|0,e=f<k.length?k.length+f:k.length<<1):e=k.length*c;B?(a=new Uint8Array(e),a.set(k)):a=k;return this.a=a};
-T.prototype.B=function(){var b=0,a=this.a,c=this.p,d,e=new (B?Uint8Array:Array)(this.u+(this.b-32768)),f,g,k,h;if(0===c.length)return B?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);f=0;for(g=c.length;f<g;++f){d=c[f];k=0;for(h=d.length;k<h;++k)e[b++]=d[k]}f=32768;for(g=this.b;f<g;++f)e[b++]=a[f];this.p=[];return this.buffer=e};
-T.prototype.R=function(){var b,a=this.b;B?this.M?(b=new Uint8Array(a),b.set(this.a.subarray(0,a))):b=this.a.subarray(0,a):(this.a.length>a&&(this.a.length=a),b=this.a);return this.buffer=b};function sb(b){this.input=b;this.c=0;this.t=[];this.D=!1}sb.prototype.X=function(){this.D||this.h();return this.t.slice()};
-sb.prototype.h=function(){for(var b=this.input.length;this.c<b;){var a=new P,c=t,d=t,e=t,f=t,g=t,k=t,h=t,l=t,s=t,p=this.input,m=this.c;a.G=p[m++];a.H=p[m++];(31!==a.G||139!==a.H)&&q(Error("invalid file signature:"+a.G+","+a.H));a.z=p[m++];switch(a.z){case 8:break;default:q(Error("unknown compression method: "+a.z))}a.n=p[m++];l=p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24;a.Z=new Date(1E3*l);a.fa=p[m++];a.ea=p[m++];0<(a.n&4)&&(a.aa=p[m++]|p[m++]<<8,m+=a.aa);if(0<(a.n&Ea)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=
-String.fromCharCode(g);a.name=h.join("")}if(0<(a.n&Fa)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=String.fromCharCode(g);a.A=h.join("")}0<(a.n&Ga)&&(a.S=ja(p,0,m)&65535,a.S!==(p[m++]|p[m++]<<8)&&q(Error("invalid header crc16")));c=p[p.length-4]|p[p.length-3]<<8|p[p.length-2]<<16|p[p.length-1]<<24;p.length-m-4-4<512*c&&(f=c);d=new T(p,{index:m,bufferSize:f});a.data=e=d.h();m=d.c;a.ca=s=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;ja(e,t,t)!==s&&q(Error("invalid CRC-32 checksum: 0x"+ja(e,t,t).toString(16)+
-" / 0x"+s.toString(16)));a.da=c=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error("invalid input size: "+(e.length&4294967295)+" / "+c));this.t.push(a);this.c=m}this.D=u;var n=this.t,r,v,x=0,Q=0,y;r=0;for(v=n.length;r<v;++r)Q+=n[r].data.length;if(B){y=new Uint8Array(Q);for(r=0;r<v;++r)y.set(n[r].data,x),x+=n[r].data.length}else{y=[];for(r=0;r<v;++r)y[r]=n[r].data;y=Array.prototype.concat.apply([],y)}return y};A("Zlib.Gunzip",sb);A("Zlib.Gunzip.prototype.decompress",sb.prototype.h);A("Zlib.Gunzip.prototype.getMembers",sb.prototype.X);function tb(b){if("string"===typeof b){var a=b.split(""),c,d;c=0;for(d=a.length;c<d;c++)a[c]=(a[c].charCodeAt(0)&255)>>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0<g;){k=1024<g?1024:g;g-=k;do e+=b[h++],f+=e;while(--k);e%=65521;f%=65521}return(f<<16|e)>>>0};function ub(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.$=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case vb:this.method=vb;break;default:q(Error("unsupported compression method"))}0!==((c<<8)+d)%31&&q(Error("invalid fcheck flag:"+((c<<8)+d)%31));d&32&&q(Error("fdict flag is not supported"));this.L=new T(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}
-ub.prototype.h=function(){var b=this.input,a,c;a=this.L.h();this.c=this.L.c;this.$&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==tb(a)&&q(Error("invalid adler-32 checksum")));return a};var vb=8;function wb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=W.o;var c={},d;if((a||!(a={}))&&"number"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.K=new na(this.input,c)}var W=ra;
-wb.prototype.g=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=vb;switch(b){case vb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error("invalid compression method"))}c=a<<4|b;g[k++]=c;switch(b){case vb:switch(this.k){case W.NONE:e=0;break;case W.v:e=1;break;case W.o:e=2;break;default:q(Error("unsupported compression type"))}break;default:q(Error("invalid compression method"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=tb(this.input);this.K.b=k;g=this.K.g();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=
-k+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};function xb(b,a){var c,d,e,f;if(Object.keys)c=Object.keys(a);else for(d in c=[],e=0,a)c[e++]=d;e=0;for(f=c.length;e<f;++e)d=c[e],A(b+"."+d,a[d])};A("Zlib.Inflate",ub);A("Zlib.Inflate.prototype.decompress",ub.prototype.h);xb("Zlib.Inflate.BufferType",{ADAPTIVE:Ya.N,BLOCK:Ya.O});A("Zlib.Deflate",wb);A("Zlib.Deflate.compress",function(b,a){return(new wb(b,a)).g()});A("Zlib.Deflate.prototype.compress",wb.prototype.g);xb("Zlib.Deflate.CompressionType",{NONE:W.NONE,FIXED:W.v,DYNAMIC:W.o});}).call(this); //@ sourceMappingURL=zlib_and_gzip.min.js.map

+ 0 - 1
examples/js/lights/RectAreaLightUniformsLib.js

@@ -54,7 +54,6 @@
 
 	var ltc_brdf = { ltcMat: { value: null }, ltcMag: { value: null } };
 
-	Object.assign( ShaderLib.phong.uniforms, ltc_brdf );
 	Object.assign( ShaderLib.standard.uniforms, ltc_brdf );
 	Object.assign( ShaderLib.physical.uniforms, ltc_brdf );
 

部分文件因为文件数量过多而无法显示