Mr.doob 9 years ago
parent
commit
250c5d571b
100 changed files with 2053 additions and 2083 deletions
  1. 296 310
      build/three.js
  2. 218 225
      build/three.min.js
  3. 2 2
      docs/api/core/Clock.html
  4. 1 1
      docs/api/core/Geometry.html
  5. 3 11
      docs/api/core/Object3D.html
  6. 2 2
      docs/api/core/Raycaster.html
  7. 55 0
      docs/api/extras/geometries/ConeBufferGeometry.html
  8. 55 0
      docs/api/extras/geometries/ConeGeometry.html
  9. 11 11
      docs/api/extras/geometries/TextGeometry.html
  10. 1 1
      docs/api/lights/SpotLight.html
  11. 19 14
      docs/api/loaders/JSONLoader.html
  12. 1 1
      docs/api/materials/MeshPhongMaterial.html
  13. 1 8
      docs/api/materials/ShaderMaterial.html
  14. 25 3
      docs/api/math/Color.html
  15. 0 5
      docs/api/math/Math.html
  16. 7 2
      docs/api/math/Quaternion.html
  17. 132 132
      docs/api/objects/Skeleton.html
  18. 1 0
      docs/api/renderers/CanvasRenderer.html
  19. 49 38
      docs/api/renderers/WebGLRenderTarget.html
  20. 17 17
      docs/api/renderers/WebGLRenderer.html
  21. 0 39
      docs/api/renderers/webgl/plugins/ShadowMapPlugin.html
  22. 159 159
      docs/api/textures/Texture.html
  23. 2 1
      docs/list.js
  24. 90 3
      docs/scenes/js/geometry.js
  25. 39 36
      editor/examples/particles.app.json
  26. 2 3
      editor/index.html
  27. 1 3
      editor/js/Config.js
  28. 37 37
      editor/js/Editor.js
  29. 8 8
      editor/js/Menubar.Add.js
  30. 2 0
      editor/js/Script.js
  31. 7 4
      editor/js/Sidebar.Geometry.BoxGeometry.js
  32. 2 1
      editor/js/Sidebar.Geometry.BufferGeometry.js
  33. 6 3
      editor/js/Sidebar.Geometry.CircleGeometry.js
  34. 6 3
      editor/js/Sidebar.Geometry.CylinderGeometry.js
  35. 5 4
      editor/js/Sidebar.Geometry.Geometry.js
  36. 6 3
      editor/js/Sidebar.Geometry.IcosahedronGeometry.js
  37. 6 5
      editor/js/Sidebar.Geometry.LatheGeometry.js
  38. 6 3
      editor/js/Sidebar.Geometry.PlaneGeometry.js
  39. 6 3
      editor/js/Sidebar.Geometry.SphereGeometry.js
  40. 1 1
      editor/js/Sidebar.Geometry.TeapotBufferGeometry.js
  41. 6 3
      editor/js/Sidebar.Geometry.TorusGeometry.js
  42. 6 3
      editor/js/Sidebar.Geometry.TorusKnotGeometry.js
  43. 3 1
      editor/js/Sidebar.Geometry.js
  44. 18 6
      editor/js/Sidebar.History.js
  45. 33 12
      editor/js/Sidebar.Material.js
  46. 72 32
      editor/js/Sidebar.Scene.js
  47. 1 1
      editor/js/Viewport.js
  48. 2 0
      editor/js/commands/SetMaterialValueCommand.js
  49. 47 32
      editor/js/libs/codemirror/codemirror.css
  50. 309 204
      editor/js/libs/codemirror/codemirror.js
  51. 71 26
      editor/js/libs/codemirror/mode/javascript.js
  52. 24 21
      editor/js/libs/codemirror/theme/monokai.css
  53. 0 4
      editor/js/libs/tern-threejs/threejs.js
  54. 1 1
      editor/js/libs/ui.js
  55. 2 8
      editor/js/libs/ui.three.js
  56. 2 0
      examples/canvas_geometry_shapes.html
  57. 1 1
      examples/canvas_geometry_text.html
  58. 6 6
      examples/canvas_interactive_cubes.html
  59. 0 440
      examples/css3dstereo_periodictable.html
  60. 2 4
      examples/files.js
  61. 1 1
      examples/fonts/README
  62. 0 0
      examples/fonts/droid/droid_sans_bold.typeface.js
  63. 0 0
      examples/fonts/droid/droid_sans_bold.typeface.json
  64. 0 0
      examples/fonts/droid/droid_sans_mono_regular.typeface.js
  65. 0 0
      examples/fonts/droid/droid_sans_mono_regular.typeface.json
  66. 0 0
      examples/fonts/droid/droid_sans_regular.typeface.js
  67. 0 0
      examples/fonts/droid/droid_sans_regular.typeface.json
  68. 0 0
      examples/fonts/droid/droid_serif_bold.typeface.js
  69. 0 0
      examples/fonts/droid/droid_serif_bold.typeface.json
  70. 0 0
      examples/fonts/droid/droid_serif_regular.typeface.js
  71. 0 0
      examples/fonts/droid/droid_serif_regular.typeface.json
  72. 0 0
      examples/fonts/gentilis_bold.typeface.js
  73. 0 0
      examples/fonts/gentilis_bold.typeface.json
  74. 0 0
      examples/fonts/gentilis_regular.typeface.js
  75. 0 0
      examples/fonts/gentilis_regular.typeface.json
  76. 0 0
      examples/fonts/helvetiker_bold.typeface.js
  77. 0 0
      examples/fonts/helvetiker_bold.typeface.json
  78. 0 0
      examples/fonts/helvetiker_regular.typeface.js
  79. 0 0
      examples/fonts/helvetiker_regular.typeface.json
  80. 0 0
      examples/fonts/optimer_bold.typeface.js
  81. 0 0
      examples/fonts/optimer_bold.typeface.json
  82. 0 0
      examples/fonts/optimer_regular.typeface.js
  83. 0 0
      examples/fonts/optimer_regular.typeface.json
  84. 29 0
      examples/js/BlendCharacter.js
  85. 6 23
      examples/js/MD2Character.js
  86. 9 9
      examples/js/Mirror.js
  87. 1 1
      examples/js/MorphAnimMesh.js
  88. 14 14
      examples/js/Ocean.js
  89. 8 8
      examples/js/SimulationRenderer.js
  90. 11 9
      examples/js/WaterShader.js
  91. 3 3
      examples/js/cameras/CinematicCamera.js
  92. 0 7
      examples/js/cameras/CombinedCamera.js
  93. 6 6
      examples/js/controls/OrbitControls.js
  94. 12 13
      examples/js/controls/TransformControls.js
  95. 2 2
      examples/js/crossfade/transition.js
  96. 2 2
      examples/js/effects/AnaglyphEffect.js
  97. 2 2
      examples/js/effects/ParallaxBarrierEffect.js
  98. 48 27
      examples/js/effects/VREffect.js
  99. 0 49
      examples/js/libs/photons.min.js
  100. 6 0
      examples/js/loaders/ColladaLoader2.js

File diff suppressed because it is too large
+ 296 - 310
build/three.js


File diff suppressed because it is too large
+ 218 - 225
build/three.min.js


+ 2 - 2
docs/api/core/Clock.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
@@ -18,7 +18,7 @@
 
 		<h3>[name]( [page:Boolean autoStart] )</h3>
 		<div>
-		autoStart — Automatically start the clock.
+		autoStart — Automatically start the clock. Default is true.
 		</div>
 
 		<h2>Properties</h2>

+ 1 - 1
docs/api/core/Geometry.html

@@ -175,7 +175,7 @@
 		Set to *true* if the colors array or a face3 color has been updated.
 		</div>
 
-		<h3>[property:Boolean groupdsNeedUpdate]</h3>
+		<h3>[property:Boolean groupsNeedUpdate]</h3>
 		<div>
 		Set to *true* if a face3 materialIndex has been updated.
 		</div>

+ 3 - 11
docs/api/core/Object3D.html

@@ -128,14 +128,6 @@
 		default – false
 		</div>
 
-		<h3>[property:Boolean rotationAutoUpdate]</h3>
-		<div>
-		When this is set, then the rotationMatrix gets calculated every frame.
-		</div>
-		<div>
-		default – true
-		</div>
-
 		<h3>[property:object userData]</h3>
 		<div>
 		An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned.
@@ -230,7 +222,7 @@
 		<div>
 		Executes the callback on this object and all descendants.
 		</div>
-		
+
 		<h3>[method:null traverseVisible]( [page:Function callback] )</h3>
 		<div>
 		callback - A function with as first argument an object3D object.<br />
@@ -239,13 +231,13 @@
 		Like traverse, but the callback will only be executed for visible objects.
 		Descendants of invisible objects are not traversed.
 		</div>
-		
+
 		<h3>[method:null traverseAncestors]( [page:Function callback] )</h3>
 		<div>
 		callback - A function with as first argument an object3D object.<br />
 		</div>
 		<div>
-		Executes the callback on this object and all ancestors.
+		Executes the callback on all ancestors.
 		</div>
 
 		<h3>[method:null updateMatrix]()</h3>

+ 2 - 2
docs/api/core/Raycaster.html

@@ -129,7 +129,7 @@
 		<div>
 		<p>
 		[page:Object3D object] — The object to check for intersection with the ray.<br />
-		[page:Boolean recursive] — If set, it also checks all descendants. Otherwise it only checks intersecton with the object.
+		[page:Boolean recursive] — If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false.
 		</p>
 		</div>
 		<div>
@@ -159,7 +159,7 @@
 		<h3>[method:Array intersectObjects]( [page:Array objects], [page:Boolean recursive] )</h3>
 		<div>
 		[page:Array objects] — The objects to check for intersection with the ray.<br />
-		[page:Boolean recursive] — If set, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects.
+		[page:Boolean recursive] — If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false.
 		</div>
 		<div>
 		Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by [page:.intersectObject].

+ 55 - 0
docs/api/extras/geometries/ConeBufferGeometry.html

@@ -0,0 +1,55 @@
+<!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>
+		[page:BufferGeometry] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">This is the [page:BufferGeometry] port of [page:ConeGeometry].</div>
+
+
+		<h2>Example</h2>
+
+		<iframe src='scenes/geometry-browser.html#ConeBufferGeometry'></iframe>
+
+		<code>var geometry = new THREE.ConeBufferGeometry( 5, 20, 32 );
+		var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
+		var cone = new THREE.Mesh( geometry, material );
+		scene.add( cone );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
+		<div>
+		radius — Radius of the cone base. Default is 20.<br />
+		height — Height of the cone. Default is 100.<br />
+		radiusSegments — Number of segmented faces around the circumference of the cone. Default is 8<br />
+		heightSegments — Number of rows of faces along the height of the cone. Default is 1.<br />
+		openEnded — A Boolean indicating whether the ends of the cone are open or capped. Default is false, meaning capped.<br />
+		thetaStart — Start angle for first segment, default = 0 (three o'clock position).<br />
+		thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cone.
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+		Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
+		</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 55 - 0
docs/api/extras/geometries/ConeGeometry.html

@@ -0,0 +1,55 @@
+<!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>
+		[page:Geometry] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">A class for generating cone geometries</div>
+
+
+		<h2>Example</h2>
+
+		<iframe src='scenes/geometry-browser.html#ConeGeometry'></iframe>
+
+		<code>var geometry = new THREE.ConeGeometry( 5, 20, 32 );
+		var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
+		var cone = new THREE.Mesh( geometry, material );
+		scene.add( cone );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
+		<div>
+		radius — Radius of the cone at the base. Default is 20.<br />
+		height — Height of the cone. Default is 100.<br />
+		radiusSegments — Number of segmented faces around the circumference of the cone. Default is 8<br />
+		heightSegments — Number of rows of faces along the height of the cone. Default is 1.<br />
+		openEnded — A Boolean indicating whether the ends of the cone are open or capped. Default is false, meaning capped.<br />
+		thetaStart — Start angle for first segment, default = 0 (three o'clock position).<br />
+		thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cone.
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+		Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
+		</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 11 - 11
docs/api/extras/geometries/TextGeometry.html

@@ -44,7 +44,7 @@
 		<h2>Available Fonts</h2>
 
 		<div>
-		TextGeometry uses <a href='http://gero3.github.io/facetype.js/' target="_top">typeface.js</a> generated fonts.
+		TextGeometry uses <a href='http://gero3.github.io/facetype.js/' target="_top">typeface.json</a> generated fonts.
 		Some existing fonts can be found located in <b>/examples/fonts</b> and must be included in the page.
 		</div>
 		<table>
@@ -58,61 +58,61 @@
 				<td>helvetiker</td>
 				<td>normal</td>
 				<td>normal</td>
-				<td>/examples/fonts/helvetiker_regular.typeface.js</td>
+				<td>/examples/fonts/helvetiker_regular.typeface.json</td>
 			</tr>
 			<tr>
 				<td>helvetiker</td>
 				<td>bold</td>
 				<td>normal</td>
-				<td>/examples/fonts/helvetiker_bold.typeface.js</td>
+				<td>/examples/fonts/helvetiker_bold.typeface.json</td>
 			</tr>
 			<tr>
 				<td>optimer</td>
 				<td>normal</td>
 				<td>normal</td>
-				<td>/examples/fonts/optimer_regular.typeface.js</td>
+				<td>/examples/fonts/optimer_regular.typeface.json</td>
 			</tr>
 			<tr>
 				<td>optimer</td>
 				<td>bold</td>
 				<td>normal</td>
-				<td>/examples/fonts/optimer_bold.typeface.js</td>
+				<td>/examples/fonts/optimer_bold.typeface.json</td>
 			</tr>
 			<tr>
 				<td>gentilis</td>
 				<td>normal</td>
 				<td>normal</td>
-				<td>/examples/fonts/gentilis_regular.typeface.js</td>
+				<td>/examples/fonts/gentilis_regular.typeface.json</td>
 			</tr>
 			<tr>
 				<td>gentilis</td>
 				<td>bold</td>
 				<td>normal</td>
-				<td>/examples/fonts/gentilis_bold.typeface.js</td>
+				<td>/examples/fonts/gentilis_bold.typeface.json</td>
 			</tr>
 			<tr>
 				<td>droid sans</td>
 				<td>normal</td>
 				<td>normal</td>
-				<td>/examples/fonts/droid/droid_sans_regular.typeface.js</td>
+				<td>/examples/fonts/droid/droid_sans_regular.typeface.json</td>
 			</tr>
 			<tr>
 				<td>droid sans</td>
 				<td>bold</td>
 				<td>normal</td>
-				<td>/examples/fonts/droid/droid_sans_bold.typeface.js</td>
+				<td>/examples/fonts/droid/droid_sans_bold.typeface.json</td>
 			</tr>
 			<tr>
 				<td>droid serif</td>
 				<td>normal</td>
 				<td>normal</td>
-				<td>/examples/fonts/droid/droid_serif_regular.typeface.js</td>
+				<td>/examples/fonts/droid/droid_serif_regular.typeface.json</td>
 			</tr>
 			<tr>
 				<td>droid serif</td>
 				<td>bold</td>
 				<td>normal</td>
-				<td>/examples/fonts/droid/droid_serif_bold.typeface.js</td>
+				<td>/examples/fonts/droid/droid_serif_bold.typeface.json</td>
 			</tr>
 		</table>
 

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

@@ -1,4 +1,4 @@
-	<!DOCTYPE html>
+<!DOCTYPE html>
 <html lang="en">
 	<head>
 		<meta charset="utf-8" />

+ 19 - 14
docs/api/loaders/JSONLoader.html

@@ -16,27 +16,33 @@
 
 		<h2>Constructor</h2>
 
-		<h3>[name]()</h3>
+		<h3>[name]( [page:LoadingManager manager] )</h3>
+		<div>
+		[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
+		</div>
 		<div>
 		Creates a new [name].
 		</div>
 
+		<h2>Methods</h2>
 
-		<h2>Properties</h2>
-
-		<h3>[property:boolean withCredentials]</h3>
+		<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
 		<div>
-		If true, the ajax request will use cookies.
+		[page:String url] — required.<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 onError] — Will be called when load errors.<br />
+		</div>
+		<div>
+		Begin loading from url and pass the <em>JSON</em> to onLoad.
 		</div>
 
-
-		<h2>Methods</h2>
-
-		<h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
+		<h3>[method:null setTexturePath]( [page:String texturePath] )</h3>
+		<div>
+		[page:String texturePath] — Base path for textures.
+		</div>
 		<div>
-		[page:String url] — required<br />
-		[page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br />
-		[page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file.
+		Set the base path for textures.
 		</div>
 
 		<h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
@@ -45,10 +51,9 @@
 		[page:String texturePath] — Base path for textures.
 		</div>
 		<div>
-		Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
+		Parse a <em>JSON</em> structure and return an [page:object] containing the parsed [page:Geometry geometry] and [page:Array materials].
 		</div>
 
-
 		<h2>Example</h2>
 
 		<code>

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

@@ -38,7 +38,7 @@
 		bumpMap — Set bump map. Default is null.<br />
 		bumpMapScale — Set bump map scale. Default is 1.<br />
 		normalMap — Set normal map. Default is null.<br />
-		normalMapScale — Set normal map scale. Default is (1, 1).<br />
+		normalScale — Set normal map scale. Default is (1, 1).<br />
 		displacementMap — Set displacement map. Default is null.<br />
 		displacementScale — Set displacement scale. Default is 1.<br />
 		displacementBias — Set displacement offset. Default is 0.<br />

+ 1 - 8
docs/api/materials/ShaderMaterial.html

@@ -22,6 +22,7 @@
 		<ul>
 			<li>A *ShaderMaterial* will only be rendered properly by [page:WebGLRenderer], since the GLSL code in the *vertexShader* and *fragmentShader* properties must be compiled and run on the GPU using WebGL.</li>
 			<li>As of THREE r72, directly assigning attributes in a *ShaderMaterial* is no longer supported. A [page:BufferGeometry] instance (instead of a [page:Geometry] instance) must be used instead, using [page:BufferAttribute] instances to define custom attributes.</li>
+			<li>As of THREE r77, [page:WebGLRenderTarget] or [page:WebGLRenderTargetCube] instances are no longer supposed to be used as uniforms. Their [page:Texture texture] property must be used instead.</li>
 		</ul>
 		</div>
 
@@ -261,18 +262,10 @@
 					<td>sampler2D</td>
 					<td>[page:Texture THREE.Texture]</td>
 				</tr>
-				<tr>
-					<td>sampler2D</td>
-					<td>[page:WebGLRenderTarget THREE.WebGLRenderTarget]</td>
-				</tr>
 				<tr>
 					<td>samplerCube</td>
 					<td>[page:CubeTexture THREE.CubeTexture]</tr>
 				</tr>
-				<tr>
-					<td>samplerCube</td>
-					<td>[page:WebGLRenderTargetCube THREE.WebGLRenderTargetCube]</td>
-				</tr>
 
 			</tbody>
 		</table>

+ 25 - 3
docs/api/math/Color.html

@@ -27,9 +27,31 @@
 		<h2>Constructor</h2>
 
 
-		<h3>[name]( value )</h3>
-		<div>
-		value — optional argument that sets initial color.  Can be a hexadecimal or a CSS-style string, for example, "rgb(250, 0,0)", "rgb(100%,0%,0%)", "hsl(0, 100%, 50%)", "#ff0000", "#f00", or "red", or three arguments that represent color channels.
+		<h3>[name]( r, g, b )</h3>
+		<div>
+		r - the red component of the color if arguments g and b are defined. If they are not defined, it can be a hexadecimal or a CSS-style string or a Color instance.<br />
+		g - The green component of the color if it is defined.<br />
+		b - The blue component of the color if it is defined. 
+		</div>
+		<div>
+		All arguments are optional. The default color is White.<br />
+		When all arguments are defined then r is the red component, g is the green component and b is the blue component of the color.<br />
+		When only r is defined:<br />
+		<ul>
+			<li>It can be a hexadecimal of the color.</li>
+			<li>It can be an another color instance.</li>
+			<li>It can be a CSS style. For Instance:
+				<ul>
+					<li>rgb(250, 0,0)</li>
+					<li>rgb(100%,0%,0%)</li>
+					<li>hsl(0, 100%, 50%)</li>
+					<li>#ff0000</li>
+					<li>#f00</li>
+					<li>red</li>
+				</ul>
+			
+			</li>
+		</ul>
 		</div>
 
 		<h2>Properties</h2>

+ 0 - 5
docs/api/math/Math.html

@@ -59,11 +59,6 @@
 		Random float from *- range / 2* to *range / 2* interval.
 		</div>
 
-		<h3>[method:Float sign]( [page:Float x] )</h3>
-		<div>
-		Returns -1 if *x* is less than 0, 1 if *x* is greater than 0, and 0 if *x* is zero.
-		</div>
-
 		<h3>[method:Float degToRad]([page:Float degrees])</h3>
 		<div>
 		degrees -- [page:Float]

+ 7 - 2
docs/api/math/Quaternion.html

@@ -107,9 +107,14 @@
 		Normalizes this quaternion.
 		</div>
 
-		<h3>[method:Quaternion multiply]( [page:Quaternion b] ) [page:Quaternion this]</h3>
+		<h3>[method:Quaternion multiply]( [page:Quaternion q] ) [page:Quaternion this]</h3>
 		<div>
-		Multiplies this quaternion by *b*.
+		Multiplies this quaternion by *q*.
+		</div>
+
+		<h3>[method:Quaternion premultiply]( [page:Quaternion q] ) [page:Quaternion this]</h3>
+		<div>
+		Pre-multiplies this quaternion by *q*.
 		</div>
 
 		<h3>[method:Quaternion multiplyQuaternions]( [page:Quaternion a], [page:Quaternion b] ) [page:Quaternion this]</h3>

+ 132 - 132
docs/api/objects/Skeleton.html

@@ -1,133 +1,133 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
+<!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">
-		Use an array of [page:Bone bones] to create a skeleton that can be used by a [page:SkinnedMesh].
-		WebGL only.
-		</div>
-
-		<h2>Example</h2>
-
-		<code>
-		// Create a simple "arm"
-		
-		var bones = [];
-		
-		var shoulder = new THREE.Bone();
-		var elbow = new THREE.Bone();
-		var hand = new THREE.Bone();
-		
-		shoulder.add( elbow );
-		elbow.add( hand );
-
-		bones.push( shoulder );
-		bones.push( elbow );
-		bones.push( hand );
-		
-		shoulder.position.y = -5;
-		elbow.position.y = 0;
-		hand.position.y = 5;
-		
-		var armSkeleton = THREE.Skeleton( bones );
-		
-		// See THREE.SkinnedMesh for an example of usage with a mesh
-		</code>
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]( [page:Array bones], [page:Array boneInverses], [page:Boolean useVertexTexture]  )</h3>
-		<div>
-		bones — The array of [page:bone bones]<br/>
-		boneInverses — (optional) An array of [page:Matrix4 Matrix4s]<br/>
-		useVertexTexture — (optional) Whether or not to use a vertex texture in the shader.
-		</div>
-		<div>
-		The constructor automatically sets up all of the properties below.
-		</div>
-
-
-		<h2>Properties</h2>
-		
-		<h3>[property:Array bones]</h3>
-		<div>
-		The array of [page:bone bones]
-		</div>
-		
-		
-		<h3>[property:Boolean useVertexTexture]</h3>
-		<div>
-		Whether or not to use a vertex texture in the shader, set in the constructor. Not all devices
-		support floating point pixel textures. If this option is set then the bone matrices will be packed into
-		a texture and sent to the shader. This method allows a much larger set of bones to be used. Otherwise
-		the vertex shader will use uniforms, which do not allow for as many bones to be used. The exact
-		numbers vary between devices.
-		</div>
-		
-		
-		<h3>[property:Array boneInverses]</h3>
-		<div>
-		An array of [page:Matrix4 Matrix4s] that represent the inverse of the matrixWorld of the individual bones.
-		</div>
-		
-		
-		<h3>[property:Integer boneTextureWidth]</h3>
-		<div>
-		The width of the vertex data texture.
-		</div>
-		
-		
-		<h3>[property:Integer boneTextureHeight]</h3>
-		<div>
-		The height of the vertex data texture.
-		</div>
-		
-		
-		<h3>[property:Float32Array boneMatrices]</h3>
-		<div>
-		The array buffer holding the bone data when using a vertex texture.
-		</div>
-		
-		
-		<h3>[property:DataTexture boneTexture]</h3>
-		<div>
-		The [page:DataTexture] holding the bone data when using a vertex texture.
-		</div>
-		
-
-		<h2>Methods</h2>
-
-		<h3>[method:null calculateInverses]()</h3>
-		<div>Generates the boneInverses.</div>
-		
-		
-		<h3>[method:null pose]()</h3>
-		<div>Returns the skeleton to the base pose.</div>
-		
-		
-		<h3>[method:null update]()</h3>
-		<div>
-		Updates the [page:Float32Array boneMatrices] and [page:DataTexture boneTexture] after changing the bones.
-		This is called automatically by the [page:WebGLRenderer] if the skeleton is used with a [page:SkinnedMesh].
-		</div>
-		
-		<h3>[method:Skeleton clone]()</h3>
-		<div>
-		Clone a Skeleton Object.
-		</div>
-		
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>
+		<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">
+		Use an array of [page:Bone bones] to create a skeleton that can be used by a [page:SkinnedMesh].
+		WebGL only.
+		</div>
+
+		<h2>Example</h2>
+
+		<code>
+		// Create a simple "arm"
+		
+		var bones = [];
+		
+		var shoulder = new THREE.Bone();
+		var elbow = new THREE.Bone();
+		var hand = new THREE.Bone();
+		
+		shoulder.add( elbow );
+		elbow.add( hand );
+
+		bones.push( shoulder );
+		bones.push( elbow );
+		bones.push( hand );
+		
+		shoulder.position.y = -5;
+		elbow.position.y = 0;
+		hand.position.y = 5;
+		
+		var armSkeleton = new THREE.Skeleton( bones );
+		
+		// See THREE.SkinnedMesh for an example of usage with a mesh
+		</code>
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( [page:Array bones], [page:Array boneInverses], [page:Boolean useVertexTexture]  )</h3>
+		<div>
+		bones — The array of [page:bone bones]<br/>
+		boneInverses — (optional) An array of [page:Matrix4 Matrix4s]<br/>
+		useVertexTexture — (optional) Whether or not to use a vertex texture in the shader.
+		</div>
+		<div>
+		The constructor automatically sets up all of the properties below.
+		</div>
+
+
+		<h2>Properties</h2>
+		
+		<h3>[property:Array bones]</h3>
+		<div>
+		The array of [page:bone bones]
+		</div>
+		
+		
+		<h3>[property:Boolean useVertexTexture]</h3>
+		<div>
+		Whether or not to use a vertex texture in the shader, set in the constructor. Not all devices
+		support floating point pixel textures. If this option is set then the bone matrices will be packed into
+		a texture and sent to the shader. This method allows a much larger set of bones to be used. Otherwise
+		the vertex shader will use uniforms, which do not allow for as many bones to be used. The exact
+		numbers vary between devices.
+		</div>
+		
+		
+		<h3>[property:Array boneInverses]</h3>
+		<div>
+		An array of [page:Matrix4 Matrix4s] that represent the inverse of the matrixWorld of the individual bones.
+		</div>
+		
+		
+		<h3>[property:Integer boneTextureWidth]</h3>
+		<div>
+		The width of the vertex data texture.
+		</div>
+		
+		
+		<h3>[property:Integer boneTextureHeight]</h3>
+		<div>
+		The height of the vertex data texture.
+		</div>
+		
+		
+		<h3>[property:Float32Array boneMatrices]</h3>
+		<div>
+		The array buffer holding the bone data when using a vertex texture.
+		</div>
+		
+		
+		<h3>[property:DataTexture boneTexture]</h3>
+		<div>
+		The [page:DataTexture] holding the bone data when using a vertex texture.
+		</div>
+		
+
+		<h2>Methods</h2>
+
+		<h3>[method:null calculateInverses]()</h3>
+		<div>Generates the boneInverses.</div>
+		
+		
+		<h3>[method:null pose]()</h3>
+		<div>Returns the skeleton to the base pose.</div>
+		
+		
+		<h3>[method:null update]()</h3>
+		<div>
+		Updates the [page:Float32Array boneMatrices] and [page:DataTexture boneTexture] after changing the bones.
+		This is called automatically by the [page:WebGLRenderer] if the skeleton is used with a [page:SkinnedMesh].
+		</div>
+		
+		<h3>[method:Skeleton clone]()</h3>
+		<div>
+		Clone a Skeleton Object.
+		</div>
+		
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 0
docs/api/renderers/CanvasRenderer.html

@@ -38,6 +38,7 @@
 			The "Canvas" in CanvasRenderer means it uses Canvas 2D instead of WebGL.<br /><br />
 
 			Don't confuse either CanvasRenderer with the SoftwareRenderer example, which simulates a screen buffer in a Javascript array.
+			Because the Canvas renderer is not part of the three.js core, you have to include it from /examples/js/renderers/.
 		</div>
 
 		<h2>Constructor</h2>

+ 49 - 38
docs/api/renderers/WebGLRenderTarget.html

@@ -17,90 +17,101 @@
 
 
 		<h3>[name]([page:Number width], [page:Number height], [page:Object options])</h3>
+
 		<div>
 		width -- The width of the renderTarget. <br />
-		height -- The height of the renderTarget. <br />
-		options -- The options sets the properties of the render target.
-		</div>
-		<div>
-		Creates a new renderTarget with a certain width and height.
+		height -- The height of the renderTarget.
 		</div>
 
-		<h2>Properties</h2>
+		<div>options is an optional object that holds texture parameters for an auto-generated target texture and depthBuffer/stencilBuffer booleans. For an explanation of the texture parameters see [page:Texture Texture].</div>
 
-		<h3>[property:number wrapS]</h3>
 		<div>
-		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
+		wrapS — [page:Number] default is *THREE.ClampToEdgeWrapping*. <br />
+		wrapT — [page:Number] default is *THREE.ClampToEdgeWrapping*. <br />
+		magFilter — [page:Number], default is *THREE.LinearFilter*. <br />
+		minFilter — [page:Number], default is *THREE.LinearFilter*. <br />
+		format — [page:Number], default is *THREE.RGBAFormat*. <br />
+		type — [page:Number], default is *THREE.UnsignedByteType*. <br />
+		anisotropy — [page:Number], default is *1*. <br />
+		encoding — [page:Number], default is *THREE.LinearEncoding*. <br />
+		depthBuffer — [page:Boolean], default is *true*. Set this to false if you don't need it. <br />
+		stencilBuffer — [page:Boolean], default is *true*. Set this to false if you don't need it.
 		</div>
 
-		<h3>[property:number wrapT]</h3>
 		<div>
-		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
+		Creates a new render target with a certain width and height.
 		</div>
-		
-		<h3>[property:number magFilter]</h3>
+
+		<h2>Properties</h2>
+
+		<h3>[property:number uuid]</h3>
 		<div>
-		How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.
+		A unique number for this render target instance.
 		</div>
 
-		<h3>[property:number minFilter]</h3>
+		<h3>[property:number width]</h3>
 		<div>
-		How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter, which uses mipmapping and a trilinear filter. Other choices are THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. These vary whether the nearest texel or nearest four texels are retrieved on the nearest mipmap or nearest two mipmaps. Interpolation occurs among the samples retrieved.
+		The width of the render target.
 		</div>
-		
-		<h3>[property:number anisotropy]</h3>
+
+		<h3>[property:number height]</h3>
 		<div>
-		The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
+		The height of the render target.
 		</div>
 		
-		<h3>[property:Vector2 repeat]</h3>
+		<h3>[property:Vector4 scissor]</h3>
 		<div>
-		How many times the texture is repeated across the surface, in each direction U and V.
+		A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
 		</div>
 
-		<h3>[property:Vector2 offset]</h3>
+		<h3>[property:boolean scissorTest]</h3>
 		<div>
-		How much a single repetition of the texture is offset from the beginning, in each direction U and V. Typical range is 0.0 to 1.0.
+		Indicates whether the scissor test is active or not.
 		</div>
-		
-		<h3>[property:number format]</h3>
+
+		<h3>[property:Vector4 viewport]</h3>
 		<div>
-		The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.
+		The viewport of this render target.
 		</div>
 
-		<h3>[property:number type]</h3>
+		<h3>[property:Texture texture]</h3>
 		<div>
-		The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.HalfFloatType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.
+		This texture instance holds the rendered pixels. Use it as input for further processing.
 		</div>
-		
+
 		<h3>[property:boolean depthBuffer]</h3>
 		<div>
 		Renders to the depth buffer. Default is true.
 		</div>
-		
+
 		<h3>[property:boolean stencilBuffer]</h3>
 		<div>
 		Renders to the stencil buffer. Default is true.
 		</div>
 
-		<h3>[property:boolean generateMipmaps]</h3>
+		<h3>[property:DepthTexture depthTexture]</h3>
 		<div>
-		Whether to generate mipmaps (if possible) for a texture. True by default.
+		If set, the scene depth will be rendered to this texture. Default is null.
 		</div>
 
-		
+
 		<h2>Methods</h2>
-		
+
 		<h3>[method:null setSize]( [page:Number width], [page:Number height] )</h3>
 		<div>
-		Sets the size of the renderTarget.
+		Sets the size of the render target.
 		</div>
-		
-		<h3>[method:RenderTarget clone]()</h3>
+
+		<h3>[method:WebGLRenderTarget clone]()</h3>
 		<div>
-		Creates a copy of the render target.
+		Creates a copy of this render target.
 		</div>
-		
+
+		<h3>[method:WebGLRenderTarget copy]( [page:WebGLRenderTarget source] )</h3>
+		<div>
+		Adopts the settings of the given render target.
+		</div>
+
 		<h3>[method:null dispose]()</h3>
 		<div>
 		Dispatches a dispose event.

+ 17 - 17
docs/api/renderers/WebGLRenderer.html

@@ -91,27 +91,27 @@
 
 		<div>Default is false.  If set, then it expects that all textures and colors need to be outputted in premultiplied gamma.</div>
 
+		<h3>[property:WebGLShadowMap shadowMap]</h3>
+		<div>
+		This contains the reference to the component implementing shadow mapping.
+		</div>
 
-		<h3>[property:Boolean shadowMapEnabled]</h3>
+		<h3>[property:Boolean shadowMap.enabled]</h3>
 
 		<div>Default is false. If set, use shadow maps in the scene.</div>
 
-
-		<h3>[property:Integer shadowMapType]</h3>
+		<h3>[property:Integer shadowMap.type]</h3>
 
 		<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
 		<div>Options are THREE.BasicShadowMap, THREE.PCFShadowMap, THREE.PCFSoftShadowMap. Default is THREE.PCFShadowMap.</div>
 
+		<h3>[property:Boolean shadowMap.renderReverseSided]</h3>
 
-		<h3>[property:Integer shadowMapCullFace]</h3>
-
-		<div>Default is THREE.CullFaceFront. The faces that needed to be culled. Possible values: THREE.CullFaceFront and THREE.CullFaceBack</div>
-
-
-		<h3>[property:Boolean shadowMapCascade]</h3>
+		<div>Default is true. Whether to render the opposite side as specified by the material into the shadow map. When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can both cast and receive shadows at the same time to render correctly.</div>
 
-		<div>Default is false. If Set, use cascaded shadowmaps. See [link:http://developer.download.nvidia.com/SDK/10.5/opengl/src/cascaded_shadow_maps/doc/cascaded_shadow_maps.pdf cascaded shadowmaps] for more information.</div>
+		<h3>[property:Boolean shadowMap.renderSingleSided]</h3>
 
+		<div>Default is true. Whether to treat materials specified as double-sided as if they were specified as front-sided when rendering the shadow map. When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can both cast and receive shadows at the same time to render correctly.</div>
 
 		<h3>[property:Integer maxMorphTargets]</h3>
 
@@ -152,12 +152,6 @@
 		</ul>
 		</div>
 
-		<h3>[property:WebGLShadowMap shadowMap]</h3>
-		<div>
-		This contains the reference to the component implementing shadow mapping.
-		</div>
-
-
 		<h2>Methods</h2>
 
 		<h3>[method:WebGLRenderingContext getContext]()</h3>
@@ -175,11 +169,17 @@
 		Return a [page:Boolean] true if the context supports vertex textures.
 		</div>
 
+		<h3>[method:number getPixelRatio]()</h3>
+		<div>Returns current device pixel ratio used.</div>
+
+		<h3>[method:null setPixelRatio]( [page:number value] )</h3>
+		<div>Sets device pixel ratio. This is usually used for HiDPI device to prevent bluring output canvas.</div>
+
 		<h3>[method:Object getSize]()</h3>
 		<div>Returns an object containing the width and height of the renderer's output canvas, in pixels.</div>
 
 		<h3>[method:null setSize]( [page:Integer width], [page:Integer height], [page:Boolean updateStyle] )</h3>
-		<div>Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0). Setting updateStyle to true adds explicit pixel units to the output canvas style.</div>
+		<div>Resizes the output canvas to (width, height) with device pixel ratio taken into account, and also sets the viewport to fit that size, starting in (0, 0). Setting updateStyle to true adds explicit pixel units to the output canvas style.</div>
 
 		<h3>[method:null setViewport]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
 		<div>Sets the viewport to render from (x, y) to (x + width, y + height).</div>

+ 0 - 39
docs/api/renderers/webgl/plugins/ShadowMapPlugin.html

@@ -1,39 +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 Webglrenderer plugin class that allows shadowmaps to be rendered in the WebglRenderer. This plugin is automatically loaded in the Webglrenderer.</div>
-
-
-		<h2>Constructor</h2>
-
-		<h3>[name]()</h3>
-		<div>
-		Creates a new [name].
-		</div>
-
-
-		<h2>Methods</h2>
-
-		<h3>[method:null render]([page:Scene scene], [page:Camera camera])</h3>
-		<div>
-		scene -- The scene to render. <br />
-		camera -- The camera to render.
-		</div>
-		<div>
-		Prepares the shadowmaps to be rendered defined in the scene. This gets automatically called as pre render function to draw the lensflares.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

+ 159 - 159
docs/api/textures/Texture.html

@@ -1,160 +1,160 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
+<!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">Create a texture to apply to a surface or as a reflection or refraction map.</div>
-
-
-		<h2>Constructor</h2>
-
-		<h3>[name]( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy )</h3>
-
-		<h2>Example</h2>
-
-		<code>
-		// load a texture, set wrap mode to repeat
-		var texture = new THREE.TextureLoader().load( "textures/water.jpg" );
-		texture.wrapS = THREE.RepeatWrapping;
-		texture.wrapT = THREE.RepeatWrapping;
-		texture.repeat.set( 4, 4 );
-		</code>
-
-		<h2>Properties</h2>
-
-		<h3>[property:Integer id]</h3>
-		<div>
-		Unique number for this texture instance.
-		</div>
-
-		<h3>[property:Image image]</h3>
-		<div>
-		An Image object, typically created using the ImageUtils or [page:ImageLoader ImageLoader] classes. The Image object can include an image (e.g., PNG, JPG, GIF, DDS), video (e.g., MP4, OGG/OGV), or set of six images for a cube map. To use video as a texture you need to have a playing HTML5 video element as a source for your texture image and continuously update this texture as long as video is playing.
-		</div>
-
-		<h3>[property:object mapping]</h3>
-		<div>
-		How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.
-		</div>
-
-		<h3>[property:number wrapS]</h3>
-		<div>
-		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
-		</div>
-
-		<h3>[property:number wrapT]</h3>
-		<div>
-		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
-		</div>
-
-		<div>
-		NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL, not Three.js.
-		</div>
-
-		<h3>[property:number magFilter]</h3>
-		<div>
-		How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.
-		</div>
-
-		<h3>[property:number minFilter]</h3>
-		<div>
-		How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter, which uses mipmapping and a trilinear filter. Other choices are THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. These vary whether the nearest texel or nearest four texels are retrieved on the nearest mipmap or nearest two mipmaps. Interpolation occurs among the samples retrieved.
-		</div>
-
-		<h3>[property:number format]</h3>
-		<div>
-		The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.
-		</div>
-
-		<h3>[property:number type]</h3>
-		<div>
-		The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.
-		</div>
-
-		<h3>[property:number anisotropy]</h3>
-		<div>
-		The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
-		</div>
-
-		<h3>[property:boolean needsUpdate]</h3>
-		<div>
-		If a texture is changed after creation, set this flag to true so that the texture is properly set up. Particularly important for setting the wrap mode.
-		</div>
-
-		<h3>[property:Vector2 repeat]</h3>
-		<div>
-		How many times the texture is repeated across the surface, in each direction U and V.
-		</div>
-
-		<h3>[property:Vector2 offset]</h3>
-		<div>
-		How much a single repetition of the texture is offset from the beginning, in each direction U and V. Typical range is 0.0 to 1.0.
-		</div>
-
-		<h3>[property:string name]</h3>
-		<div>
-		Given name of the texture, empty string by default.
-		</div>
-
-		<h3>[property:boolean generateMipmaps]</h3>
-		<div>
-		Whether to generate mipmaps (if possible) for a texture. True by default.
-		</div>
-
-		<h3>[property:boolean flipY]</h3>
-		<div>
-		True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
-		</div>
-
-		<h3>[property:array mipmaps]</h3>
-		<div>
-		Array of mipmaps generated.
-		</div>
-
-		<h3>[property:number unpackAlignment]</h3>
-		<div>
-		4 by default. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). See <a href="http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml">glPixelStorei</a> for more information.
-		</div>
-
-		<h3>[property:boolean premultiplyAlpha]</h3>
-		<div>
-		False by default, which is the norm for PNG images. Set to true if the RGB values have been stored premultiplied by alpha.
-		</div>
-
-		<h3>[property:number encoding]</h3>
-		<div>
-		Set to THREE.LinearEncoding by default, but supports sRGB, RGBE, RGBM, RGBD, LogLuv and Gamma corrected encodings.  IMPORTANT: If this value is changed on a texture after the material has been used, it is necessary to trigger a Material.needsUpdate for this value to be realized in the shader.
-		</div>
-
-		<h3>[property:object onUpdate]</h3>
-		<div>
-		A callback function, called when the texture is updated (e.g., when needsUpdate has been set to true and then the texture is used).
-		</div>
-
-
-		<h2>Methods</h2>
-
-		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
-
-		<h3>.clone([page:Texture texture])</h3>
-		<div>
-		Make copy of texture. Note this is not a "deep copy", the image is shared.
-		</div>
-
-		<h3>.dispose()</h3>
-		<div>
-		Call [page:EventDispatcher EventDispatcher].dispatchEvent with a 'dispose' event type.
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>
+		<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">Create a texture to apply to a surface or as a reflection or refraction map.</div>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy )</h3>
+
+		<h2>Example</h2>
+
+		<code>
+		// load a texture, set wrap mode to repeat
+		var texture = new THREE.TextureLoader().load( "textures/water.jpg" );
+		texture.wrapS = THREE.RepeatWrapping;
+		texture.wrapT = THREE.RepeatWrapping;
+		texture.repeat.set( 4, 4 );
+		</code>
+
+		<h2>Properties</h2>
+
+		<h3>[property:Integer id]</h3>
+		<div>
+		Unique number for this texture instance.
+		</div>
+
+		<h3>[property:Image image]</h3>
+		<div>
+		An Image object, typically created using the ImageUtils or [page:ImageLoader ImageLoader] classes. The Image object can include an image (e.g., PNG, JPG, GIF, DDS), video (e.g., MP4, OGG/OGV), or set of six images for a cube map. To use video as a texture you need to have a playing HTML5 video element as a source for your texture image and continuously update this texture as long as video is playing.
+		</div>
+
+		<h3>[property:object mapping]</h3>
+		<div>
+		How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.
+		</div>
+
+		<h3>[property:number wrapS]</h3>
+		<div>
+		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
+		</div>
+
+		<h3>[property:number wrapT]</h3>
+		<div>
+		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
+		</div>
+
+		<div>
+		NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL, not Three.js.
+		</div>
+
+		<h3>[property:number magFilter]</h3>
+		<div>
+		How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.
+		</div>
+
+		<h3>[property:number minFilter]</h3>
+		<div>
+		How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter, which uses mipmapping and a trilinear filter. Other choices are THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. These vary whether the nearest texel or nearest four texels are retrieved on the nearest mipmap or nearest two mipmaps. Interpolation occurs among the samples retrieved.
+		</div>
+
+		<h3>[property:number format]</h3>
+		<div>
+		The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.
+		</div>
+
+		<h3>[property:number type]</h3>
+		<div>
+		The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.
+		</div>
+
+		<h3>[property:number anisotropy]</h3>
+		<div>
+		The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
+		</div>
+
+		<h3>[property:boolean needsUpdate]</h3>
+		<div>
+		If a texture is changed after creation, set this flag to true so that the texture is properly set up. Particularly important for setting the wrap mode.
+		</div>
+
+		<h3>[property:Vector2 repeat]</h3>
+		<div>
+		How many times the texture is repeated across the surface, in each direction U and V.
+		</div>
+
+		<h3>[property:Vector2 offset]</h3>
+		<div>
+		How much a single repetition of the texture is offset from the beginning, in each direction U and V. Typical range is 0.0 to 1.0.
+		</div>
+
+		<h3>[property:string name]</h3>
+		<div>
+		Given name of the texture, empty string by default.
+		</div>
+
+		<h3>[property:boolean generateMipmaps]</h3>
+		<div>
+		Whether to generate mipmaps (if possible) for a texture. True by default.
+		</div>
+
+		<h3>[property:boolean flipY]</h3>
+		<div>
+		True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
+		</div>
+
+		<h3>[property:array mipmaps]</h3>
+		<div>
+		Array of user-specified mipmaps (optional).
+		</div>
+
+		<h3>[property:number unpackAlignment]</h3>
+		<div>
+		4 by default. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). See <a href="http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml">glPixelStorei</a> for more information.
+		</div>
+
+		<h3>[property:boolean premultiplyAlpha]</h3>
+		<div>
+		False by default, which is the norm for PNG images. Set to true if the RGB values have been stored premultiplied by alpha.
+		</div>
+
+		<h3>[property:number encoding]</h3>
+		<div>
+		Set to THREE.LinearEncoding by default, but supports sRGB, RGBE, RGBM, RGBD, LogLuv and Gamma corrected encodings.  IMPORTANT: If this value is changed on a texture after the material has been used, it is necessary to trigger a Material.needsUpdate for this value to be realized in the shader.
+		</div>
+
+		<h3>[property:object onUpdate]</h3>
+		<div>
+		A callback function, called when the texture is updated (e.g., when needsUpdate has been set to true and then the texture is used).
+		</div>
+
+
+		<h2>Methods</h2>
+
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
+
+		<h3>.clone([page:Texture texture])</h3>
+		<div>
+		Make copy of texture. Note this is not a "deep copy", the image is shared.
+		</div>
+
+		<h3>.dispose()</h3>
+		<div>
+		Call [page:EventDispatcher EventDispatcher].dispatchEvent with a 'dispose' event type.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 1
docs/list.js

@@ -143,7 +143,6 @@ var list = {
 
 		"Renderers / WebGL / Plugins": [
 			[ "LensFlarePlugin", "api/renderers/webgl/plugins/LensFlarePlugin" ],
-			[ "ShadowMapPlugin", "api/renderers/webgl/plugins/ShadowMapPlugin" ],
 			[ "SpritePlugin", "api/renderers/webgl/plugins/SpritePlugin" ]
 		],
 
@@ -199,6 +198,8 @@ var list = {
 			[ "CircleGeometry", "api/extras/geometries/CircleGeometry" ],
 			[ "CylinderBufferGeometry", "api/extras/geometries/CylinderBufferGeometry" ],
 			[ "CylinderGeometry", "api/extras/geometries/CylinderGeometry" ],
+			[ "ConeBufferGeometry", "api/extras/geometries/ConeBufferGeometry" ],
+			[ "ConeGeometry", "api/extras/geometries/ConeGeometry" ],
 			[ "DodecahedronGeometry", "api/extras/geometries/DodecahedronGeometry" ],
 			[ "ExtrudeGeometry", "api/extras/geometries/ExtrudeGeometry" ],
 			[ "IcosahedronGeometry", "api/extras/geometries/IcosahedronGeometry" ],

+ 90 - 3
docs/scenes/js/geometry.js

@@ -193,8 +193,8 @@ var guis = {
 
 		var folder = gui.addFolder( 'THREE.CylinderBufferGeometry' );
 
-		folder.add( data, 'radiusTop', 1, 30 ).onChange( generateGeometry );
-		folder.add( data, 'radiusBottom', 1, 30 ).onChange( generateGeometry );
+		folder.add( data, 'radiusTop', 0, 30 ).onChange( generateGeometry );
+		folder.add( data, 'radiusBottom', 0, 30 ).onChange( generateGeometry );
 		folder.add( data, 'height', 1, 50 ).onChange( generateGeometry );
 		folder.add( data, 'radiusSegments', 3, 64 ).step( 1 ).onChange( generateGeometry );
 		folder.add( data, 'heightSegments', 1, 64 ).step( 1 ).onChange( generateGeometry );
@@ -253,6 +253,93 @@ var guis = {
 
 	},
 
+	ConeBufferGeometry : function( mesh ) {
+
+		var data = {
+			radius : 5,
+			height : 10,
+			radiusSegments : 8,
+			heightSegments : 1,
+			openEnded : false,
+			thetaStart : 0,
+			thetaLength : twoPi,
+		};
+
+		function generateGeometry() {
+
+			updateGroupGeometry( mesh,
+				new THREE.ConeBufferGeometry(
+					data.radius,
+					data.height,
+					data.radiusSegments,
+					data.heightSegments,
+					data.openEnded,
+					data.thetaStart,
+					data.thetaLength
+				)
+			);
+
+		}
+
+		var folder = gui.addFolder( 'THREE.ConeBufferGeometry' );
+
+		folder.add( data, 'radius', 0, 30 ).onChange( generateGeometry );
+		folder.add( data, 'height', 1, 50 ).onChange( generateGeometry );
+		folder.add( data, 'radiusSegments', 3, 64 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightSegments', 1, 64 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'openEnded' ).onChange( generateGeometry );
+		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
+		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
+
+
+		generateGeometry();
+
+	},
+
+	ConeGeometry : function( mesh ) {
+
+		var data = {
+			radius : 5,
+			height : 10,
+			radiusSegments : 8,
+			heightSegments : 1,
+			openEnded : false,
+			thetaStart : 0,
+			thetaLength : twoPi,
+		};
+
+		function generateGeometry() {
+
+			updateGroupGeometry( mesh,
+				new THREE.ConeGeometry(
+					data.radius,
+					data.height,
+					data.radiusSegments,
+					data.heightSegments,
+					data.openEnded,
+					data.thetaStart,
+					data.thetaLength
+				)
+			);
+
+		}
+
+		var folder = gui.addFolder( 'THREE.ConeGeometry' );
+
+		folder.add( data, 'radius', 0, 30 ).onChange( generateGeometry );
+		folder.add( data, 'height', 1, 50 ).onChange( generateGeometry );
+		folder.add( data, 'radiusSegments', 3, 64 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'heightSegments', 1, 64 ).step( 1 ).onChange( generateGeometry );
+		folder.add( data, 'openEnded' ).onChange( generateGeometry );
+		folder.add( data, 'thetaStart', 0, twoPi ).onChange( generateGeometry );
+		folder.add( data, 'thetaLength', 0, twoPi ).onChange( generateGeometry );
+
+
+		generateGeometry();
+
+	},
+
+
 	CircleBufferGeometry : function( mesh ) {
 
 		var data = {
@@ -717,7 +804,7 @@ var guis = {
 		function generateGeometry() {
 
 			var loader = new THREE.FontLoader();
-			loader.load( '../../examples/fonts/' + data.font + '_' + data.weight + '.typeface.js', function ( font ) {
+			loader.load( '../../examples/fonts/' + data.font + '_' + data.weight + '.typeface.json', function ( font ) {
 
 				var geometry = new THREE.TextGeometry( data.text, {
 					font: font,

+ 39 - 36
editor/examples/particles.app.json

@@ -1,54 +1,56 @@
 {
+	"metadata": {
+		"type": "App"
+	},
+	"project": {
+		"shadows": true,
+		"editable": true,
+		"vr": false
+	},
 	"camera": {
 		"metadata": {
-			"version": 4.3,
+			"version": 4.4,
 			"type": "Object",
-			"generator": "ObjectExporter"
+			"generator": "Object3D.toJSON"
 		},
 		"object": {
-			"uuid": "D722B468-8D40-4CAB-82D6-944D2D5A8D35",
+			"uuid": "763F3000-7D7C-4BE6-80B6-914DEEBD9AA2",
 			"type": "PerspectiveCamera",
 			"name": "Camera",
+			"matrix": [0.7071067690849304,-3.398992198810902e-11,-0.7071068286895752,0,-0.2357022613286972,0.9428090453147888,-0.235702246427536,0,0.6666666865348816,0.3333333134651184,0.6666666269302368,0,41.824005126953125,20.912002563476562,41.824005126953125,1],
 			"fov": 50,
-			"aspect": 1.2237762237762237,
+			"zoom": 1,
 			"near": 0.1,
 			"far": 100000,
-			"matrix": [0.7071067690849304,-2.468905080377226e-9,-0.7071068286895752,0,-0.2357022613286972,0.9428090453147888,-0.235702246427536,0,0.6666666865348816,0.3333333134651184,0.6666666269302368,0,500,250,500,1]
+			"focus": 10,
+			"aspect": 0.46657381615598886,
+			"filmGauge": 35,
+			"filmOffset": 0
 		}
 	},
 	"scene": {
 		"metadata": {
-			"version": 4.3,
+			"version": 4.4,
 			"type": "Object",
-			"generator": "ObjectExporter"
+			"generator": "Object3D.toJSON"
 		},
 		"geometries": [
 			{
-				"uuid": "5009F17C-E9D3-4D0E-82A6-2E23159128FB",
+				"uuid": "E80D9EC5-D722-4812-8226-5F355EAC9B96",
 				"type": "PlaneGeometry",
-				"width": 600,
-				"height": 600,
+				"width": 1000,
+				"height": 1000,
 				"widthSegments": 1,
 				"heightSegments": 1
-			},
-			{
-				"uuid": "8693E7B2-0009-4C4C-94C5-8E031557AEC2",
-				"type": "BoxGeometry",
-				"width": 4,
-				"height": 4,
-				"depth": 4,
-				"widthSegments": 1,
-				"heightSegments": 1,
-				"depthSegments": 1
 			}],
 		"materials": [
 			{
-				"uuid": "6EDB0369-7E11-4B0F-BF98-4BD761846D65",
-				"type": "MeshPhongMaterial",
-				"color": 16777215,
-				"emissive": 0,
-				"specular": 1118481,
-				"shininess": 30
+				"uuid": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A",
+				"type": "MeshStandardMaterial",
+				"color": 5465019,
+				"roughness": 1,
+				"metalness": 0,
+				"emissive": 0
 			},
 			{
 				"uuid": "F5361474-F5F1-412F-8D99-3699B868092D",
@@ -65,33 +67,34 @@
 					"uuid": "05B57416-1BE5-4A96-BB05-9D9CD112D52B",
 					"type": "Mesh",
 					"name": "Ground",
-					"geometry": "5009F17C-E9D3-4D0E-82A6-2E23159128FB",
-					"material": "6EDB0369-7E11-4B0F-BF98-4BD761846D65",
-					"matrix": [1,0,0,0,0,0.0007962886593304574,-0.9999997019767761,0,0,0.9999997019767761,0.0007962886593304574,0,0,-2,0,1]
+					"matrix": [1,0,0,0,0,0.0007959486683830619,-0.9999997019767761,0,0,0.9999997019767761,0.0007959486683830619,0,0,-0.5,0,1],
+					"geometry": "E80D9EC5-D722-4812-8226-5F355EAC9B96",
+					"material": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A"
 				},
 				{
 					"uuid": "0A3CB873-07E6-4EEB-830B-68192504111B",
 					"type": "Sprite",
 					"name": "Particle",
-					"material": "F5361474-F5F1-412F-8D99-3699B868092D",
-					"matrix": [3,0,0,0,0,3,0,0,0,0,1,0,0,0,0,1]
+					"matrix": [0.4000000059604645,0,0,0,0,0.4000000059604645,0,0,0,0,0.4000000059604645,0,0,0,0,1],
+					"material": "F5361474-F5F1-412F-8D99-3699B868092D"
 				},
 				{
 					"uuid": "40E5CDA4-0E39-4265-9293-3E9EC3207F61",
 					"type": "PointLight",
 					"name": "PointLight",
+					"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,11.828879356384277,0,1],
 					"color": 16777215,
-					"intensity": 10,
+					"intensity": 1,
 					"distance": 0,
-					"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
+					"decay": 1
 				}]
 		}
 	},
 	"scripts": {
 		"3741222A-BD8F-401C-A5D2-5A907E891896": [
 			{
-				"name": "Particle Fountain",
-				"source": "var original = this.getObjectByName( 'Particle' );\n\nvar particles = [];\n\nfunction update( event ) {\n\n\tif ( particles.length < 200 ) {\n\n\t\tvar velocity = new THREE.Vector3();\n\t\tvelocity.x = Math.random() * 10 - 5;\n\t\tvelocity.y = Math.random() * 10 + 10;\n\t\tvelocity.z = Math.random() * 10 - 5;\n\n\t\tvar particle = original.clone();\n\t\tparticle.userData.velocity = velocity;\n\t\tparticles.push( particle );\n\n\t\tthis.add( particle );\n\n\t}\n\n\tfor ( var i = 0; i < particles.length; i ++ ) {\n\n\t\tvar particle = particles[ i ];\n\n\t\tvar velocity = particle.userData.velocity;\n\n\t\tvelocity.y -= 0.98;\n\n\t\tparticle.position.add( velocity );\n\n\t\tif ( particle.position.y < 0 ) {\n\n\t\t\tparticle.position.y = 0;\n\n\t\t\tvelocity.y = - velocity.y;\n\t\t\tvelocity.multiplyScalar( 0.6 );\n\n\t\t}\n\n\t}\n\n}"
+				"name": "Fountain",
+				"source": "var original = this.getObjectByName( 'Particle' );\n\nvar particles = [];\n\nfor ( var i = 0; i < 100; i ++ ) {\n\n\tvar particle = original.clone();\n\tparticle.userData.velocity = new THREE.Vector3();\n\tthis.add( particle );\n\n\tparticles.push( particle );\n\n}\n\nfunction update( event ) {\n\t\n\tvar particle = particles.shift();\n\tparticles.push( particle );\n\t\t\n\tvar velocity = particle.userData.velocity;\n\tvelocity.x = Math.random() - 0.5;\n\tvelocity.y = Math.random() + 1;\n\tvelocity.z = Math.random() - 0.5;\n\n\tfor ( var i = 0; i < particles.length; i ++ ) {\n\n\t\tvar particle = particles[ i ];\n\n\t\tvar velocity = particle.userData.velocity;\n\n\t\tvelocity.y -= 0.098;\n\n\t\tparticle.position.add( velocity );\n\n\t\tif ( particle.position.y < 0 ) {\n\n\t\t\tparticle.position.y = 0;\n\n\t\t\tvelocity.y = - velocity.y;\n\t\t\tvelocity.multiplyScalar( 0.6 );\n\n\t\t}\n\n\t}\n\n}"
 			}]
 	}
-}
+}

+ 2 - 3
editor/index.html

@@ -61,14 +61,13 @@
 		<link rel="stylesheet" href="js/libs/codemirror/codemirror.css">
 		<link rel="stylesheet" href="js/libs/codemirror/theme/monokai.css">
 		<script src="js/libs/codemirror/codemirror.js"></script>
-
 		<script src="js/libs/codemirror/mode/javascript.js"></script>
+		<script src="js/libs/codemirror/mode/glsl.js"></script>
+
 		<script src="js/libs/esprima.js"></script>
 		<script src="js/libs/jsonlint.js"></script>
 		<script src="js/libs/glslprep.min.js"></script>
 
-		<script src="js/libs/codemirror/mode/glsl.js"></script>
-
 		<link rel="stylesheet" href="js/libs/codemirror/addon/dialog.css">
 		<link rel="stylesheet" href="js/libs/codemirror/addon/show-hint.css">
 		<link rel="stylesheet" href="js/libs/codemirror/addon/tern.css">

+ 1 - 3
editor/js/Config.js

@@ -2,9 +2,7 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-var Config = function () {
-
-	var name = 'threejs-editor';
+var Config = function ( name ) {
 
 	var storage = {
 		'autosave': true,

+ 37 - 37
editor/js/Editor.js

@@ -4,77 +4,77 @@
 
 var Editor = function () {
 
-	var SIGNALS = signals;
-
 	this.DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.1, 10000 );
 	this.DEFAULT_CAMERA.name = 'Camera';
 	this.DEFAULT_CAMERA.position.set( 20, 10, 20 );
 	this.DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
 
+	var Signal = signals.Signal;
+
 	this.signals = {
 
 		// script
 
-		editScript: new SIGNALS.Signal(),
+		editScript: new Signal(),
 
 		// player
 
-		startPlayer: new SIGNALS.Signal(),
-		stopPlayer: new SIGNALS.Signal(),
+		startPlayer: new Signal(),
+		stopPlayer: new Signal(),
 
 		// actions
 
-		showModal: new SIGNALS.Signal(),
+		showModal: new Signal(),
 
 		// notifications
 
-		editorCleared: new SIGNALS.Signal(),
+		editorCleared: new Signal(),
 
-		savingStarted: new SIGNALS.Signal(),
-		savingFinished: new SIGNALS.Signal(),
+		savingStarted: new Signal(),
+		savingFinished: new Signal(),
 
-		themeChanged: new SIGNALS.Signal(),
+		themeChanged: new Signal(),
 
-		transformModeChanged: new SIGNALS.Signal(),
-		snapChanged: new SIGNALS.Signal(),
-		spaceChanged: new SIGNALS.Signal(),
-		rendererChanged: new SIGNALS.Signal(),
+		transformModeChanged: new Signal(),
+		snapChanged: new Signal(),
+		spaceChanged: new Signal(),
+		rendererChanged: new Signal(),
 
-		sceneGraphChanged: new SIGNALS.Signal(),
+		sceneGraphChanged: new Signal(),
 
-		cameraChanged: new SIGNALS.Signal(),
+		cameraChanged: new Signal(),
 
-		geometryChanged: new SIGNALS.Signal(),
+		geometryChanged: new Signal(),
 
-		objectSelected: new SIGNALS.Signal(),
-		objectFocused: new SIGNALS.Signal(),
+		objectSelected: new Signal(),
+		objectFocused: new Signal(),
 
-		objectAdded: new SIGNALS.Signal(),
-		objectChanged: new SIGNALS.Signal(),
-		objectRemoved: new SIGNALS.Signal(),
+		objectAdded: new Signal(),
+		objectChanged: new Signal(),
+		objectRemoved: new Signal(),
 
-		helperAdded: new SIGNALS.Signal(),
-		helperRemoved: new SIGNALS.Signal(),
+		helperAdded: new Signal(),
+		helperRemoved: new Signal(),
 
-		materialChanged: new SIGNALS.Signal(),
+		materialChanged: new Signal(),
 
-		scriptAdded: new SIGNALS.Signal(),
-		scriptChanged: new SIGNALS.Signal(),
-		scriptRemoved: new SIGNALS.Signal(),
+		scriptAdded: new Signal(),
+		scriptChanged: new Signal(),
+		scriptRemoved: new Signal(),
 
-		fogTypeChanged: new SIGNALS.Signal(),
-		fogColorChanged: new SIGNALS.Signal(),
-		fogParametersChanged: new SIGNALS.Signal(),
-		windowResize: new SIGNALS.Signal(),
+		fogTypeChanged: new Signal(),
+		fogColorChanged: new Signal(),
+		fogParametersChanged: new Signal(),
+		windowResize: new Signal(),
 
-		showGridChanged: new SIGNALS.Signal(),
-		refreshSidebarObject3D: new SIGNALS.Signal(),
-		historyChanged: new SIGNALS.Signal(),
-		refreshScriptEditor: new SIGNALS.Signal()
+		showGridChanged: new Signal(),
+		refreshSidebarObject3D: new Signal(),
+		historyChanged: new Signal(),
+		refreshScriptEditor: new Signal()
 
 	};
 
-	this.config = new Config();
+	this.config = new Config( 'threejs-editor' );
 	this.history = new History( this );
 	this.storage = new Storage();
 	this.loader = new Loader( this );

+ 8 - 8
editor/js/Menubar.Add.js

@@ -56,7 +56,7 @@ Menubar.Add = function ( editor ) {
 	option.setTextContent( 'Plane' );
 	option.onClick( function () {
 
-		var geometry = new THREE.PlaneGeometry( 2, 2 );
+		var geometry = new THREE.PlaneBufferGeometry( 2, 2 );
 		var material = new THREE.MeshStandardMaterial();
 		var mesh = new THREE.Mesh( geometry, material );
 		mesh.name = 'Plane ' + ( ++ meshCount );
@@ -73,7 +73,7 @@ Menubar.Add = function ( editor ) {
 	option.setTextContent( 'Box' );
 	option.onClick( function () {
 
-		var geometry = new THREE.BoxGeometry( 1, 1, 1 );
+		var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
 		mesh.name = 'Box ' + ( ++ meshCount );
 
@@ -92,7 +92,7 @@ Menubar.Add = function ( editor ) {
 		var radius = 1;
 		var segments = 32;
 
-		var geometry = new THREE.CircleGeometry( radius, segments );
+		var geometry = new THREE.CircleBufferGeometry( radius, segments );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
 		mesh.name = 'Circle ' + ( ++ meshCount );
 
@@ -115,7 +115,7 @@ Menubar.Add = function ( editor ) {
 		var heightSegments = 1;
 		var openEnded = false;
 
-		var geometry = new THREE.CylinderGeometry( radiusTop, radiusBottom, height, radiusSegments, heightSegments, openEnded );
+		var geometry = new THREE.CylinderBufferGeometry( radiusTop, radiusBottom, height, radiusSegments, heightSegments, openEnded );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
 		mesh.name = 'Cylinder ' + ( ++ meshCount );
 
@@ -139,7 +139,7 @@ Menubar.Add = function ( editor ) {
 		var thetaStart = 0;
 		var thetaLength = Math.PI;
 
-		var geometry = new THREE.SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
+		var geometry = new THREE.SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
 		mesh.name = 'Sphere ' + ( ++ meshCount );
 
@@ -180,7 +180,7 @@ Menubar.Add = function ( editor ) {
 		var tubularSegments = 12;
 		var arc = Math.PI * 2;
 
-		var geometry = new THREE.TorusGeometry( radius, tube, radialSegments, tubularSegments, arc );
+		var geometry = new THREE.TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
 		mesh.name = 'Torus ' + ( ++ meshCount );
 
@@ -203,7 +203,7 @@ Menubar.Add = function ( editor ) {
 		var p = 2;
 		var q = 3;
 
-		var geometry = new THREE.TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q );
+		var geometry = new THREE.TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
 		mesh.name = 'TorusKnot ' + ( ++ meshCount );
 
@@ -265,7 +265,7 @@ Menubar.Add = function ( editor ) {
 		var phiStart = 0;
 		var phiLength = 2 * Math.PI;
 
-		var geometry = new THREE.LatheGeometry( points, segments, phiStart, phiLength );
+		var geometry = new THREE.LatheBufferGeometry( points, segments, phiStart, phiLength );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial( { side: THREE.DoubleSide } ) );
 		mesh.name = 'Lathe ' + ( ++ meshCount );
 

+ 2 - 0
editor/js/Script.js

@@ -71,6 +71,8 @@ var Script = function ( editor ) {
 	codemirror.setOption( 'theme', 'monokai' );
 	codemirror.on( 'change', function () {
 
+		if ( codemirror.state.focused === false ) return;
+
 		clearTimeout( delay );
 		delay = setTimeout( function () {
 

+ 7 - 4
editor/js/Sidebar.Geometry.BoxGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// width
 
@@ -65,7 +66,7 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) {
 	var depthSegmentsRow = new UI.Row();
 	var depthSegments = new UI.Integer( parameters.depthSegments ).setRange( 1, Infinity ).onChange( update );
 
-	depthSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
+	depthSegmentsRow.add( new UI.Text( 'Depth segments' ).setWidth( '90px' ) );
 	depthSegmentsRow.add( depthSegments );
 
 	container.add( depthSegmentsRow );
@@ -74,7 +75,7 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.BoxGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			width.getValue(),
 			height.getValue(),
 			depth.getValue(),
@@ -87,4 +88,6 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.BoxBufferGeometry = Sidebar.Geometry.BoxGeometry;

+ 2 - 1
editor/js/Sidebar.Geometry.BufferGeometry.js

@@ -10,7 +10,8 @@ Sidebar.Geometry.BufferGeometry = function ( editor ) {
 
 	function update( object ) {
 
-		if ( object === null ) return;
+		if ( object === null ) return; // objectSelected.dispatch( null )
+		if ( object === undefined ) return;
 
 		var geometry = object.geometry;
 

+ 6 - 3
editor/js/Sidebar.Geometry.CircleGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.CircleGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// radius
 
@@ -54,7 +55,7 @@ Sidebar.Geometry.CircleGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.CircleGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			radius.getValue(),
 			segments.getValue(),
 			thetaStart.getValue(),
@@ -65,4 +66,6 @@ Sidebar.Geometry.CircleGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.CircleBufferGeometry = Sidebar.Geometry.CircleGeometry;

+ 6 - 3
editor/js/Sidebar.Geometry.CylinderGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.CylinderGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// radiusTop
 
@@ -74,7 +75,7 @@ Sidebar.Geometry.CylinderGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.CylinderGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			radiusTop.getValue(),
 			radiusBottom.getValue(),
 			height.getValue(),
@@ -87,4 +88,6 @@ Sidebar.Geometry.CylinderGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.CylinderBufferGeometry = Sidebar.Geometry.CylinderGeometry;

+ 5 - 4
editor/js/Sidebar.Geometry.Geometry.js

@@ -30,9 +30,10 @@ Sidebar.Geometry.Geometry = function ( editor ) {
 
 	//
 
-	var update = function ( object ) {
+	function update( object ) {
 
-		if ( object === null ) return;
+		if ( object === null ) return; // objectSelected.dispatch( null )
+		if ( object === undefined ) return;
 
 		var geometry = object.geometry;
 
@@ -49,11 +50,11 @@ Sidebar.Geometry.Geometry = function ( editor ) {
 
 		}
 
-	};
+	}
 
 	signals.objectSelected.add( update );
 	signals.geometryChanged.add( update );
 
 	return container;
 
-}
+};

+ 6 - 3
editor/js/Sidebar.Geometry.IcosahedronGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// radius
 
@@ -35,7 +36,7 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.IcosahedronGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			radius.getValue(),
 			detail.getValue()
 		) ) );
@@ -46,4 +47,6 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.IcosahedronBufferGeometry = Sidebar.Geometry.IcosahedronGeometry;

+ 6 - 5
editor/js/Sidebar.Geometry.LatheGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.LatheGeometry = function( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// segments
 
@@ -133,17 +134,17 @@ Sidebar.Geometry.LatheGeometry = function( editor, object ) {
 
 		}
 
-		var geometry = new THREE.LatheGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			points,
 			segments.getValue(),
 			phiStart.getValue() / 180 * Math.PI,
 			phiLength.getValue() / 180 * Math.PI
-		);
-
-		editor.execute( new SetGeometryCommand( object, geometry ) );
+		) ) );
 
 	}
 
 	return container;
 
 };
+
+Sidebar.Geometry.LatheBufferGeometry = Sidebar.Geometry.LatheGeometry;

+ 6 - 3
editor/js/Sidebar.Geometry.PlaneGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.PlaneGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// width
 
@@ -55,7 +56,7 @@ Sidebar.Geometry.PlaneGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.PlaneGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			width.getValue(),
 			height.getValue(),
 			widthSegments.getValue(),
@@ -66,4 +67,6 @@ Sidebar.Geometry.PlaneGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.PlaneBufferGeometry = Sidebar.Geometry.PlaneGeometry;

+ 6 - 3
editor/js/Sidebar.Geometry.SphereGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.SphereGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// radius
 
@@ -85,7 +86,7 @@ Sidebar.Geometry.SphereGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.SphereGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			radius.getValue(),
 			widthSegments.getValue(),
 			heightSegments.getValue(),
@@ -99,4 +100,6 @@ Sidebar.Geometry.SphereGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.SphereBufferGeometry = Sidebar.Geometry.SphereGeometry;

+ 1 - 1
editor/js/Sidebar.Geometry.TeapotBufferGeometry.js

@@ -100,4 +100,4 @@ Sidebar.Geometry.TeapotBufferGeometry = function ( signals, object ) {
 
 	return container;
 
-}
+};

+ 6 - 3
editor/js/Sidebar.Geometry.TorusGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.TorusGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// radius
 
@@ -65,7 +66,7 @@ Sidebar.Geometry.TorusGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.TorusGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			radius.getValue(),
 			tube.getValue(),
 			radialSegments.getValue(),
@@ -77,4 +78,6 @@ Sidebar.Geometry.TorusGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.TorusBufferGeometry = Sidebar.Geometry.TorusGeometry;

+ 6 - 3
editor/js/Sidebar.Geometry.TorusKnotGeometry.js

@@ -8,7 +8,8 @@ Sidebar.Geometry.TorusKnotGeometry = function ( editor, object ) {
 
 	var container = new UI.Row();
 
-	var parameters = object.geometry.parameters;
+	var geometry = object.geometry;
+	var parameters = geometry.parameters;
 
 	// radius
 
@@ -75,7 +76,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( editor, object ) {
 
 	function update() {
 
-		editor.execute( new SetGeometryCommand( object, new THREE.TorusKnotGeometry(
+		editor.execute( new SetGeometryCommand( object, new THREE[ geometry.type ](
 			radius.getValue(),
 			tube.getValue(),
 			tubularSegments.getValue(),
@@ -88,4 +89,6 @@ Sidebar.Geometry.TorusKnotGeometry = function ( editor, object ) {
 
 	return container;
 
-}
+};
+
+Sidebar.Geometry.TorusKnotBufferGeometry = Sidebar.Geometry.TorusKnotGeometry;

+ 3 - 1
editor/js/Sidebar.Geometry.js

@@ -12,6 +12,7 @@ Sidebar.Geometry = function ( editor ) {
 
 	// Actions
 
+	/*
 	var objectActions = new UI.Select().setPosition( 'absolute' ).setRight( '8px' ).setFontSize( '11px' );
 	objectActions.setOptions( {
 
@@ -79,7 +80,8 @@ Sidebar.Geometry = function ( editor ) {
 		this.setValue( 'Actions' );
 
 	} );
-	// container.addStatic( objectActions );
+	container.addStatic( objectActions );
+	*/
 
 	// type
 

+ 18 - 6
editor/js/Sidebar.History.js

@@ -65,19 +65,29 @@ Sidebar.History = function ( editor ) {
 		var options = [];
 		var enumerator = 1;
 
-		( function addObjects( objects, pad ) {
+		function buildOption( object ) {
+
+			var option = document.createElement( 'div' );
+			option.value = object.id;
+
+			return option;
+
+		}
+
+		( function addObjects( objects ) {
 
 			for ( var i = 0, l = objects.length; i < l; i ++ ) {
 
 				var object = objects[ i ];
 
-				var html = pad + "<span style='color: #0000cc '>" + enumerator ++ + ". Undo: " + object.name + "</span>";
+				var option = buildOption( object );
+				option.innerHTML = '&nbsp;' + object.name;
 
-				options.push( { value: object.id, html: html } );
+				options.push( option );
 
 			}
 
-		} )( history.undos, '&nbsp;' );
+		} )( history.undos );
 
 
 		( function addObjects( objects, pad ) {
@@ -86,9 +96,11 @@ Sidebar.History = function ( editor ) {
 
 				var object = objects[ i ];
 
-				var html = pad + "<span style='color: #71544e'>" + enumerator ++ + ". Redo: " +  object.name + "</span>";
+				var option = buildOption( object );
+				option.innerHTML = '&nbsp;' + object.name;
+				option.style.opacity = 0.3;
 
-				options.push( { value: object.id, html: html } );
+				options.push( option );
 
 			}
 

+ 33 - 12
editor/js/Sidebar.Material.js

@@ -11,6 +11,39 @@ Sidebar.Material = function ( editor ) {
 	container.setBorderTop( '0' );
 	container.setPaddingTop( '20px' );
 
+	// New / Copy / Paste
+
+	var copiedMaterial;
+	var managerRow = new UI.Row();
+
+	managerRow.add( new UI.Text( '' ).setWidth( '90px' ) );
+	managerRow.add( new UI.Button( 'New' ).onClick( function () {
+
+		var material = new THREE[ materialClass.getValue() ]();
+		editor.execute( new SetMaterialCommand( currentObject, material ), 'New Material: ' + materialClass.getValue() );
+		update();
+
+	} ) );
+
+	managerRow.add( new UI.Button( 'Copy' ).onClick( function () {
+
+		copiedMaterial = currentObject.material;
+
+	} ) );
+
+	managerRow.add( new UI.Button( 'Paste' ).onClick( function () {
+
+		if ( copiedMaterial === undefined ) return;
+
+		editor.execute( new SetMaterialCommand( currentObject, copiedMaterial ), 'Pasted Material: ' + materialClass.getValue() );
+		refreshUI();
+		update();
+
+	} ) );
+
+	container.add( managerRow );
+
+
 	// type
 
 	var materialClassRow = new UI.Row();
@@ -651,12 +684,6 @@ Sidebar.Material = function ( editor ) {
 
 					}
 
-					if ( material.displacementScale !== materialDisplacementScale.getValue() ) {
-
-						editor.execute( new SetMaterialValueCommand( currentObject, 'displacementScale', materialDisplacementScale.getValue() ) );
-
-					}
-
 				} else {
 
 					if ( roughnessMapEnabled ) textureWarning = true;
@@ -678,12 +705,6 @@ Sidebar.Material = function ( editor ) {
 
 					}
 
-					if ( material.displacementScale !== materialDisplacementScale.getValue() ) {
-
-						editor.execute( new SetMaterialValueCommand( currentObject, 'displacementScale', materialDisplacementScale.getValue() ) );
-
-					}
-
 				} else {
 
 					if ( metalnessMapEnabled ) textureWarning = true;

+ 72 - 32
editor/js/Sidebar.Scene.js

@@ -10,6 +10,51 @@ Sidebar.Scene = function ( editor ) {
 	container.setBorderTop( '0' );
 	container.setPaddingTop( '20px' );
 
+	// outliner
+
+	function buildOption( object, draggable ) {
+
+		var option = document.createElement( 'div' );
+		option.draggable = draggable;
+		option.innerHTML = buildHTML( object );
+		option.value = object.id;
+
+		return option;
+
+	}
+
+	function buildHTML( object ) {
+
+		var html = '<span class="type ' + object.type + '"></span> ' + object.name;
+
+		if ( object instanceof THREE.Mesh ) {
+
+			var geometry = object.geometry;
+			var material = object.material;
+
+			html += ' <span class="type ' + geometry.type + '"></span> ' + geometry.name;
+			html += ' <span class="type ' + material.type + '"></span> ' + material.name;
+
+		}
+
+		html += getScript( object.uuid );
+
+		return html;
+
+	}
+
+	function getScript( uuid ) {
+
+		if ( editor.scripts[ uuid ] !== undefined ) {
+
+			return ' <span class="type Script"></span>';
+
+		}
+
+		return '';
+
+	}
+
 	var ignoreObjectSelectedSignal = false;
 
 	var outliner = new UI.Outliner( editor );
@@ -127,20 +172,8 @@ Sidebar.Scene = function ( editor ) {
 
 		var options = [];
 
-		options.push( { static: true, value: camera.id, html: '<span class="type ' + camera.type + '"></span> ' + camera.name } );
-		options.push( { static: true, value: scene.id, html: '<span class="type ' + scene.type + '"></span> ' + scene.name + getScript( scene.uuid ) } );
-
-		function getScript( uuid ) {
-
-			if ( editor.scripts[ uuid ] !== undefined ) {
-
-				return ' <span class="type Script"></span>';
-
-			}
-
-			return '';
-
-		}
+		options.push( buildOption( camera, false ) );
+		options.push( buildOption( scene, false ) );
 
 		( function addObjects( objects, pad ) {
 
@@ -148,27 +181,15 @@ Sidebar.Scene = function ( editor ) {
 
 				var object = objects[ i ];
 
-				var html = pad + '<span class="type ' + object.type + '"></span> ' + object.name;
-
-				if ( object instanceof THREE.Mesh ) {
-
-					var geometry = object.geometry;
-					var material = object.material;
-
-					html += ' <span class="type ' + geometry.type + '"></span> ' + geometry.name;
-					html += ' <span class="type ' + material.type + '"></span> ' + material.name;
-
-				}
-
-				html += getScript( object.uuid );
-
-				options.push( { value: object.id, html: html } );
+				var option = buildOption( object, true );
+				option.style.marginLeft = ( pad * 10 ) + 'px';
+				options.push( option );
 
-				addObjects( object.children, pad + '&nbsp;&nbsp;&nbsp;' );
+				addObjects( object.children, pad + 1 );
 
 			}
 
-		} )( scene.children, '&nbsp;&nbsp;&nbsp;' );
+		} )( scene.children, 1 );
 
 		outliner.setOptions( options );
 
@@ -222,6 +243,25 @@ Sidebar.Scene = function ( editor ) {
 
 	signals.sceneGraphChanged.add( refreshUI );
 
+	signals.objectChanged.add( function ( object ) {
+
+		var options = outliner.options;
+
+		for ( var i = 0; i < options.length; i ++ ) {
+
+			var option = options[ i ];
+
+			if ( option.value === object.id ) {
+
+				option.innerHTML = buildHTML( object );
+				return;
+
+			}
+
+		}
+
+	} );
+
 	signals.objectSelected.add( function ( object ) {
 
 		if ( ignoreObjectSelectedSignal === true ) return;
@@ -232,4 +272,4 @@ Sidebar.Scene = function ( editor ) {
 
 	return container;
 
-}
+};

+ 1 - 1
editor/js/Viewport.js

@@ -384,7 +384,7 @@ var Viewport = function ( editor ) {
 
 	signals.geometryChanged.add( function ( object ) {
 
-		if ( object !== null ) {
+		if ( object !== undefined ) {
 
 			selectionBox.update( object );
 

+ 2 - 0
editor/js/commands/SetMaterialValueCommand.js

@@ -31,6 +31,7 @@ SetMaterialValueCommand.prototype = {
 
 		this.object.material[ this.attributeName ] = this.newValue;
 		this.object.material.needsUpdate = true;
+		this.editor.signals.objectChanged.dispatch( this.object );
 		this.editor.signals.materialChanged.dispatch( this.object.material );
 
 	},
@@ -39,6 +40,7 @@ SetMaterialValueCommand.prototype = {
 
 		this.object.material[ this.attributeName ] = this.oldValue;
 		this.object.material.needsUpdate = true;
+		this.editor.signals.objectChanged.dispatch( this.object );
 		this.editor.signals.materialChanged.dispatch( this.object.material );
 
 	},

+ 47 - 32
editor/js/libs/codemirror/codemirror.css

@@ -41,19 +41,21 @@
 
 /* CURSOR */
 
-.CodeMirror div.CodeMirror-cursor {
+.CodeMirror-cursor {
   border-left: 1px solid black;
+  border-right: none;
+  width: 0;
 }
 /* Shown when moving in bi-directional text */
 .CodeMirror div.CodeMirror-secondarycursor {
   border-left: 1px solid silver;
 }
-.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
+.cm-fat-cursor .CodeMirror-cursor {
   width: auto;
   border: 0;
   background: #7e7;
 }
-.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
+.cm-fat-cursor div.CodeMirror-cursors {
   z-index: 1;
 }
 
@@ -63,25 +65,26 @@
   -webkit-animation: blink 1.06s steps(1) infinite;
   -moz-animation: blink 1.06s steps(1) infinite;
   animation: blink 1.06s steps(1) infinite;
+  background-color: #7e7;
 }
 @-moz-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
+  0% {}
+  50% { background-color: transparent; }
+  100% {}
 }
 @-webkit-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
+  0% {}
+  50% { background-color: transparent; }
+  100% {}
 }
 @keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
+  0% {}
+  50% { background-color: transparent; }
+  100% {}
 }
 
 /* Can style cursor different in overwrite (non-insert) mode */
-div.CodeMirror-overwrite div.CodeMirror-cursor {}
+.CodeMirror-overwrite .CodeMirror-cursor {}
 
 .cm-tab { display: inline-block; text-decoration: inherit; }
 
@@ -92,6 +95,15 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
 
 /* DEFAULT THEME */
 
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+.cm-strikethrough {text-decoration: line-through;}
+
 .cm-s-default .cm-keyword {color: #708;}
 .cm-s-default .cm-atom {color: #219;}
 .cm-s-default .cm-number {color: #164;}
@@ -111,21 +123,14 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
 .cm-s-default .cm-bracket {color: #997;}
 .cm-s-default .cm-tag {color: #170;}
 .cm-s-default .cm-attribute {color: #00c;}
-.cm-s-default .cm-header {color: blue;}
-.cm-s-default .cm-quote {color: #090;}
 .cm-s-default .cm-hr {color: #999;}
 .cm-s-default .cm-link {color: #00c;}
 
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-.cm-strikethrough {text-decoration: line-through;}
-
 .cm-s-default .cm-error {color: #f00;}
 .cm-invalidchar {color: #f00;}
 
+.CodeMirror-composing { border-bottom: 2px solid; }
+
 /* Default styles for common addons */
 
 div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
@@ -160,7 +165,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
 }
 
 /* The fake, visible scrollbars. Used to force redraw during scrolling
-   before actuall scrolling happens, thus preventing shaking and
+   before actual scrolling happens, thus preventing shaking and
    flickering artifacts. */
 .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
   position: absolute;
@@ -186,12 +191,14 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
 
 .CodeMirror-gutters {
   position: absolute; left: 0; top: 0;
+  min-height: 100%;
   z-index: 3;
 }
 .CodeMirror-gutter {
   white-space: normal;
   height: 100%;
   display: inline-block;
+  vertical-align: top;
   margin-bottom: -30px;
   /* Hack to make IE7 behave */
   *zoom:1;
@@ -200,7 +207,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
 .CodeMirror-gutter-wrapper {
   position: absolute;
   z-index: 4;
-  height: 100%;
+  background: none !important;
+  border: none !important;
+}
+.CodeMirror-gutter-background {
+  position: absolute;
+  top: 0; bottom: 0;
+  z-index: 4;
 }
 .CodeMirror-gutter-elt {
   position: absolute;
@@ -233,6 +246,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
   position: relative;
   overflow: visible;
   -webkit-tap-highlight-color: transparent;
+  -webkit-font-variant-ligatures: none;
+  font-variant-ligatures: none;
 }
 .CodeMirror-wrap pre {
   word-wrap: break-word;
@@ -275,19 +290,19 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
   overflow: hidden;
   visibility: hidden;
 }
-.CodeMirror-measure pre { position: static; }
 
-.CodeMirror div.CodeMirror-cursor {
-  position: absolute;
-  border-right: none;
-  width: 0;
-}
+.CodeMirror-cursor { position: absolute; }
+.CodeMirror-measure pre { position: static; }
 
 div.CodeMirror-cursors {
   visibility: hidden;
   position: relative;
   z-index: 3;
 }
+div.CodeMirror-dragcursors {
+  visibility: visible;
+}
+
 .CodeMirror-focused div.CodeMirror-cursors {
   visibility: visible;
 }
@@ -295,8 +310,8 @@ div.CodeMirror-cursors {
 .CodeMirror-selected { background: #d9d9d9; }
 .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
 .CodeMirror-crosshair { cursor: crosshair; }
-.CodeMirror ::selection { background: #d7d4f0; }
-.CodeMirror ::-moz-selection { background: #d7d4f0; }
+.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
+.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
 
 .cm-searching {
   background: #ffa;

File diff suppressed because it is too large
+ 309 - 204
editor/js/libs/codemirror/codemirror.js


+ 71 - 26
editor/js/libs/codemirror/mode/javascript.js

@@ -13,6 +13,11 @@
 })(function(CodeMirror) {
 "use strict";
 
+function expressionAllowed(stream, state, backUp) {
+  return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
+    (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
+}
+
 CodeMirror.defineMode("javascript", function(config, parserConfig) {
   var indentUnit = config.indentUnit;
   var statementIndent = parserConfig.statementIndent;
@@ -30,13 +35,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
 
     var jsKeywords = {
       "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
-      "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,
+      "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
       "var": kw("var"), "const": kw("var"), "let": kw("var"),
       "function": kw("function"), "catch": kw("catch"),
       "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
       "in": operator, "typeof": operator, "instanceof": operator,
       "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
-      "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),
+      "this": kw("this"), "class": kw("class"), "super": kw("atom"),
       "yield": C, "export": kw("export"), "import": kw("import"), "extends": C
     };
 
@@ -45,18 +50,23 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       var type = {type: "variable", style: "variable-3"};
       var tsKeywords = {
         // object-like things
-        "interface": kw("interface"),
-        "extends": kw("extends"),
-        "constructor": kw("constructor"),
+        "interface": kw("class"),
+        "implements": C,
+        "namespace": C,
+        "module": kw("module"),
+        "enum": kw("module"),
 
         // scope modifiers
-        "public": kw("public"),
-        "private": kw("private"),
-        "protected": kw("protected"),
-        "static": kw("static"),
+        "public": kw("modifier"),
+        "private": kw("modifier"),
+        "protected": kw("modifier"),
+        "abstract": kw("modifier"),
+
+        // operators
+        "as": operator,
 
         // types
-        "string": type, "number": type, "bool": type, "any": type
+        "string": type, "number": type, "boolean": type, "any": type
       };
 
       for (var attr in tsKeywords) {
@@ -105,6 +115,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     } else if (ch == "0" && stream.eat(/x/i)) {
       stream.eatWhile(/[\da-f]/i);
       return ret("number", "number");
+    } else if (ch == "0" && stream.eat(/o/i)) {
+      stream.eatWhile(/[0-7]/i);
+      return ret("number", "number");
+    } else if (ch == "0" && stream.eat(/b/i)) {
+      stream.eatWhile(/[01]/i);
+      return ret("number", "number");
     } else if (/\d/.test(ch)) {
       stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
       return ret("number", "number");
@@ -115,8 +131,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       } else if (stream.eat("/")) {
         stream.skipToEnd();
         return ret("comment", "comment");
-      } else if (state.lastType == "operator" || state.lastType == "keyword c" ||
-               state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
+      } else if (expressionAllowed(stream, state, 1)) {
         readRegexp(stream);
         stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
         return ret("regexp", "string-2");
@@ -275,8 +290,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       return false;
     }
     var state = cx.state;
+    cx.marked = "def";
     if (state.context) {
-      cx.marked = "def";
       if (inList(state.localVars)) return;
       state.localVars = {name: varname, next: state.localVars};
     } else {
@@ -347,10 +362,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "default") return cont(expect(":"));
     if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
                                      statement, poplex, popcontext);
-    if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);
     if (type == "class") return cont(pushlex("form"), className, poplex);
-    if (type == "export") return cont(pushlex("form"), afterExport, poplex);
-    if (type == "import") return cont(pushlex("form"), afterImport, poplex);
+    if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
+    if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
+    if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
     return pass(pushlex("stat"), expression, expect(";"), poplex);
   }
   function expression(type) {
@@ -374,7 +389,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
     if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
     if (type == "{") return contCommasep(objprop, "}", null, maybeop);
-    if (type == "quasi") { return pass(quasi, maybeop); }
+    if (type == "quasi") return pass(quasi, maybeop);
+    if (type == "new") return cont(maybeTarget(noComma));
     return cont();
   }
   function maybeexpression(type) {
@@ -425,6 +441,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     findFatArrow(cx.stream, cx.state);
     return pass(type == "{" ? statement : expressionNoComma);
   }
+  function maybeTarget(noComma) {
+    return function(type) {
+      if (type == ".") return cont(noComma ? targetNoComma : target);
+      else return pass(noComma ? expressionNoComma : expression);
+    };
+  }
+  function target(_, value) {
+    if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
+  }
+  function targetNoComma(_, value) {
+    if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
+  }
   function maybelabel(type) {
     if (type == ":") return cont(poplex, statement);
     return pass(maybeoperatorComma, expect(";"), poplex);
@@ -442,8 +470,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       return cont(afterprop);
     } else if (type == "jsonld-keyword") {
       return cont(afterprop);
+    } else if (type == "modifier") {
+      return cont(objprop)
     } else if (type == "[") {
       return cont(expression, expect("]"), afterprop);
+    } else if (type == "spread") {
+      return cont(expression);
     }
   }
   function getterSetter(type) {
@@ -482,14 +514,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   function maybetype(type) {
     if (isTS && type == ":") return cont(typedef);
   }
+  function maybedefault(_, value) {
+    if (value == "=") return cont(expressionNoComma);
+  }
   function typedef(type) {
-    if (type == "variable"){cx.marked = "variable-3"; return cont();}
+    if (type == "variable") {cx.marked = "variable-3"; return cont();}
   }
   function vardef() {
     return pass(pattern, maybetype, maybeAssign, vardefCont);
   }
   function pattern(type, value) {
+    if (type == "modifier") return cont(pattern)
     if (type == "variable") { register(value); return cont(); }
+    if (type == "spread") return cont(pattern);
     if (type == "[") return contCommasep(pattern, "]");
     if (type == "{") return contCommasep(proppattern, "}");
   }
@@ -499,6 +536,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       return cont(maybeAssign);
     }
     if (type == "variable") cx.marked = "property";
+    if (type == "spread") return cont(pattern);
+    if (type == "}") return pass();
     return cont(expect(":"), pattern, maybeAssign);
   }
   function maybeAssign(_type, value) {
@@ -538,7 +577,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   }
   function funarg(type) {
     if (type == "spread") return cont(funarg);
-    return pass(pattern, maybetype);
+    return pass(pattern, maybetype, maybedefault);
   }
   function className(type, value) {
     if (type == "variable") {register(value); return cont(classNameAfter);}
@@ -569,10 +608,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     cx.marked = "property";
     return cont();
   }
-  function afterModule(type, value) {
-    if (type == "string") return cont(statement);
-    if (type == "variable") { register(value); return cont(maybeFrom); }
-  }
   function afterExport(_type, value) {
     if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
     if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
@@ -585,7 +620,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   function importSpec(type, value) {
     if (type == "{") return contCommasep(importSpec, "}");
     if (type == "variable") register(value);
-    return cont();
+    if (value == "*") cx.marked = "keyword";
+    return cont(maybeAs);
+  }
+  function maybeAs(_type, value) {
+    if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
   }
   function maybeFrom(_type, value) {
     if (value == "from") { cx.marked = "keyword"; return cont(expression); }
@@ -621,7 +660,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
         lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
         localVars: parserConfig.localVars,
         context: parserConfig.localVars && {vars: parserConfig.localVars},
-        indented: 0
+        indented: basecolumn || 0
       };
       if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
         state.globalVars = parserConfig.globalVars;
@@ -677,7 +716,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
 
     helperType: jsonMode ? "json" : "javascript",
     jsonldMode: jsonldMode,
-    jsonMode: jsonMode
+    jsonMode: jsonMode,
+
+    expressionAllowed: expressionAllowed,
+    skipExpression: function(state) {
+      var top = state.cc[state.cc.length - 1]
+      if (top == expression || top == expressionNoComma) state.cc.pop()
+    }
   };
 });
 

+ 24 - 21
editor/js/libs/codemirror/theme/monokai.css

@@ -1,32 +1,35 @@
 /* Based on Sublime Text's Monokai theme */
 
-.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
-.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
-.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); }
-.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); }
-.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
+.cm-s-monokai.CodeMirror { background: #272822; color: #f8f8f2; }
+.cm-s-monokai div.CodeMirror-selected { background: #49483E; }
+.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }
+.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }
+.cm-s-monokai .CodeMirror-gutters { background: #272822; border-right: 0px; }
 .cm-s-monokai .CodeMirror-guttermarker { color: white; }
 .cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
-.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
-.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
+.cm-s-monokai .CodeMirror-linenumber { color: #d0d0d0; }
+.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
 
-.cm-s-monokai span.cm-comment {color: #75715e;}
-.cm-s-monokai span.cm-atom {color: #ae81ff;}
-.cm-s-monokai span.cm-number {color: #ae81ff;}
+.cm-s-monokai span.cm-comment { color: #75715e; }
+.cm-s-monokai span.cm-atom { color: #ae81ff; }
+.cm-s-monokai span.cm-number { color: #ae81ff; }
 
-.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
-.cm-s-monokai span.cm-keyword {color: #f92672;}
-.cm-s-monokai span.cm-string {color: #e6db74;}
+.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; }
+.cm-s-monokai span.cm-keyword { color: #f92672; }
+.cm-s-monokai span.cm-builtin { color: #66d9ef; }
+.cm-s-monokai span.cm-string { color: #e6db74; }
 
-.cm-s-monokai span.cm-variable {color: #a6e22e;}
-.cm-s-monokai span.cm-variable-2 {color: #9effff;}
-.cm-s-monokai span.cm-def {color: #fd971f;}
-.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
-.cm-s-monokai span.cm-tag {color: #f92672;}
-.cm-s-monokai span.cm-link {color: #ae81ff;}
-.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
+.cm-s-monokai span.cm-variable { color: #f8f8f2; }
+.cm-s-monokai span.cm-variable-2 { color: #9effff; }
+.cm-s-monokai span.cm-variable-3 { color: #66d9ef; }
+.cm-s-monokai span.cm-def { color: #fd971f; }
+.cm-s-monokai span.cm-bracket { color: #f8f8f2; }
+.cm-s-monokai span.cm-tag { color: #f92672; }
+.cm-s-monokai span.cm-header { color: #ae81ff; }
+.cm-s-monokai span.cm-link { color: #ae81ff; }
+.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; }
 
-.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;}
+.cm-s-monokai .CodeMirror-activeline-background { background: #373831; }
 .cm-s-monokai .CodeMirror-matchingbracket {
   text-decoration: underline;
   color: white !important;

+ 0 - 4
editor/js/libs/tern-threejs/threejs.js

@@ -580,10 +580,6 @@
           "!type": "bool",
           "!doc": "default – false"
         },
-        "rotationAutoUpdate": {
-          "!type": "bool",
-          "!doc": "default – true"
-        },
         "userData": {
           "!type": "object",
           "!doc": "An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned."

+ 1 - 1
editor/js/libs/ui.js

@@ -116,7 +116,7 @@ UI.Element.prototype = {
 
 var properties = [ 'position', 'left', 'top', 'right', 'bottom', 'width', 'height', 'border', 'borderLeft',
 'borderTop', 'borderRight', 'borderBottom', 'borderColor', 'display', 'overflow', 'margin', 'marginLeft', 'marginTop', 'marginRight', 'marginBottom', 'padding', 'paddingLeft', 'paddingTop', 'paddingRight', 'paddingBottom', 'color',
-'backgroundColor', 'opacity', 'fontSize', 'fontWeight', 'textAlign', 'textDecoration', 'textTransform', 'cursor', 'zIndex' ];
+'background', 'backgroundColor', 'opacity', 'fontSize', 'fontWeight', 'textAlign', 'textDecoration', 'textTransform', 'cursor', 'zIndex' ];
 
 properties.forEach( function ( property ) {
 

+ 2 - 8
editor/js/libs/ui.three.js

@@ -334,21 +334,15 @@ UI.Outliner.prototype.setOptions = function ( options ) {
 
 	for ( var i = 0; i < options.length; i ++ ) {
 
-		var option = options[ i ];
-
-		var div = document.createElement( 'div' );
+		var div = options[ i ];
 		div.className = 'option';
-		div.innerHTML = option.html;
-		div.value = option.value;
 		scope.dom.appendChild( div );
 
 		scope.options.push( div );
 
 		div.addEventListener( 'click', onClick, false );
 
-		if ( option.static !== true ) {
-
-			div.draggable = true;
+		if ( div.draggable === true ) {
 
 			div.addEventListener( 'drag', onDrag, false );
 			div.addEventListener( 'dragstart', onDragStart, false ); // Firefox needs this

+ 2 - 0
examples/canvas_geometry_shapes.html

@@ -82,6 +82,8 @@
 					// line
 
 					var geometry = shape.createPointsGeometry();
+					geometry.vertices.push( geometry.vertices[ 0 ].clone() );
+
 					var material = new THREE.LineBasicMaterial( { linewidth: 10, color: 0x333333, transparent: true } );
 
 					var line = new THREE.Line( geometry, material );

+ 1 - 1
examples/canvas_geometry_text.html

@@ -42,7 +42,7 @@
 			var windowHalfY = window.innerHeight / 2;
 
 			var loader = new THREE.FontLoader();
-			loader.load( 'fonts/helvetiker_regular.typeface.js', function ( font ) {
+			loader.load( 'fonts/helvetiker_regular.typeface.json', function ( font ) {
 
 				init( font );
 				animate();

+ 6 - 6
examples/canvas_interactive_cubes.html

@@ -90,9 +90,9 @@
 					}
 
 				} );
-				
+
 				//
-				
+
 				raycaster = new THREE.Raycaster();
 				mouse = new THREE.Vector2();
 
@@ -122,16 +122,16 @@
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}
-			
+
 			function onDocumentTouchStart( event ) {
-				
+
 				event.preventDefault();
-				
+
 				event.clientX = event.touches[0].clientX;
 				event.clientY = event.touches[0].clientY;
 				onDocumentMouseDown( event );
 
-			}	
+			}
 
 			function onDocumentMouseDown( event ) {
 

+ 0 - 440
examples/css3dstereo_periodictable.html

@@ -1,440 +0,0 @@
-<!DOCTYPE html>
-<html>
-	<head>
-		<title>three.js css3d stereo - periodic table</title>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			html, body {
-				height: 100%;
-			}
-
-			body {
-				background-color: #000000;
-				margin: 0;
-				font-family: Helvetica, sans-serif;;
-				overflow: hidden;
-			}
-
-			a {
-				color: #ffffff;
-			}
-
-			.element {
-				width: 120px;
-				height: 160px;
-				box-shadow: 0px 0px 12px rgba(0,255,255,0.5);
-				border: 1px solid rgba(127,255,255,0.25);
-				text-align: center;
-				cursor: default;
-			}
-
-			.element:hover {
-				box-shadow: 0px 0px 12px rgba(0,255,255,0.75);
-				border: 1px solid rgba(127,255,255,0.75);
-			}
-
-				.element .number {
-					position: absolute;
-					top: 20px;
-					right: 20px;
-					font-size: 12px;
-					color: rgba(127,255,255,0.75);
-				}
-
-				.element .symbol {
-					position: absolute;
-					top: 40px;
-					left: 0px;
-					right: 0px;
-					font-size: 60px;
-					font-weight: bold;
-					color: rgba(255,255,255,0.75);
-					text-shadow: 0 0 10px rgba(0,255,255,0.95);
-				}
-
-				.element .details {
-					position: absolute;
-					bottom: 15px;
-					left: 0px;
-					right: 0px;
-					font-size: 12px;
-					color: rgba(127,255,255,0.75);
-				}
-		</style>
-	</head>
-	<body>
-		<script src="../build/three.js"></script>
-		<script src="js/libs/tween.min.js"></script>
-		<script src="js/controls/DeviceOrientationControls.js"></script>
-		<script src="js/renderers/CSS3DStereoRenderer.js"></script>
-
-		<div id="container"></div>
-
-		<script>
-
-			var table = [
-				"H", "Hydrogen", "1.00794", 1, 1,
-				"He", "Helium", "4.002602", 18, 1,
-				"Li", "Lithium", "6.941", 1, 2,
-				"Be", "Beryllium", "9.012182", 2, 2,
-				"B", "Boron", "10.811", 13, 2,
-				"C", "Carbon", "12.0107", 14, 2,
-				"N", "Nitrogen", "14.0067", 15, 2,
-				"O", "Oxygen", "15.9994", 16, 2,
-				"F", "Fluorine", "18.9984032", 17, 2,
-				"Ne", "Neon", "20.1797", 18, 2,
-				"Na", "Sodium", "22.98976...", 1, 3,
-				"Mg", "Magnesium", "24.305", 2, 3,
-				"Al", "Aluminium", "26.9815386", 13, 3,
-				"Si", "Silicon", "28.0855", 14, 3,
-				"P", "Phosphorus", "30.973762", 15, 3,
-				"S", "Sulfur", "32.065", 16, 3,
-				"Cl", "Chlorine", "35.453", 17, 3,
-				"Ar", "Argon", "39.948", 18, 3,
-				"K", "Potassium", "39.948", 1, 4,
-				"Ca", "Calcium", "40.078", 2, 4,
-				"Sc", "Scandium", "44.955912", 3, 4,
-				"Ti", "Titanium", "47.867", 4, 4,
-				"V", "Vanadium", "50.9415", 5, 4,
-				"Cr", "Chromium", "51.9961", 6, 4,
-				"Mn", "Manganese", "54.938045", 7, 4,
-				"Fe", "Iron", "55.845", 8, 4,
-				"Co", "Cobalt", "58.933195", 9, 4,
-				"Ni", "Nickel", "58.6934", 10, 4,
-				"Cu", "Copper", "63.546", 11, 4,
-				"Zn", "Zinc", "65.38", 12, 4,
-				"Ga", "Gallium", "69.723", 13, 4,
-				"Ge", "Germanium", "72.63", 14, 4,
-				"As", "Arsenic", "74.9216", 15, 4,
-				"Se", "Selenium", "78.96", 16, 4,
-				"Br", "Bromine", "79.904", 17, 4,
-				"Kr", "Krypton", "83.798", 18, 4,
-				"Rb", "Rubidium", "85.4678", 1, 5,
-				"Sr", "Strontium", "87.62", 2, 5,
-				"Y", "Yttrium", "88.90585", 3, 5,
-				"Zr", "Zirconium", "91.224", 4, 5,
-				"Nb", "Niobium", "92.90628", 5, 5,
-				"Mo", "Molybdenum", "95.96", 6, 5,
-				"Tc", "Technetium", "(98)", 7, 5,
-				"Ru", "Ruthenium", "101.07", 8, 5,
-				"Rh", "Rhodium", "102.9055", 9, 5,
-				"Pd", "Palladium", "106.42", 10, 5,
-				"Ag", "Silver", "107.8682", 11, 5,
-				"Cd", "Cadmium", "112.411", 12, 5,
-				"In", "Indium", "114.818", 13, 5,
-				"Sn", "Tin", "118.71", 14, 5,
-				"Sb", "Antimony", "121.76", 15, 5,
-				"Te", "Tellurium", "127.6", 16, 5,
-				"I", "Iodine", "126.90447", 17, 5,
-				"Xe", "Xenon", "131.293", 18, 5,
-				"Cs", "Caesium", "132.9054", 1, 6,
-				"Ba", "Barium", "132.9054", 2, 6,
-				"La", "Lanthanum", "138.90547", 4, 9,
-				"Ce", "Cerium", "140.116", 5, 9,
-				"Pr", "Praseodymium", "140.90765", 6, 9,
-				"Nd", "Neodymium", "144.242", 7, 9,
-				"Pm", "Promethium", "(145)", 8, 9,
-				"Sm", "Samarium", "150.36", 9, 9,
-				"Eu", "Europium", "151.964", 10, 9,
-				"Gd", "Gadolinium", "157.25", 11, 9,
-				"Tb", "Terbium", "158.92535", 12, 9,
-				"Dy", "Dysprosium", "162.5", 13, 9,
-				"Ho", "Holmium", "164.93032", 14, 9,
-				"Er", "Erbium", "167.259", 15, 9,
-				"Tm", "Thulium", "168.93421", 16, 9,
-				"Yb", "Ytterbium", "173.054", 17, 9,
-				"Lu", "Lutetium", "174.9668", 18, 9,
-				"Hf", "Hafnium", "178.49", 4, 6,
-				"Ta", "Tantalum", "180.94788", 5, 6,
-				"W", "Tungsten", "183.84", 6, 6,
-				"Re", "Rhenium", "186.207", 7, 6,
-				"Os", "Osmium", "190.23", 8, 6,
-				"Ir", "Iridium", "192.217", 9, 6,
-				"Pt", "Platinum", "195.084", 10, 6,
-				"Au", "Gold", "196.966569", 11, 6,
-				"Hg", "Mercury", "200.59", 12, 6,
-				"Tl", "Thallium", "204.3833", 13, 6,
-				"Pb", "Lead", "207.2", 14, 6,
-				"Bi", "Bismuth", "208.9804", 15, 6,
-				"Po", "Polonium", "(209)", 16, 6,
-				"At", "Astatine", "(210)", 17, 6,
-				"Rn", "Radon", "(222)", 18, 6,
-				"Fr", "Francium", "(223)", 1, 7,
-				"Ra", "Radium", "(226)", 2, 7,
-				"Ac", "Actinium", "(227)", 4, 10,
-				"Th", "Thorium", "232.03806", 5, 10,
-				"Pa", "Protactinium", "231.0588", 6, 10,
-				"U", "Uranium", "238.02891", 7, 10,
-				"Np", "Neptunium", "(237)", 8, 10,
-				"Pu", "Plutonium", "(244)", 9, 10,
-				"Am", "Americium", "(243)", 10, 10,
-				"Cm", "Curium", "(247)", 11, 10,
-				"Bk", "Berkelium", "(247)", 12, 10,
-				"Cf", "Californium", "(251)", 13, 10,
-				"Es", "Einstenium", "(252)", 14, 10,
-				"Fm", "Fermium", "(257)", 15, 10,
-				"Md", "Mendelevium", "(258)", 16, 10,
-				"No", "Nobelium", "(259)", 17, 10,
-				"Lr", "Lawrencium", "(262)", 18, 10,
-				"Rf", "Rutherfordium", "(267)", 4, 7,
-				"Db", "Dubnium", "(268)", 5, 7,
-				"Sg", "Seaborgium", "(271)", 6, 7,
-				"Bh", "Bohrium", "(272)", 7, 7,
-				"Hs", "Hassium", "(270)", 8, 7,
-				"Mt", "Meitnerium", "(276)", 9, 7,
-				"Ds", "Darmstadium", "(281)", 10, 7,
-				"Rg", "Roentgenium", "(280)", 11, 7,
-				"Cn", "Copernicium", "(285)", 12, 7,
-				"Uut", "Unutrium", "(284)", 13, 7,
-				"Fl", "Flerovium", "(289)", 14, 7,
-				"Uup", "Ununpentium", "(288)", 15, 7,
-				"Lv", "Livermorium", "(293)", 16, 7,
-				"Uus", "Ununseptium", "(294)", 17, 7,
-				"Uuo", "Ununoctium", "(294)", 18, 7
-			];
-
-			var camera, scene, renderer;
-			var controls;
-
-			var state = 0;
-
-			var objects = [];
-			var targets = { table: [], sphere: [], helix: [], grid: [] };
-
-			init();
-			animate();
-
-			function init() {
-
-				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
-				camera.position.z = 200;
-
-				scene = new THREE.Scene();
-
-				// table
-
-				for ( var i = 0; i < table.length; i += 5 ) {
-
-					var element = document.createElement( 'div' );
-					element.className = 'element';
-					element.style.backgroundColor = 'rgba(0,127,127,' + ( Math.random() * 0.5 + 0.25 ) + ')';
-
-					var number = document.createElement( 'div' );
-					number.className = 'number';
-					number.textContent = (i/5) + 1;
-					element.appendChild( number );
-
-					var symbol = document.createElement( 'div' );
-					symbol.className = 'symbol';
-					symbol.textContent = table[ i ];
-					element.appendChild( symbol );
-
-					var details = document.createElement( 'div' );
-					details.className = 'details';
-					details.innerHTML = table[ i + 1 ] + '<br>' + table[ i + 2 ];
-					element.appendChild( details );
-
-					var object = new THREE.CSS3DObject( element );
-					object.position.x = Math.random() * 4000 - 2000;
-					object.position.y = Math.random() * 4000 - 2000;
-					object.position.z = Math.random() * 4000 - 2000;
-					scene.add( object );
-
-					objects.push( object );
-
-					//
-
-					var object = new THREE.Object3D();
-					object.position.x = ( table[ i + 3 ] * 140 ) - 1330;
-					object.position.y = - ( table[ i + 4 ] * 180 ) + 990;
-
-					targets.table.push( object );
-
-				}
-
-				// sphere
-
-				var vector = new THREE.Vector3();
-
-				for ( var i = 0, l = objects.length; i < l; i ++ ) {
-
-					var phi = Math.acos( -1 + ( 2 * i ) / l );
-					var theta = Math.sqrt( l * Math.PI ) * phi;
-
-					var object = new THREE.Object3D();
-
-					object.position.x = 800 * Math.cos( theta ) * Math.sin( phi );
-					object.position.y = 800 * Math.sin( theta ) * Math.sin( phi );
-					object.position.z = 800 * Math.cos( phi );
-
-					vector.copy( object.position ).multiplyScalar( 2 );
-
-					object.lookAt( vector );
-
-					targets.sphere.push( object );
-
-				}
-
-				// helix
-
-				var vector = new THREE.Vector3();
-
-				for ( var i = 0, l = objects.length; i < l; i ++ ) {
-
-					var phi = i * 0.175 + Math.PI;
-
-					var object = new THREE.Object3D();
-
-					object.position.x = 900 * Math.sin( phi );
-					object.position.y = - ( i * 8 ) + 450;
-					object.position.z = 900 * Math.cos( phi );
-
-					vector.x = object.position.x * 2;
-					vector.y = object.position.y;
-					vector.z = object.position.z * 2;
-
-					object.lookAt( vector );
-
-					targets.helix.push( object );
-
-				}
-
-				// grid
-
-				for ( var i = 0; i < objects.length; i ++ ) {
-
-					var object = new THREE.Object3D();
-
-					object.position.x = ( ( i % 5 ) * 400 ) - 800;
-					object.position.y = ( - ( Math.floor( i / 5 ) % 5 ) * 400 ) + 800;
-					object.position.z = ( Math.floor( i / 25 ) ) * 1000 - 2000;
-
-					targets.grid.push( object );
-
-				}
-
-				//
-
-				renderer = new THREE.CSS3DStereoRenderer();
-				renderer.setSize( window.innerWidth, window.innerHeight );
-				renderer.domElement.style.position = 'absolute';
-				document.getElementById( 'container' ).appendChild( renderer.domElement );
-
-				//
-
-				controls = new THREE.DeviceOrientationControls( camera );
-
-				transform( targets.table, 5000 );
-
-
-				//
-
-				window.addEventListener( 'resize', onWindowResize, false );
-
-			}
-
-			//
-
-			var isFullscreen = false;
-
-			window.addEventListener( 'touchend', function () {
-
-				if ( isFullscreen === false ) {
-
-					document.body.webkitRequestFullscreen();
-
-					isFullscreen = true;
-
-				} else {
-
-					document.webkitExitFullscreen();
-
-					isFullscreen = false;
-
-				}
-
-			} );
-
-			function transform( positions, duration ) {
-
-				TWEEN.removeAll();
-
-				for ( var i = 0; i < objects.length; i ++ ) {
-
-					var object = objects[ i ];
-					var target = positions[ i ];
-
-					new TWEEN.Tween( object.position )
-						.to( { x: target.position.x, y: target.position.y, z: target.position.z }, Math.random() * duration + duration )
-						.easing( TWEEN.Easing.Exponential.InOut )
-						.start();
-
-					new TWEEN.Tween( object.rotation )
-						.to( { x: target.rotation.x, y: target.rotation.y, z: target.rotation.z }, Math.random() * duration + duration )
-						.easing( TWEEN.Easing.Exponential.InOut )
-						.start();
-
-				}
-
-				new TWEEN.Tween( this )
-					.to( {}, duration * 2 )
-					.onUpdate( render )
-					.onComplete( function () {
-
-						switch ( state ) {
-							case 0:
-								transform( targets.sphere, 2000 );
-								break;
-							case 1:
-								transform( targets.helix, 2000 );
-								break;
-							case 2:
-								transform( targets.grid, 2000 );
-								break;
-							case 3:
-								transform( targets.table, 2000 );
-								break;
-						}
-
-						state = state + 1;
-
-						if ( state > 3 ) state = 0;
-
-					})
-					.start();
-
-			}
-
-			function onWindowResize() {
-
-				camera.aspect = window.innerWidth / window.innerHeight;
-				camera.updateProjectionMatrix();
-
-				renderer.setSize( window.innerWidth, window.innerHeight );
-
-				render();
-
-			}
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				TWEEN.update();
-
-				controls.update();
-
-				render();
-
-			}
-
-			function render() {
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-	</body>
-</html>

+ 2 - 4
examples/files.js

@@ -152,6 +152,7 @@ var files = {
 		"webgl_materials_video",
 		"webgl_materials_wireframe",
 		"webgl_mirror",
+		"webgl_mirror_nodes",
 		"webgl_modifier_subdivision",
 		"webgl_modifier_tessellation",
 		"webgl_morphnormals",
@@ -171,7 +172,6 @@ var files = {
 		"webgl_octree_raycasting",
 		"webgl_panorama_dualfisheye",
 		"webgl_panorama_equirectangular",
-		"webgl_particles_general",
 		"webgl_performance",
 		"webgl_performance_doublesided",
 		"webgl_performance_static",
@@ -189,6 +189,7 @@ var files = {
 		"webgl_postprocessing_godrays",
 		"webgl_postprocessing_masking",
 		"webgl_postprocessing_msaa",
+		"webgl_postprocessing_msaa_unbiased",
 		"webgl_postprocessing_nodes",
 		"webgl_postprocessing_procedural",
 		"webgl_postprocessing_smaa",
@@ -260,9 +261,6 @@ var files = {
 		"css3d_sprites",
 		"css3d_youtube"
 	],
-	"css3d stereo": [
-		"css3dstereo_periodictable",
-	],
 	"misc": [
 		"misc_animation_authoring",
 		"misc_animation_keys",

+ 1 - 1
examples/fonts/README

@@ -1,2 +1,2 @@
-Use Facetype.js to generate typeface.js fonts.
+Use Facetype.js to generate typeface.json fonts.
 http://gero3.github.io/facetype.js/

File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_sans_bold.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_sans_bold.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_sans_mono_regular.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_sans_mono_regular.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_sans_regular.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_sans_regular.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_serif_bold.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_serif_bold.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_serif_regular.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/droid/droid_serif_regular.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/gentilis_bold.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/gentilis_bold.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/gentilis_regular.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/gentilis_regular.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/helvetiker_bold.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/helvetiker_bold.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/helvetiker_regular.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/helvetiker_regular.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/optimer_bold.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/optimer_bold.typeface.json


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/optimer_regular.typeface.js


File diff suppressed because it is too large
+ 0 - 0
examples/fonts/optimer_regular.typeface.json


+ 29 - 0
examples/js/BlendCharacter.js

@@ -55,6 +55,35 @@ THREE.BlendCharacter = function () {
 
 	};
 
+	this.loadJSON = function ( url, onLoad ) {
+
+		var scope = this;
+
+		var loader = new THREE.JSONLoader();
+		loader.load( url, function( geometry, materials ) {
+
+			var originalMaterial = materials[ 0 ];
+			originalMaterial.skinning = true;
+
+			THREE.SkinnedMesh.call( scope, geometry, originalMaterial );
+
+			var mixer = new THREE.AnimationMixer( scope );
+			scope.mixer = mixer;
+
+			// Create the animations
+			for ( var i = 0; i < geometry.animations.length; ++ i ) {
+
+				mixer.clipAction( geometry.animations[ i ] );
+
+			}
+
+			// Loading is complete, fire the callback
+			if ( onLoad !== undefined ) onLoad();
+
+		} );
+
+	};
+	
 	this.update = function( dt ) {
 
 		this.mixer.update( dt );

+ 6 - 23
examples/js/MD2Character.js

@@ -80,21 +80,6 @@ THREE.MD2Character = function () {
 				scope.weapons[ index ] = mesh;
 				scope.meshWeapon = mesh;
 
-
-				// the animation system requires unique names, so append the
-				// uuid of the source geometry:
-
-				var geometry = mesh.geometry,
-					animations = geometry.animations;
-
-				for ( var i = 0, n = animations.length; i !== n; ++ i ) {
-
-					var animation = animations[ i ];
-					animation.name += geometry.uuid;
-
-				}
-
-
 				checkLoadingComplete();
 
 			}
@@ -172,11 +157,10 @@ THREE.MD2Character = function () {
 				this.meshBody.activeAction = null;
 			}
 
-			var clip = THREE.AnimationClip.findByName( this.meshBody.geometry.animations, clipName );
-			if( clip ) {
+			var action = this.mixer.clipAction( clipName, this.meshBody );
+			if( action ) {
 
-				this.meshBody.activeAction =
-						this.mixer.clipAction( clip, this.meshBody ).play();
+				this.meshBody.activeAction = action.play();
 
 			}
 
@@ -202,12 +186,11 @@ THREE.MD2Character = function () {
 			var geometry = this.meshWeapon.geometry,
 				animations = geometry.animations;
 
-			var clip = THREE.AnimationClip.findByName( animations, clipName + geometry.uuid );
-			if( clip ) {
+			var action = this.mixer.clipAction( clipName, this.meshWeapon );
+			if( action ) {
 
 				this.meshWeapon.activeAction =
-						this.mixer.clipAction( clip, this.meshWeapon ).
-							syncWith( this.meshBody.activeAction ).play();
+						action.syncWith( this.meshBody.activeAction ).play();
 
 			}
 

+ 9 - 9
examples/js/Mirror.js

@@ -114,8 +114,8 @@ THREE.Mirror = function ( renderer, camera, options ) {
 
 	var parameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };
 
-	this.texture = new THREE.WebGLRenderTarget( width, height, parameters );
-	this.tempTexture = new THREE.WebGLRenderTarget( width, height, parameters );
+	this.renderTarget = new THREE.WebGLRenderTarget( width, height, parameters );
+	this.renderTarget2 = new THREE.WebGLRenderTarget( width, height, parameters );
 
 	var mirrorShader = THREE.ShaderLib[ "mirror" ];
 	var mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );
@@ -128,14 +128,14 @@ THREE.Mirror = function ( renderer, camera, options ) {
 
 	} );
 
-	this.material.uniforms.mirrorSampler.value = this.texture;
+	this.material.uniforms.mirrorSampler.value = this.renderTarget.texture;
 	this.material.uniforms.mirrorColor.value = mirrorColor;
 	this.material.uniforms.textureMatrix.value = this.textureMatrix;
 
 	if ( ! THREE.Math.isPowerOfTwo( width ) || ! THREE.Math.isPowerOfTwo( height ) ) {
 
-		this.texture.generateMipmaps = false;
-		this.tempTexture.generateMipmaps = false;
+		this.renderTarget.texture.generateMipmaps = false;
+		this.renderTarget2.texture.generateMipmaps = false;
 
 	}
 
@@ -159,14 +159,14 @@ THREE.Mirror.prototype.renderWithMirror = function ( otherMirror ) {
 
 	// render the other mirror in temp texture
 	otherMirror.renderTemp();
-	otherMirror.material.uniforms.mirrorSampler.value = otherMirror.tempTexture;
+	otherMirror.material.uniforms.mirrorSampler.value = otherMirror.renderTarget2.texture;
 
 	// render the current mirror
 	this.render();
 	this.matrixNeedsUpdate = true;
 
 	// restore material and camera of other mirror
-	otherMirror.material.uniforms.mirrorSampler.value = otherMirror.texture;
+	otherMirror.material.uniforms.mirrorSampler.value = otherMirror.renderTarget.texture;
 	otherMirror.camera = tempCamera;
 
 	// restore texture matrix of other mirror
@@ -269,7 +269,7 @@ THREE.Mirror.prototype.render = function () {
 		var visible = this.material.visible;
 		this.material.visible = false;
 
-		this.renderer.render( scene, this.mirrorCamera, this.texture, true );
+		this.renderer.render( scene, this.mirrorCamera, this.renderTarget, true );
 
 		this.material.visible = visible;
 
@@ -294,7 +294,7 @@ THREE.Mirror.prototype.renderTemp = function () {
 
 	if ( scene !== undefined && scene instanceof THREE.Scene ) {
 
-		this.renderer.render( scene, this.mirrorCamera, this.tempTexture, true );
+		this.renderer.render( scene, this.mirrorCamera, this.renderTarget2, true );
 
 	}
 

+ 1 - 1
examples/js/MorphAnimMesh.js

@@ -36,7 +36,7 @@ THREE.MorphAnimMesh.prototype.playAnimation = function ( label, fps ) {
 		
 	}
 
-	var clip = THREE.AnimationClip.findByName( this.geometry.animations, label );
+	var clip = THREE.AnimationClip.findByName( this, label );
 
 	if ( clip ) {
 

+ 14 - 14
examples/js/Ocean.js

@@ -172,8 +172,8 @@
 	} );
 	// this.materialOcean.wireframe = true;
 	this.materialOcean.uniforms.u_geometrySize = { type: "f", value: this.resolution };
-	this.materialOcean.uniforms.u_displacementMap = { type: "t", value: this.displacementMapFramebuffer };
-	this.materialOcean.uniforms.u_normalMap = { type: "t", value: this.normalMapFramebuffer };
+	this.materialOcean.uniforms.u_displacementMap = { type: "t", value: this.displacementMapFramebuffer.texture };
+	this.materialOcean.uniforms.u_normalMap = { type: "t", value: this.normalMapFramebuffer.texture };
 	this.materialOcean.uniforms.u_oceanColor = { type: "v3", value: this.oceanColor };
 	this.materialOcean.uniforms.u_skyColor = { type: "v3", value: this.skyColor };
 	this.materialOcean.uniforms.u_sunDirection = { type: "v3", value: new THREE.Vector3( this.sunDirectionX, this.sunDirectionY, this.sunDirectionZ ) };
@@ -271,7 +271,7 @@ THREE.Ocean.prototype.renderWavePhase = function () {
 
 	}else {
 
-		this.materialPhase.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer  : this.pongPhaseFramebuffer;
+		this.materialPhase.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer.texture : this.pongPhaseFramebuffer.texture;
 
 	}
 	this.materialPhase.uniforms.u_deltaTime.value = this.deltaTime;
@@ -284,10 +284,10 @@ THREE.Ocean.prototype.renderWavePhase = function () {
 THREE.Ocean.prototype.renderSpectrum = function () {
 
 	this.scene.overrideMaterial = this.materialSpectrum;
-	this.materialSpectrum.uniforms.u_initialSpectrum.value = this.initialSpectrumFramebuffer;
-	this.materialSpectrum.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer : this.pongPhaseFramebuffer;
-	this.materialSpectrum.uniforms.u_choppiness.value = this.choppiness ;
-	this.materialSpectrum.uniforms.u_size.value = this.size ;
+	this.materialSpectrum.uniforms.u_initialSpectrum.value = this.initialSpectrumFramebuffer.texture;
+	this.materialSpectrum.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer.texture : this.pongPhaseFramebuffer.texture;
+	this.materialSpectrum.uniforms.u_choppiness.value = this.choppiness;
+	this.materialSpectrum.uniforms.u_size.value = this.size;
 	this.renderer.render( this.scene, this.oceanCamera, this.spectrumFramebuffer );
 
 };
@@ -303,19 +303,19 @@ THREE.Ocean.prototype.renderSpectrumFFT = function() {
 
 		if ( i === 0 ) {
 
-			this.materialOceanHorizontal.uniforms.u_input.value = this.spectrumFramebuffer;
+			this.materialOceanHorizontal.uniforms.u_input.value = this.spectrumFramebuffer.texture;
 			this.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
 			this.renderer.render( this.scene, this.oceanCamera, this.pingTransformFramebuffer );
 
 		} else if ( i % 2 === 1 ) {
 
-			this.materialOceanHorizontal.uniforms.u_input.value = this.pingTransformFramebuffer;
+			this.materialOceanHorizontal.uniforms.u_input.value = this.pingTransformFramebuffer.texture;
 			this.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
 			this.renderer.render( this.scene, this.oceanCamera, this.pongTransformFramebuffer );
 
 		} else {
 
-			this.materialOceanHorizontal.uniforms.u_input.value = this.pongTransformFramebuffer;
+			this.materialOceanHorizontal.uniforms.u_input.value = this.pongTransformFramebuffer.texture;
 			this.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
 			this.renderer.render( this.scene, this.oceanCamera, this.pingTransformFramebuffer );
 
@@ -327,19 +327,19 @@ THREE.Ocean.prototype.renderSpectrumFFT = function() {
 
 		if ( i === iterations * 2 - 1 ) {
 
-			this.materialOceanVertical.uniforms.u_input.value = ( iterations % 2 === 0 ) ? this.pingTransformFramebuffer : this.pongTransformFramebuffer;
+			this.materialOceanVertical.uniforms.u_input.value = ( iterations % 2 === 0 ) ? this.pingTransformFramebuffer.texture : this.pongTransformFramebuffer.texture;
 			this.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
 			this.renderer.render( this.scene, this.oceanCamera, this.displacementMapFramebuffer );
 
 		} else if ( i % 2 === 1 ) {
 
-			this.materialOceanVertical.uniforms.u_input.value = this.pingTransformFramebuffer;
+			this.materialOceanVertical.uniforms.u_input.value = this.pingTransformFramebuffer.texture;
 			this.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
 			this.renderer.render( this.scene, this.oceanCamera, this.pongTransformFramebuffer );
 
 		} else {
 
-			this.materialOceanVertical.uniforms.u_input.value = this.pongTransformFramebuffer;
+			this.materialOceanVertical.uniforms.u_input.value = this.pongTransformFramebuffer.texture;
 			this.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
 			this.renderer.render( this.scene, this.oceanCamera, this.pingTransformFramebuffer );
 
@@ -353,7 +353,7 @@ THREE.Ocean.prototype.renderNormalMap = function () {
 
 	this.scene.overrideMaterial = this.materialNormal;
 	if ( this.changed ) this.materialNormal.uniforms.u_size.value = this.size;
-	this.materialNormal.uniforms.u_displacementMap.value = this.displacementMapFramebuffer;
+	this.materialNormal.uniforms.u_displacementMap.value = this.displacementMapFramebuffer.texture;
 	this.renderer.render( this.scene, this.oceanCamera, this.normalMapFramebuffer, true );
 
 };

+ 8 - 8
examples/js/SimulationRenderer.js

@@ -103,10 +103,10 @@ function SimulationRenderer( WIDTH, renderer ) {
 		rtVelocity2 = rtVelocity1.clone();
 
 		simulator.renderTexture( dtPosition, rtPosition1 );
-		simulator.renderTexture( rtPosition1, rtPosition2 );
+		simulator.renderTexture( rtPosition1.texture, rtPosition2 );
 
 		simulator.renderTexture( dtVelocity, rtVelocity1 );
-		simulator.renderTexture( rtVelocity1, rtVelocity2 );
+		simulator.renderTexture( rtVelocity1.texture, rtVelocity2 );
 
 		simulator.velocityUniforms.testing.value = 10;
 
@@ -148,7 +148,7 @@ function SimulationRenderer( WIDTH, renderer ) {
 		positionShader.uniforms.time.value = performance.now();
 		positionShader.uniforms.delta.value = delta;
 		renderer.render( scene, camera, output );
-		this.currentPosition = output;
+		this.currentPosition = output.texture;
 
 	};
 
@@ -160,7 +160,7 @@ function SimulationRenderer( WIDTH, renderer ) {
 		velocityShader.uniforms.time.value = performance.now();
 		velocityShader.uniforms.delta.value = delta;
 		renderer.render( scene, camera, output );
-		this.currentVelocity = output;
+		this.currentVelocity = output.texture;
 
 	};
 
@@ -168,13 +168,13 @@ function SimulationRenderer( WIDTH, renderer ) {
 
 		if ( flipflop ) {
 
-			simulator.renderVelocity( rtPosition1, rtVelocity1, rtVelocity2, delta );
-			simulator.renderPosition( rtPosition1, rtVelocity2, rtPosition2, delta );
+			simulator.renderVelocity( rtPosition1.texture, rtVelocity1.texture, rtVelocity2, delta );
+			simulator.renderPosition( rtPosition1.texture, rtVelocity2.texture, rtPosition2, delta );
 
 		} else {
 
-			simulator.renderVelocity( rtPosition2, rtVelocity2, rtVelocity1, delta );
-			simulator.renderPosition( rtPosition2, rtVelocity1, rtPosition1, delta );
+			simulator.renderVelocity( rtPosition2.texture, rtVelocity2.texture, rtVelocity1, delta );
+			simulator.renderPosition( rtPosition2.texture, rtVelocity1.texture, rtPosition1, delta );
 
 		}
 

+ 11 - 9
examples/js/WaterShader.js

@@ -150,9 +150,11 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 	this.lookAtPosition = new THREE.Vector3( 0, 0, - 1 );
 	this.clipPlane = new THREE.Vector4();
 
-	if ( camera instanceof THREE.PerspectiveCamera )
+	if ( camera instanceof THREE.PerspectiveCamera ) {
+
 		this.camera = camera;
-	else {
+
+	} else {
 
 		this.camera = new THREE.PerspectiveCamera();
 		console.log( this.name + ': camera is not a Perspective Camera!' );
@@ -163,8 +165,8 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 
 	this.mirrorCamera = this.camera.clone();
 
-	this.texture = new THREE.WebGLRenderTarget( width, height );
-	this.tempTexture = new THREE.WebGLRenderTarget( width, height );
+	this.renderTarget = new THREE.WebGLRenderTarget( width, height );
+	this.renderTarget2 = new THREE.WebGLRenderTarget( width, height );
 
 	var mirrorShader = THREE.ShaderLib[ "water" ];
 	var mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );
@@ -178,7 +180,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 		fog: this.fog
 	} );
 
-	this.material.uniforms.mirrorSampler.value = this.texture;
+	this.material.uniforms.mirrorSampler.value = this.renderTarget.texture;
 	this.material.uniforms.textureMatrix.value = this.textureMatrix;
 	this.material.uniforms.alpha.value = this.alpha;
 	this.material.uniforms.time.value = this.time;
@@ -192,10 +194,10 @@ THREE.Water = function ( renderer, camera, scene, options ) {
 
 	if ( ! THREE.Math.isPowerOfTwo( width ) || ! THREE.Math.isPowerOfTwo( height ) ) {
 
-		this.texture.generateMipmaps = false;
-		this.texture.minFilter = THREE.LinearFilter;
-		this.tempTexture.generateMipmaps = false;
-		this.tempTexture.minFilter = THREE.LinearFilter;
+		this.renderTarget.texture.generateMipmaps = false;
+		this.renderTarget.texture.minFilter = THREE.LinearFilter;
+		this.renderTarget2.texture.generateMipmaps = false;
+		this.renderTarget2.texture.minFilter = THREE.LinearFilter;
 
 	}
 

+ 3 - 3
examples/js/cameras/CinematicCamera.js

@@ -123,8 +123,8 @@ THREE.CinematicCamera.prototype.initPostProcessing = function () {
 
 		this.postprocessing.bokeh_uniforms = THREE.UniformsUtils.clone( bokeh_shader.uniforms );
 
-		this.postprocessing.bokeh_uniforms[ "tColor" ].value = this.postprocessing.rtTextureColor;
-		this.postprocessing.bokeh_uniforms[ "tDepth" ].value = this.postprocessing.rtTextureDepth;
+		this.postprocessing.bokeh_uniforms[ "tColor" ].value = this.postprocessing.rtTextureColor.texture;
+		this.postprocessing.bokeh_uniforms[ "tDepth" ].value = this.postprocessing.rtTextureDepth.texture;
 
 		this.postprocessing.bokeh_uniforms[ "manualdof" ].value = 0;
 		this.postprocessing.bokeh_uniforms[ "shaderFocus" ].value = 0;
@@ -135,7 +135,7 @@ THREE.CinematicCamera.prototype.initPostProcessing = function () {
 
 		this.postprocessing.bokeh_uniforms[ "focalDepth" ].value = 0.1;
 
-		console.log( this.postprocessing.bokeh_uniforms[ "focalDepth" ].value );
+		//console.log( this.postprocessing.bokeh_uniforms[ "focalDepth" ].value );
 
 		this.postprocessing.bokeh_uniforms[ "znear" ].value = this.near;
 		this.postprocessing.bokeh_uniforms[ "zfar" ].value = this.near;

+ 0 - 7
examples/js/cameras/CombinedCamera.js

@@ -189,8 +189,6 @@ THREE.CombinedCamera.prototype.toFrontView = function() {
 
 	// should we be modifing the matrix instead?
 
-	this.rotationAutoUpdate = false;
-
 };
 
 THREE.CombinedCamera.prototype.toBackView = function() {
@@ -198,7 +196,6 @@ THREE.CombinedCamera.prototype.toBackView = function() {
 	this.rotation.x = 0;
 	this.rotation.y = Math.PI;
 	this.rotation.z = 0;
-	this.rotationAutoUpdate = false;
 
 };
 
@@ -207,7 +204,6 @@ THREE.CombinedCamera.prototype.toLeftView = function() {
 	this.rotation.x = 0;
 	this.rotation.y = - Math.PI / 2;
 	this.rotation.z = 0;
-	this.rotationAutoUpdate = false;
 
 };
 
@@ -216,7 +212,6 @@ THREE.CombinedCamera.prototype.toRightView = function() {
 	this.rotation.x = 0;
 	this.rotation.y = Math.PI / 2;
 	this.rotation.z = 0;
-	this.rotationAutoUpdate = false;
 
 };
 
@@ -225,7 +220,6 @@ THREE.CombinedCamera.prototype.toTopView = function() {
 	this.rotation.x = - Math.PI / 2;
 	this.rotation.y = 0;
 	this.rotation.z = 0;
-	this.rotationAutoUpdate = false;
 
 };
 
@@ -234,6 +228,5 @@ THREE.CombinedCamera.prototype.toBottomView = function() {
 	this.rotation.x = Math.PI / 2;
 	this.rotation.y = 0;
 	this.rotation.z = 0;
-	this.rotationAutoUpdate = false;
 
 };

+ 6 - 6
examples/js/controls/OrbitControls.js

@@ -86,13 +86,13 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 	this.getPolarAngle = function () {
 
-		return phi;
+		return spherical.phi;
 
 	};
 
 	this.getAzimuthalAngle = function () {
 
-		return theta;
+		return spherical.theta;
 
 	};
 
@@ -1003,14 +1003,14 @@ Object.defineProperties( THREE.OrbitControls.prototype, {
 		get: function () {
 
 			console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );
-			return ! this.constraint.enableDamping;
+			return ! this.enableDamping;
 
 		},
 
 		set: function ( value ) {
 
 			console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );
-			this.constraint.enableDamping = ! value;
+			this.enableDamping = ! value;
 
 		}
 
@@ -1021,14 +1021,14 @@ Object.defineProperties( THREE.OrbitControls.prototype, {
 		get: function () {
 
 			console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );
-			return this.constraint.dampingFactor;
+			return this.dampingFactor;
 
 		},
 
 		set: function ( value ) {
 
 			console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );
-			this.constraint.dampingFactor = value;
+			this.dampingFactor = value;
 
 		}
 

+ 12 - 13
examples/js/controls/TransformControls.js

@@ -7,7 +7,6 @@
 
 	'use strict';
 
-
 	var GizmoMaterial = function ( parameters ) {
 
 		THREE.MeshBasicMaterial.call( this );
@@ -281,15 +280,15 @@
 		this.pickerGizmos = {
 
 			X: [
-				[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0.6, 0, 0 ], [ 0, 0, - Math.PI / 2 ] ]
+				[ new THREE.Mesh( new THREE.CylinderBufferGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0.6, 0, 0 ], [ 0, 0, - Math.PI / 2 ] ]
 			],
 
 			Y: [
-				[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0.6, 0 ] ]
+				[ new THREE.Mesh( new THREE.CylinderBufferGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0.6, 0 ] ]
 			],
 
 			Z: [
-				[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0, 0.6 ], [ Math.PI / 2, 0, 0 ] ]
+				[ new THREE.Mesh( new THREE.CylinderBufferGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0, 0.6 ], [ Math.PI / 2, 0, 0 ] ]
 			],
 
 			XYZ: [
@@ -406,19 +405,19 @@
 		this.pickerGizmos = {
 
 			X: [
-				[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), pickerMaterial ), [ 0, 0, 0 ], [ 0, - Math.PI / 2, - Math.PI / 2 ] ]
+				[ new THREE.Mesh( new THREE.TorusBufferGeometry( 1, 0.12, 4, 12, Math.PI ), pickerMaterial ), [ 0, 0, 0 ], [ 0, - Math.PI / 2, - Math.PI / 2 ] ]
 			],
 
 			Y: [
-				[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), pickerMaterial ), [ 0, 0, 0 ], [ Math.PI / 2, 0, 0 ] ]
+				[ new THREE.Mesh( new THREE.TorusBufferGeometry( 1, 0.12, 4, 12, Math.PI ), pickerMaterial ), [ 0, 0, 0 ], [ Math.PI / 2, 0, 0 ] ]
 			],
 
 			Z: [
-				[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), pickerMaterial ), [ 0, 0, 0 ], [ 0, 0, - Math.PI / 2 ] ]
+				[ new THREE.Mesh( new THREE.TorusBufferGeometry( 1, 0.12, 4, 12, Math.PI ), pickerMaterial ), [ 0, 0, 0 ], [ 0, 0, - Math.PI / 2 ] ]
 			],
 
 			E: [
-				[ new THREE.Mesh( new THREE.TorusGeometry( 1.25, 0.12, 2, 24 ), pickerMaterial ) ]
+				[ new THREE.Mesh( new THREE.TorusBufferGeometry( 1.25, 0.12, 2, 24 ), pickerMaterial ) ]
 			],
 
 			XYZE: [
@@ -544,7 +543,7 @@
 			],
 
 			XYZ: [
-				[ new THREE.Mesh( new THREE.BoxGeometry( 0.125, 0.125, 0.125 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]
+				[ new THREE.Mesh( new THREE.BoxBufferGeometry( 0.125, 0.125, 0.125 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]
 			]
 
 		};
@@ -552,19 +551,19 @@
 		this.pickerGizmos = {
 
 			X: [
-				[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0.6, 0, 0 ], [ 0, 0, - Math.PI / 2 ] ]
+				[ new THREE.Mesh( new THREE.CylinderBufferGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0.6, 0, 0 ], [ 0, 0, - Math.PI / 2 ] ]
 			],
 
 			Y: [
-				[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0.6, 0 ] ]
+				[ new THREE.Mesh( new THREE.CylinderBufferGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0.6, 0 ] ]
 			],
 
 			Z: [
-				[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0, 0.6 ], [ Math.PI / 2, 0, 0 ] ]
+				[ new THREE.Mesh( new THREE.CylinderBufferGeometry( 0.2, 0, 1, 4, 1, false ), pickerMaterial ), [ 0, 0, 0.6 ], [ Math.PI / 2, 0, 0 ] ]
 			],
 
 			XYZ: [
-				[ new THREE.Mesh( new THREE.BoxGeometry( 0.4, 0.4, 0.4 ), pickerMaterial ) ]
+				[ new THREE.Mesh( new THREE.BoxBufferGeometry( 0.4, 0.4, 0.4 ), pickerMaterial ) ]
 			]
 
 		};

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

@@ -94,8 +94,8 @@ function Transition ( sceneA, sceneB ) {
 	this.sceneA = sceneA;
 	this.sceneB = sceneB;
 
-	this.quadmaterial.uniforms.tDiffuse1.value = sceneA.fbo;
-	this.quadmaterial.uniforms.tDiffuse2.value = sceneB.fbo;
+	this.quadmaterial.uniforms.tDiffuse1.value = sceneA.fbo.texture;
+	this.quadmaterial.uniforms.tDiffuse2.value = sceneB.fbo.texture;
 
 	this.needChange = false;
 

+ 2 - 2
examples/js/effects/AnaglyphEffect.js

@@ -46,8 +46,8 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
 
 		uniforms: {
 
-			"mapLeft": { type: "t", value: _renderTargetL },
-			"mapRight": { type: "t", value: _renderTargetR },
+			"mapLeft": { type: "t", value: _renderTargetL.texture },
+			"mapRight": { type: "t", value: _renderTargetR.texture },
 
 			"colorMatrixLeft": { type: "m3", value: this.colorMatrixLeft },
 			"colorMatrixRight": { type: "m3", value: this.colorMatrixRight }

+ 2 - 2
examples/js/effects/ParallaxBarrierEffect.js

@@ -21,8 +21,8 @@ THREE.ParallaxBarrierEffect = function ( renderer ) {
 
 		uniforms: {
 
-			"mapLeft": { type: "t", value: _renderTargetL },
-			"mapRight": { type: "t", value: _renderTargetR }
+			"mapLeft": { type: "t", value: _renderTargetL.texture },
+			"mapRight": { type: "t", value: _renderTargetR.texture }
 
 		},
 

+ 48 - 27
examples/js/effects/VREffect.js

@@ -68,7 +68,7 @@ THREE.VREffect = function ( renderer, onError ) {
 
 	this.setSize = function ( width, height ) {
 
-		renderSize = { width: width, height: height };
+		rendererSize = { width: width, height: height };
 
 		if ( isPresenting ) {
 
@@ -98,11 +98,20 @@ THREE.VREffect = function ( renderer, onError ) {
 	// fullscreen
 
 	var canvas = renderer.domElement;
-	var fullscreenchange = canvas.mozRequestFullScreen ? 'mozfullscreenchange' : 'webkitfullscreenchange';
+	var requestFullscreen;
+	var exitFullscreen;
+	var fullscreenElement;
 
-	document.addEventListener( fullscreenchange, function () {
+	function onFullscreenChange () {
 
-		isPresenting = isDeprecatedAPI && vrHMD && ( document.mozFullScreenElement || document.webkitFullscreenElement ) !== undefined;
+		var wasPresenting = isPresenting;
+		isPresenting = vrHMD !== undefined && ( vrHMD.isPresenting || ( isDeprecatedAPI && document[ fullscreenElement ] instanceof window.HTMLElement ) );
+
+		if ( wasPresenting === isPresenting ) {
+
+			return;
+
+		}
 
 		if ( isPresenting ) {
 
@@ -110,8 +119,22 @@ THREE.VREffect = function ( renderer, onError ) {
 			rendererSize = renderer.getSize();
 
 			var eyeParamsL = vrHMD.getEyeParameters( 'left' );
+			var eyeWidth, eyeHeight;
+
+			if ( isDeprecatedAPI ) {
+
+				eyeWidth = eyeParamsL.renderRect.width;
+				eyeHeight = eyeParamsL.renderRect.height;
+
+			} else {
+
+				eyeWidth = eyeParamsL.renderWidth;
+				eyeHeight = eyeParamsL.renderHeight;
+
+			}
+
 			renderer.setPixelRatio( 1 );
-			renderer.setSize( eyeParamsL.renderRect.width * 2, eyeParamsL.renderRect.height, false );
+			renderer.setSize( eyeWidth * 2, eyeHeight, false );
 
 		} else {
 
@@ -120,29 +143,32 @@ THREE.VREffect = function ( renderer, onError ) {
 
 		}
 
-	}, false );
-
-	window.addEventListener( 'vrdisplaypresentchange', function () {
+	}
 
-		isPresenting = vrHMD && vrHMD.isPresenting;
+	if ( canvas.requestFullscreen ) {
 
-		if ( isPresenting ) {
+		requestFullscreen = 'requestFullscreen';
+		fullscreenElement = 'fullscreenElement';
+		exitFullscreen = 'exitFullscreen';
+		document.addEventListener( 'fullscreenchange', onFullscreenChange, false );
 
-			rendererPixelRatio = renderer.getPixelRatio();
-			rendererSize = renderer.getSize();
+	} else if ( canvas.mozRequestFullScreen ) {
 
-			var eyeParamsL = vrHMD.getEyeParameters( 'left' );
-			renderer.setPixelRatio( 1 );
-			renderer.setSize( eyeParamsL.renderWidth * 2, eyeParamsL.renderHeight, false );
+		requestFullscreen = 'mozRequestFullScreen';
+		fullscreenElement = 'mozFullScreenElement';
+		exitFullscreen = 'mozCancelFullScreen';
+		document.addEventListener( 'mozfullscreenchange', onFullscreenChange, false );
 
-		} else {
+	} else {
 
-			renderer.setPixelRatio( rendererPixelRatio );
-			renderer.setSize( rendererSize.width, rendererSize.height );
+		requestFullscreen = 'webkitRequestFullscreen';
+		fullscreenElement = 'webkitFullscreenElement';
+		exitFullscreen = 'webkitExitFullscreen';
+		document.addEventListener( 'webkitfullscreenchange', onFullscreenChange, false );
 
-		}
+	}
 
-	}, false );
+	window.addEventListener( 'vrdisplaypresentchange', onFullscreenChange, false );
 
 	this.setFullScreen = function ( boolean ) {
 
@@ -175,14 +201,9 @@ THREE.VREffect = function ( renderer, onError ) {
 
 			} else {
 
-				if ( canvas.mozRequestFullScreen ) {
-
-					canvas.mozRequestFullScreen( { vrDisplay: vrHMD } );
-					resolve();
-
-				} else if ( canvas.webkitRequestFullscreen ) {
+				if ( canvas[ requestFullscreen ] ) {
 
-					canvas.webkitRequestFullscreen( { vrDisplay: vrHMD } );
+					canvas[ boolean ? requestFullscreen : exitFullscreen ]( { vrDisplay: vrHMD } );
 					resolve();
 
 				} else {

+ 0 - 49
examples/js/libs/photons.min.js

@@ -1,49 +0,0 @@
-var PHOTONS=PHOTONS||{};PHOTONS.Atlas=function(a,b){this.texture=a;this.imageCount=0;this.imageDescriptors=[];b&&this.addImageDescriptor(0,1,1,0)};PHOTONS.Atlas.ImageDescriptor=function(a,b,c,e){this.left=a;this.top=b;this.right=c;this.bottom=e};PHOTONS.Atlas.prototype.addImageDescriptor=function(a,b,c,e){this.imageDescriptors[this.imageCount]=new PHOTONS.Atlas.ImageDescriptor(a,b,c,e);this.imageCount++};PHOTONS.Atlas.prototype.getImageDescriptor=function(a){return this.imageDescriptors[a]};
-PHOTONS.Atlas.prototype.getTexture=function(){return this.texture};PHOTONS.Atlas.createGridAtlas=function(a,b,c,e,f,d,g,h,k){a=new PHOTONS.Atlas(a);e=(e-b)/d;c=(c-f)/g;var n=1,l=1,m=0,p=0,q=d,r=g;h&&(n=-1,m=d-1,q=-1);k&&(l=-1,p=g-1,r=-1);for(d=p;d!=r;d+=l)for(g=m;g!=q;g+=n)h=b+e*g,k=f+c*(d+1),a.addImageDescriptor(h,k,h+e,k-c);return a};PHOTONS=PHOTONS||{};PHOTONS.Modifier=function(){};PHOTONS.RandomModifier=function(a){PHOTONS.Modifier.call(this);a||(a={});if(!a.range)throw"Particles.RandomModifier: No range specified.";if(!a.offset)throw"Particles.RandomModifier: No offset specified.";this.range=a.range;this.offset=a.offset;this.rangeType=a.rangeType||PHOTONS.RangeType.Cube;this.rangeEdgeClamp=void 0!==a.rangeEdgeClamp&&null!==a.rangeEdgeClamp?a.rangeEdgeClamp:!1};PHOTONS.RandomModifier.prototype=Object.create(PHOTONS.Modifier.prototype);
-PHOTONS.RandomModifier.prototype.update=function(a,b){this.rangeType==PHOTONS.RangeType.Cube?PHOTONS.Random.getRandomVectorCube(b,this.offset,this.range,this.rangeEdgeClamp):this.rangeType==PHOTONS.RangeType.Sphere&&PHOTONS.Random.getRandomVectorSphere(b,this.offset,this.range,this.rangeEdgeClamp)};PHOTONS.FrameSetModifier=function(a){PHOTONS.Modifier.call(this);this.frameset=a};PHOTONS.FrameSetModifier.prototype=Object.create(PHOTONS.Modifier.prototype);
-PHOTONS.FrameSetModifier.prototype.update=function(a,b){this.frameset.interpolateFrameValues(a.age,b)};PHOTONS.EvenIntervalIndexModifier=function(a){PHOTONS.Modifier.call(this);this.totalSteps=Math.floor(a||1)};PHOTONS.EvenIntervalIndexModifier.prototype=Object.create(PHOTONS.Modifier.prototype);PHOTONS.EvenIntervalIndexModifier.prototype.update=function(a,b){var c=Math.floor(a.age/a.lifeSpan*this.totalSteps);c==this.totalSteps&&0<c&&c--;b.set(c,c,c)};PHOTONS=PHOTONS||{};PHOTONS.RangeType=Object.freeze({Cube:1,Sphere:2,Plane:3});PHOTONS.Constants=Object.freeze({VerticesPerParticle:6,DegreesToRadians:Math.PI/180});PHOTONS.Random=PHOTONS.Random||{};PHOTONS.Random.getRandomVectorCube=function(a,b,c,e){a.set(Math.random()-.5,Math.random()-.5,Math.random()-.5,Math.random()-.5);e&&a.multiplyScalar(1/Math.max(Math.abs(a.x),Math.max(Math.abs(a.y),Math.abs(a.z))));a.multiplyVectors(c,a);a.addVectors(b,a)};
-PHOTONS.Random.getRandomVectorSphere=function(a,b,c,e){a.set(Math.random()-.5,Math.random()-.5,Math.random()-.5,Math.random()-.5);a.normalize();a.multiplyVectors(a,c);e||a.multiplyScalar(2*Math.random()-1);a.addVectors(a,b)};PHOTONS.SingularVector=function(a){this.x=a};PHOTONS.SingularVector.prototype.copy=function(a){this.x=a.x};PHOTONS.SingularVector.prototype.set=function(a){this.x=a};PHOTONS.SingularVector.prototype.normalize=function(){};
-PHOTONS.SingularVector.prototype.multiplyScalar=function(a){this.x*=a};PHOTONS.SingularVector.prototype.lerp=function(a,b){this.x+=b*(a.x-this.x)};PHOTONS.SingularVector.prototype.addVectors=function(a,b){a.x+=b};PHOTONS.SingularVector.prototype.multiplyVectors=function(a,b){a.x*=b.x};PHOTONS=PHOTONS||{};
-PHOTONS.ParticleSystem=function(){THREE.Object3D.call(this);this.zSort=!1;this.matrixAutoUpdate=this.simulateInLocalSpace=!0;this.releaseAtOnce=!1;this.releaseAtOnceCount=0;this.isActive=this.hasInitialReleaseOccurred=!1;this.sizeInitializer=this.alphaInitializer=this.colorInitializer=this.atlasInitializer=PHOTONS.ParticleSystem.DefaultInitializer;this.sizeUpdater=this.alphaUpdater=this.colorUpdater=this.atlasUpdater=PHOTONS.ParticleSystem.DefaultUpdater;this.positionUpdater=PHOTONS.ParticleSystem.DefaultPositionUpdater;this.velocityUpdater=
-PHOTONS.ParticleSystem.DefaultVelocityUpdater;this.accelerationUpdater=PHOTONS.ParticleSystem.DefaultUpdater;this.accelerationInitializer=this.velocityInitializer=this.positionInitializer=PHOTONS.ParticleSystem.DefaultInitializer;this.rotationUpdater=PHOTONS.ParticleSystem.DefaultRotationUpdater;this.rotationalSpeedUpdater=PHOTONS.ParticleSystem.DefaultRotationalSpeedUpdater;this.rotationalAccelerationUpdater=PHOTONS.ParticleSystem.DefaultUpdater;this.rotationalAccelerationInitializer=this.rotationalSpeedInitializer=
-this.rotationInitializer=PHOTONS.ParticleSystem.DefaultInitializer;this.particleReleaseRate=100;this.averageParticleLifeSpan=this.particleLifeSpan=1;this.calculateAverageParticleLifeSpan();this.calculateMaxParticleCount();this.deadParticleCount=this.liveParticleCount=0;this.liveParticleArray=[];this.deadParticleArray=[];this._tempParticleArray=[];this.timeSinceLastEmit=0;this.emitting=!0;this.lifespan=this.age=0;this._tempVector3=new THREE.Vector3;this._tempQuaternion=new THREE.Quaternion;this._tempMatrix4=
-new THREE.Matrix4};PHOTONS.ParticleSystem.prototype=Object.create(THREE.Object3D.prototype);PHOTONS.ParticleSystem.prototype.constructor=PHOTONS.ParticleSystem;PHOTONS.ParticleSystem.Shader=PHOTONS.ParticleSystem.Shader||{};PHOTONS.ParticleSystem.Shader.VertexVars="attribute vec4 customColor;\nattribute vec2 size;\nattribute float rotation;\nattribute float customIndex;\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec3 cameraaxisx;\nuniform vec3 cameraaxisy;\nuniform vec3 cameraaxisz;";
-PHOTONS.ParticleSystem.Shader.FragmentVars="varying vec2 vUV;\nvarying vec4 vColor;\nuniform sampler2D texture;";PHOTONS.ParticleSystem.Shader.ParticleVertexQuadPositionFunction="vec4 getQuadPosition() {\nvec3 axisX = cameraaxisx;\nvec3 axisY = cameraaxisy;\nvec3 axisZ = cameraaxisz;\naxisX *= cos( rotation );\naxisY *= sin( rotation );\naxisX += axisY;\naxisY = cross( axisZ, axisX );\nvec3 edge = vec3( 2.0, customIndex, 3.0 );\nvec3 test = vec3( customIndex, 0.5, customIndex );\nvec3 result = step( edge, test );\nfloat xFactor = -1.0 + ( result.x * 2.0 );\nfloat yFactor = -1.0 + ( result.y * 2.0 ) + ( result.z * 2.0 );\naxisX *= size.x * xFactor;\naxisY *= size.y * yFactor;\nreturn ( modelMatrix * vec4( position, 1.0 ) ) + vec4( axisX + axisY, 0.0 );\n}";
-PHOTONS.ParticleSystem.Shader.VertexShader=[PHOTONS.ParticleSystem.Shader.VertexVars,PHOTONS.ParticleSystem.Shader.ParticleVertexQuadPositionFunction,"void main() { \nvColor = customColor;\nvUV = uv;\nvec4 quadPos = getQuadPosition();\ngl_Position = projectionMatrix * viewMatrix * quadPos;\n}"].join("\n");PHOTONS.ParticleSystem.Shader.FragmentShader=[PHOTONS.ParticleSystem.Shader.FragmentVars,"void main() { \nvec4 textureColor = texture2D( texture,  vUV );\ngl_FragColor = vColor * textureColor;\n}"].join("\n");
-PHOTONS.ParticleSystem.createMaterial=function(a,b,c){c=c||{};c.texture={type:"t",value:null};c.cameraaxisx={type:"v3",value:new THREE.Vector3};c.cameraaxisy={type:"v3",value:new THREE.Vector3};c.cameraaxisz={type:"v3",value:new THREE.Vector3};a=a||PHOTONS.ParticleSystem.Shader.VertexShader;b=b||PHOTONS.ParticleSystem.Shader.FragmentShader;return new THREE.ShaderMaterial({uniforms:c,vertexShader:a,fragmentShader:b,transparent:!0,alphaTest:.5,blending:THREE.NormalBlending,depthTest:!0,depthWrite:!1})};
-PHOTONS.ParticleSystem.prototype.calculateAverageParticleLifeSpan=function(){for(var a=0,b=0;100>b;b++)a+=this.particleLifeSpan;this.averageParticleLifeSpan=a/100};PHOTONS.ParticleSystem.prototype.calculateMaxParticleCount=function(){if(this.releaseAtOnce)this.maxParticleCount=this.releaseAtOnceCount;else{var a=this.particleLifeSpan;0!=this.lifespan&&this.lifespan<a&&(a=this.lifespan);this.maxParticleCount=Math.max(this.particleReleaseRate*a*2,1)}this.vertexCount=this.maxParticleCount*PHOTONS.Constants.VerticesPerParticle};
-PHOTONS.ParticleSystem.prototype.initializeGeometry=function(){this.particleGeometry=new THREE.BufferGeometry;var a=new Float32Array(4*this.vertexCount);new Float32Array(this.vertexCount);var b=new Float32Array(3*this.vertexCount),c=new Float32Array(2*this.vertexCount),e=new Float32Array(2*this.vertexCount),f=new Float32Array(this.vertexCount),d=new Float32Array(this.vertexCount),a=new THREE.BufferAttribute(a,4);a.setDynamic(!0);this.particleGeometry.addAttribute("customColor",a);b=new THREE.BufferAttribute(b,
-3);b.setDynamic(!0);this.particleGeometry.addAttribute("position",b);c=new THREE.BufferAttribute(c,2);c.setDynamic(!0);this.particleGeometry.addAttribute("uv",c);e=new THREE.BufferAttribute(e,2);e.setDynamic(!0);this.particleGeometry.addAttribute("size",e);f=new THREE.BufferAttribute(f,1);f.setDynamic(!0);this.particleGeometry.addAttribute("rotation",f);d=new THREE.BufferAttribute(d,1);d.setDynamic(!0);this.particleGeometry.addAttribute("customIndex",d)};
-PHOTONS.ParticleSystem.prototype.initializeMaterial=function(a){this.particleMaterial=a};PHOTONS.ParticleSystem.prototype.initializeMesh=function(){this.destroyMesh();this.particleMesh=new THREE.Mesh(this.particleGeometry,this.particleMaterial);this.particleMesh.dynamic=!0;this.particleMesh.matrixAutoUpdate=!1};PHOTONS.ParticleSystem.prototype.destroyMesh=function(){this.particleMesh&&(this.scene.remove(this.particleMesh),this.particleMesh=void 0)};
-PHOTONS.ParticleSystem.prototype.initializeParticleArray=function(){for(var a=0;a<this.maxParticleCount;a++){var b=this.createParticle();this.initializeParticle(b);this.deadParticleArray[a]=b}this.liveParticleCount=0;this.deadParticleCount=this.maxParticleCount;this.liveParticleArray.length=this.liveParticleCount;this.deadParticleArray.length=this.deadParticleCount};PHOTONS.ParticleSystem.prototype.mergeParameters=function(a){for(var b in a)this[b]=a[b]};
-PHOTONS.ParticleSystem.prototype.bindInitializer=function(a,b){a&&(this[a+"Initializer"]=b)};PHOTONS.ParticleSystem.prototype.bindUpdater=function(a,b){a&&(this[a+"Updater"]=b)};PHOTONS.ParticleSystem.prototype.bindModifier=function(a,b){this.bindInitializer(a,b);this.bindUpdater(a,b)};
-PHOTONS.ParticleSystem.prototype.initialize=function(a,b,c){this.camera=a;this.scene=b;this.alphaFrameSet=this.colorFrameSet=this.sizeFrameSet=void 0;c&&this.mergeParameters(c);this.sizeFrameSet||(this.sizeFrameSet=new PHOTONS.FrameSet);this.colorFrameSet||(this.colorFrameSet=new PHOTONS.FrameSet);this.alphaFrameSet||(this.alphaFrameSet=new PHOTONS.FrameSet);this.liveParticleArray=[];this.age=this.timeSinceLastEmit=0;this.emitting=!0;this.calculateAverageParticleLifeSpan();this.calculateMaxParticleCount();
-this.initializeParticleArray();this.initializeGeometry();this.initializeMaterial(c.material);this.updateAttributesWithParticleData();this.initializeMesh()};PHOTONS.ParticleSystem.prototype.getCameraWorldAxes=function(){var a=new THREE.Quaternion;return function(b,c,e,f){b.getWorldQuaternion(a);f.set(0,0,1).applyQuaternion(a);e.set(0,1,0).applyQuaternion(a);c.crossVectors(e,f)}}();
-PHOTONS.ParticleSystem.prototype.generateXYAlignedQuadForParticle=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,e,f,d,g,h,k,n){var l=c.position,m=c.rotation;a.copy(e);b.copy(f);a.multiplyScalar(Math.cos(m*PHOTONS.Constants.DegreesToRadians));b.multiplyScalar(Math.sin(m*PHOTONS.Constants.DegreesToRadians));a.addVectors(a,b);b.crossVectors(d,a);a.multiplyScalar(c.size.x);b.multiplyScalar(c.size.y);g.subVectors(l,a).addVectors(g,b);h.subVectors(l,a).subVectors(h,b);k.addVectors(l,
-a).subVectors(k,b);n.addVectors(l,a).addVectors(n,b)}}();
-PHOTONS.ParticleSystem.prototype.updateAttributesWithParticleData=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;return function(){this.getCameraWorldAxes(this.camera,b,a,c);this.particleMaterial.uniforms.cameraaxisx.value.copy(b);this.particleMaterial.uniforms.cameraaxisy.value.copy(a);this.particleMaterial.uniforms.cameraaxisz.value.copy(c);this.particleMaterial.uniforms.texture.value=this.particleAtlas.getTexture();
-for(var e=0;e<this.liveParticleCount;e++){var f=this.liveParticleArray[e],d=f.position,g=e*PHOTONS.Constants.VerticesPerParticle,h=this.particleGeometry.getAttribute("position");this.updateAttributeVector3(h,g,d);this.updateAttributeVector3(h,g+1,d);this.updateAttributeVector3(h,g+2,d);this.updateAttributeVector3(h,g+3,d);this.updateAttributeVector3(h,g+4,d);this.updateAttributeVector3(h,g+5,d);d=this.particleAtlas.getImageDescriptor(f.atlasIndex.x);h=this.particleGeometry.getAttribute("uv");this.updateAttributeVector2XY(h,
-g,d.left,d.top);this.updateAttributeVector2XY(h,g+1,d.left,d.bottom);this.updateAttributeVector2XY(h,g+2,d.right,d.top);this.updateAttributeVector2XY(h,g+3,d.left,d.bottom);this.updateAttributeVector2XY(h,g+4,d.right,d.bottom);this.updateAttributeVector2XY(h,g+5,d.right,d.top);d=f.color;d.a=f.alpha.x;for(var h=f.size,f=f.rotation.x*PHOTONS.Constants.DegreesToRadians,k=this.particleGeometry.getAttribute("customColor"),n=this.particleGeometry.getAttribute("size"),l=this.particleGeometry.getAttribute("rotation"),
-m=0;m<PHOTONS.Constants.VerticesPerParticle;m++){var p=g+m;this.updateAttributeColor(k,p,d);this.updateAttributeVector2XY(n,p,h.x,h.y);this.updateAttributeScalar(l,p,f)}d=this.particleGeometry.getAttribute("customIndex");this.updateAttributeScalar(d,g,0);this.updateAttributeScalar(d,g+1,1);this.updateAttributeScalar(d,g+2,3);this.updateAttributeScalar(d,g+3,1);this.updateAttributeScalar(d,g+4,2);this.updateAttributeScalar(d,g+5,3)}this.particleGeometry.setDrawRange(0,PHOTONS.Constants.VerticesPerParticle*
-this.liveParticleCount)}}();PHOTONS.ParticleSystem.prototype.updateAttributeVector2XY=function(a,b,c,e){a.array[2*b]=c;a.array[2*b+1]=e;a.needsUpdate=!0};PHOTONS.ParticleSystem.prototype.updateAttributeVector3=function(a,b,c){a.array[3*b]=c.x;a.array[3*b+1]=c.y;a.array[3*b+2]=c.z;a.needsUpdate=!0};PHOTONS.ParticleSystem.prototype.updateAttributeColor=function(a,b,c){a.array[4*b]=c.r;a.array[4*b+1]=c.g;a.array[4*b+2]=c.b;a.array[4*b+3]=c.a;a.needsUpdate=!0};
-PHOTONS.ParticleSystem.prototype.updateAttributeScalar=function(a,b,c){a.array[b]=c;a.needsUpdate=!0};PHOTONS.ParticleSystem.prototype.createParticle=function(){return new PHOTONS.Particle};PHOTONS.ParticleSystem.prototype.initializeParticle=function(a){this.resetParticle(a)};PHOTONS.ParticleSystem.prototype.resetParticle=function(a){a.age=0;a.alive=0;this.resetParticleDisplayAttributes(a);this.resetParticlePositionData(a);this.resetParticleRotationData(a)};
-PHOTONS.ParticleSystem.prototype.resetParticleDisplayAttributes=function(a){this.atlasInitializer.update(a,a.atlasIndex,0);this.sizeInitializer.update(a,a.size,0);this.colorInitializer.update(a,a._tempVector3,0);a.color.setRGB(a._tempVector3.x,a._tempVector3.y,a._tempVector3.z);this.alphaInitializer.update(a,a.alpha,0)};
-PHOTONS.ParticleSystem.prototype.resetParticlePositionData=function(a){this.positionInitializer.update(a,a.position,0);this.simulateInLocalSpace||(a._tempVector3.setFromMatrixPosition(this.matrixWorld),a.position.addVectors(a._tempVector3,a.position));this.velocityInitializer.update(a,a.velocity,0);this.accelerationInitializer.update(a,a.acceleration,0)};
-PHOTONS.ParticleSystem.prototype.resetParticleRotationData=function(a){this.rotationInitializer.update(a,a.rotation);this.rotationalSpeedInitializer.update(a,a.rotationalSpeed);this.rotationalAccelerationInitializer.update(a,a.rotationalAcceleration)};PHOTONS.ParticleSystem.prototype.advanceParticle=function(a,b){a.age+=b;this.advanceParticleDisplayAttributes(a,b);this.advanceParticlePositionData(a,b);this.advanceParticleRotationData(a,b)};
-PHOTONS.ParticleSystem.prototype.advanceParticleDisplayAttributes=function(a,b){this.atlasUpdater.update(a,a.atlasIndex,b);this.sizeUpdater.update(a,a.size,b);this.colorUpdater.update(a,a._tempVector3,b);a.color.setRGB(a._tempVector3.x,a._tempVector3.y,a._tempVector3.z);this.alphaUpdater.update(a,a.alpha,b)};
-PHOTONS.ParticleSystem.prototype.advanceParticlePositionData=function(a,b){this.positionUpdater.update(a,a.position,b);this.velocityUpdater.update(a,a.velocity,b);this.accelerationUpdater.update(a,a.acceleration,b)};PHOTONS.ParticleSystem.prototype.advanceParticleRotationData=function(a,b){this.rotationUpdater.update(a,a.rotation,b);this.rotationalSpeedUpdater.update(a,a.rotationalSpeed,b);this.rotationalAccelerationUpdater.update(a,a.rotationalAcceleration,b)};
-PHOTONS.ParticleSystem.prototype.advanceParticles=function(a){for(var b=0,c=0;c<this.liveParticleCount;c++){var e=this.liveParticleArray[c];this.advanceParticle(e,a);e.age>e.lifeSpan&&(this.killParticle(e),b++)}0<b&&this.cleanupDeadParticles()};PHOTONS.ParticleSystem.prototype.killParticle=function(a){a.alive=0};PHOTONS.ParticleSystem.prototype.activateParticle=function(a){this.resetParticle(a);a.lifeSpan=this.particleLifeSpan;a.alive=1};
-PHOTONS.ParticleSystem.prototype.cleanupDeadParticles=function(){for(var a=this.liveParticleCount-1,b=0;a>b;){for(;0==this.liveParticleArray[a].alive&&0<a;)a--;for(;1==this.liveParticleArray[b].alive&&b<this.liveParticleCount-1;)b++;if(a<=b)break;var c=this.liveParticleArray[b];this.liveParticleArray[b]=this.liveParticleArray[a];this.liveParticleArray[a]=c}for(;0<this.liveParticleCount&&0==this.liveParticleArray[this.liveParticleCount-1].alive;)this.deadParticleArray[this.deadParticleCount]=this.liveParticleArray[this.liveParticleCount-
-1],this.deadParticleCount++,this.liveParticleCount--;this.liveParticleArray.length=this.liveParticleCount;this.deadParticleArray.length=this.deadParticleCount};
-PHOTONS.ParticleSystem.prototype.sortParticleArray=function(){function a(a,b){return a[0]-b[0]}var b=[],c=new THREE.Vector3;return function(e){for(var f=0;f<this.liveParticleCount;f++)c.copy(this.liveParticleArray[f].position),c.applyProjection(e),b[f]||(b[f]=[0,0]),b[f][0]=c.z,b[f][1]=f;b.length=this.liveParticleCount;b.sort(a);for(f=0;f<this.liveParticleCount;f++)this._tempParticleArray[f]=this.liveParticleArray[b[f][1]];this._tempParticleArray.length=this.liveParticleCount;e=this.liveParticleArray;
-this.liveParticleArray=this._tempParticleArray;this._tempParticleArray=e}}();
-PHOTONS.ParticleSystem.prototype.activateParticles=function(a){for(var b=0;b<a;b++)if(this.liveParticleCount<this.maxParticleCount&&0<this.deadParticleCount){var c=this.deadParticleArray[this.deadParticleCount-1];this.liveParticleArray[this.liveParticleCount]=c;this.deadParticleCount--;this.liveParticleCount++;this.activateParticle(c)}else break;this.liveParticleArray.length=this.liveParticleCount;this.deadParticleArray.length=this.deadParticleCount};
-PHOTONS.ParticleSystem.prototype.update=function(){var a=new THREE.Matrix4;return function(b){if(this.emitting&&this.isActive){this.timeSinceLastEmit+=b;if(this.releaseAtOnce){var c=this.averageParticleLifeSpan;if(!this.hasInitialReleaseOccurred||this.timeSinceLastEmit>c&&0>=this.liveParticleCount)this.activateParticles(this.maxParticleCount),this.timeSinceLastEmit=0,this.hasInitialReleaseOccurred=!0}else if(c=1/this.particleReleaseRate,!this.hasInitialReleaseOccurred||this.timeSinceLastEmit>c)this.activateParticles(Math.max(1,
-Math.floor(this.timeSinceLastEmit/c))),this.timeSinceLastEmit=0,this.hasInitialReleaseOccurred=!0;this.advanceParticles(b);this.zSort&&(this.camera.updateMatrixWorld(),a.copy(this.camera.matrixWorld),a.getInverse(a),this.sortParticleArray(a));this.updateAttributesWithParticleData();this.age+=b;0!=this.lifespan&&this.age>this.lifespan&&(this.emitting=!1);this.simulateInLocalSpace&&(this.particleMesh.matrix.copy(this.matrixWorld),this.particleMesh.updateMatrixWorld())}}}();
-PHOTONS.ParticleSystem.prototype.deactivate=function(){this.isActive&&(this.scene.remove(this.particleMesh),this.isActive=!1)};PHOTONS.ParticleSystem.prototype.activate=function(){this.isActive||(this.scene.add(this.particleMesh),this.isActive=!0)};PHOTONS.ParticleSystem.DefaultPositionUpdater={update:function(a,b,c){a._tempVector3.copy(a.velocity);a._tempVector3.multiplyScalar(c);a.position.add(a._tempVector3)}};
-PHOTONS.ParticleSystem.DefaultVelocityUpdater={update:function(a,b,c){a._tempVector3.copy(a.acceleration);a._tempVector3.multiplyScalar(c);a.velocity.add(a._tempVector3)}};PHOTONS.ParticleSystem.DefaultRotationUpdater={update:function(a,b,c){a.rotation.set(a.rotation.x+=a.rotationalSpeed.x*c)}};PHOTONS.ParticleSystem.DefaultRotationalSpeedUpdater={update:function(a,b,c){a.rotationalSpeed.set(a.rotationalSpeed.x+=a.rotationalAcceleration.x*c)}};
-PHOTONS.ParticleSystem.DefaultUpdater={update:function(a,b,c){}};PHOTONS.ParticleSystem.DefaultInitializer={update:function(a,b,c){b.set(0,0,0,0)}};
-PHOTONS.Particle=function(){this.lifeSpan=this.alive=this.age=0;this.size=new THREE.Vector3;this.color=new THREE.Color;this.alpha=new PHOTONS.SingularVector(0);this.atlasIndex=new PHOTONS.SingularVector(0);this.position=new THREE.Vector3;this.velocity=new THREE.Vector3;this.acceleration=new THREE.Vector3;this.rotation=new PHOTONS.SingularVector(0);this.rotationalSpeed=new PHOTONS.SingularVector(0);this.rotationalAcceleration=new PHOTONS.SingularVector(0);this._tempVector3=new THREE.Vector3};PHOTONS=PHOTONS||{};PHOTONS.FrameSet=function(a,b,c){this.timeFrames=a||[];this.valueFrames=b||[]};PHOTONS.FrameSet.prototype.findNextFrameForTimeValue=function(a){for(var b=0;b<this.timeFrames.length&&this.timeFrames[b]<a;)b+=1;return b};PHOTONS.FrameSet.prototype.calculateFraction=function(a,b,c){return(c-a)/(b-a)};
-PHOTONS.FrameSet.prototype.interpolateFrameValues=function(a,b){var c=this.findNextFrameForTimeValue(a),e=c-1;if(0==c)b.copy(this.valueFrames[0]);else if(c==this.timeFrames.length)b.copy(this.valueFrames[e]);else{var f=this.calculateFraction(this.timeFrames[e],this.timeFrames[c],a);b.copy(this.valueFrames[e]);b.lerp(this.valueFrames[c],f)}};PHOTONS=PHOTONS||{};
-PHOTONS.Util={loadingManager:void 0,objLoader:void 0,imageLoader:void 0,initializeLoadingManager:function(){this.loadingManager=new THREE.LoadingManager;this.loadingManager.onProgress=function(a,b,c){console.log("Loaded "+b+" items out of "+c+": "+a)}},loadObj:function(a,b,c,e,f){var d=function(a){},g=function(a){console.log("ERROR: loadObj() - "+a)};this.objLoader||(this.objLoader=new THREE.OBJLoader(loadingManager));this.imageLoader||(this.imageLoader=new THREE.ImageLoader(this.loadingManager));var h=
-new THREE.Texture,k=this;this.imageLoader.load(b,function(b){h.image=b;h.needsUpdate=!0;k.objLoader.load(a,function(b){b.traverse(function(a){a instanceof THREE.Mesh&&(a.material=c,a.material.map=h,e&&e(a))});console.log("Finished loading model: "+a);f&&f(b)},d,g)})}};

+ 6 - 0
examples/js/loaders/ColladaLoader2.js

@@ -183,6 +183,12 @@ THREE.ColladaLoader.prototype = {
 		// image
 
 		var imageLoader = new THREE.ImageLoader();
+		
+		if ( this.crossOrigin ) {
+			
+			imageLoader.crossOrigin = this.crossOrigin;
+			
+		}
 
 		function parseImage( xml ) {
 

Some files were not shown because too many files changed in this diff