Browse Source

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

Aleksandar Rodic 11 years ago
parent
commit
c8a8f52b17
100 changed files with 2672 additions and 4196 deletions
  1. 1 1
      LICENSE
  2. 27 0
      bower.json
  3. 390 192
      build/three.js
  4. 202 199
      build/three.min.js
  5. 2 5
      docs/api/cameras/Camera.html
  6. 0 1
      docs/api/cameras/PerspectiveCamera.html
  7. 42 0
      docs/api/constants/CustomBlendingEquations.html
  8. 30 0
      docs/api/constants/GLState.html
  9. 47 0
      docs/api/constants/Materials.html
  10. 23 0
      docs/api/constants/ShadowingTypes.html
  11. 85 0
      docs/api/constants/Textures.html
  12. 2 36
      docs/api/core/BufferGeometry.html
  13. 12 48
      docs/api/core/Geometry.html
  14. 26 23
      docs/api/core/Object3D.html
  15. 5 5
      docs/api/extras/ImageUtils.html
  16. 1 1
      docs/api/extras/core/Curve.html
  17. 7 7
      docs/api/extras/core/Shape.html
  18. 15 0
      docs/api/extras/geometries/CircleGeometry.html
  19. 11 1
      docs/api/extras/geometries/CubeGeometry.html
  20. 10 1
      docs/api/extras/geometries/CylinderGeometry.html
  21. 18 2
      docs/api/extras/geometries/ExtrudeGeometry.html
  22. 5 5
      docs/api/extras/geometries/LatheGeometry.html
  23. 10 1
      docs/api/extras/geometries/PlaneGeometry.html
  24. 7 0
      docs/api/extras/geometries/RingGeometry.html
  25. 24 2
      docs/api/extras/geometries/ShapeGeometry.html
  26. 7 0
      docs/api/extras/geometries/SphereGeometry.html
  27. 10 1
      docs/api/extras/geometries/TorusGeometry.html
  28. 9 0
      docs/api/extras/geometries/TorusKnotGeometry.html
  29. 17 4
      docs/api/extras/helpers/ArrowHelper.html
  30. 7 1
      docs/api/extras/helpers/AxisHelper.html
  31. 13 1
      docs/api/extras/helpers/GridHelper.html
  32. 1 3
      docs/api/extras/helpers/HemisphereLightHelper.html
  33. 14 4
      docs/api/extras/helpers/PointLightHelper.html
  34. 2 2
      docs/api/lights/AmbientLight.html
  35. 6 5
      docs/api/lights/AreaLight.html
  36. 7 4
      docs/api/lights/DirectionalLight.html
  37. 3 4
      docs/api/lights/HemisphereLight.html
  38. 5 4
      docs/api/lights/PointLight.html
  39. 3 3
      docs/api/lights/SpotLight.html
  40. 4 4
      docs/api/materials/LineBasicMaterial.html
  41. 22 45
      docs/api/materials/Material.html
  42. 8 8
      docs/api/materials/MeshBasicMaterial.html
  43. 10 12
      docs/api/materials/MeshDepthMaterial.html
  44. 5 5
      docs/api/materials/MeshLambertMaterial.html
  45. 17 13
      docs/api/materials/MeshNormalMaterial.html
  46. 9 7
      docs/api/materials/MeshPhongMaterial.html
  47. 0 2
      docs/api/materials/ParticleSystemMaterial.html
  48. 21 6
      docs/api/materials/ShaderMaterial.html
  49. 0 0
      docs/api/materials/SpriteCanvasMaterial.html
  50. 16 14
      docs/api/math/Box2.html
  51. 81 81
      docs/api/math/Box3.html
  52. 19 19
      docs/api/math/Color.html
  53. 17 14
      docs/api/math/Euler.html
  54. 28 28
      docs/api/math/Frustum.html
  55. 50 56
      docs/api/math/Line3.html
  56. 19 17
      docs/api/math/Math.html
  57. 60 47
      docs/api/math/Matrix3.html
  58. 36 34
      docs/api/math/Matrix4.html
  59. 72 76
      docs/api/math/Plane.html
  60. 89 54
      docs/api/math/Ray.html
  61. 48 57
      docs/api/math/Sphere.html
  62. 51 50
      docs/api/math/Triangle.html
  63. 38 38
      docs/api/math/Vector2.html
  64. 83 81
      docs/api/math/Vector3.html
  65. 89 73
      docs/api/math/Vector4.html
  66. 17 0
      docs/api/objects/Line.html
  67. 9 27
      docs/api/objects/Mesh.html
  68. 0 40
      docs/api/objects/Particle.html
  69. 1 1
      docs/api/objects/ParticleSystem.html
  70. 1 1
      docs/api/renderers/WebGLRenderTarget.html
  71. 2 9
      docs/api/renderers/WebGLRenderer.html
  72. 4 8
      docs/api/renderers/shaders/ShaderChunk.html
  73. 27 0
      docs/api/renderers/shaders/ShaderLib.html
  74. 28 0
      docs/api/renderers/shaders/UniformsLib.html
  75. 26 0
      docs/api/renderers/shaders/UniformsUtils.html
  76. 3 14
      docs/index.html
  77. 21 8
      docs/list.js
  78. 7 10
      editor/css/dark.css
  79. 9 11
      editor/css/light.css
  80. 50 0
      editor/css/types.css
  81. 63 20
      editor/index.html
  82. 51 0
      editor/js/Config.js
  83. 45 6
      editor/js/Editor.js
  84. 0 34
      editor/js/Loader.js
  85. 20 4
      editor/js/Menubar.Add.js
  86. 0 4
      editor/js/Menubar.Edit.js
  87. 30 54
      editor/js/Menubar.File.js
  88. 0 4
      editor/js/Menubar.Help.js
  89. 48 0
      editor/js/Menubar.View.js
  90. 1 0
      editor/js/Menubar.js
  91. 7 7
      editor/js/Sidebar.Geometry.CylinderGeometry.js
  92. 19 23
      editor/js/Sidebar.Material.js
  93. 3 27
      editor/js/Sidebar.Object3D.js
  94. 5 24
      editor/js/Sidebar.Renderer.js
  95. 9 4
      editor/js/Sidebar.Scene.js
  96. 83 0
      editor/js/Storage.js
  97. 48 12
      editor/js/Viewport.js
  98. 0 1671
      editor/js/libs/rawdeflate.js
  99. 0 753
      editor/js/libs/rawinflate.js
  100. 37 13
      editor/js/libs/ui.js

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 The MIT License
 The MIT License
 
 
-Copyright (c) 2010-2013 three.js authors
+Copyright © 2010-2014 three.js authors
 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 of this software and associated documentation files (the "Software"), to deal

+ 27 - 0
bower.json

@@ -0,0 +1,27 @@
+{
+	"name": "three.js",
+	"version": "0.0.65",
+	"homepage": "http://threejs.org/",
+	"description": "JavaScript 3D library",
+	"main": "build/three.js",
+	"keywords": [
+		"three",
+		"threejs",
+		"three.js",
+		"3D",
+		"webgl"
+	],
+	"license": "MIT",
+	"ignore": [
+		"**/.*",
+		"*.md",
+		"bower.json",
+		"docs",
+		"editor",
+		"examples",
+		"src",
+		"test",
+		"utils",
+		"LICENSE"
+	]
+}

File diff suppressed because it is too large
+ 390 - 192
build/three.js


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


+ 2 - 5
docs/api/cameras/Camera.html

@@ -19,7 +19,7 @@
 
 
 		<h3>[name]()</h3>
 		<h3>[name]()</h3>
 		<div>
 		<div>
-			This constructor sets following properties to the correct type: matrixWorldInverse, projectionMatrix and projectionMatrixInverse.
+			This constructor sets the following properties to the correct type: matrixWorldInverse and projectionMatrix.
 			
 			
 		</div>
 		</div>
 
 
@@ -30,10 +30,7 @@
 		<div>This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.</div>
 		<div>This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.</div>
 
 
 		<h3>.[page:Matrix4 projectionMatrix]</h3>
 		<h3>.[page:Matrix4 projectionMatrix]</h3>
-		<div>This is the matrix which contains the projection.</div>		
-
-		<h3>.[page:Matrix4 projectionMatrixInverse]</h3>
-		<div>This is the inverse of projectionMatrix.</div>
+		<div>This is the matrix which contains the projection.</div>
 
 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>

+ 0 - 1
docs/api/cameras/PerspectiveCamera.html

@@ -22,7 +22,6 @@ scene.add( camera );</code>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-
 		<h3>[name]( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] )</h3>
 		<h3>[name]( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] )</h3>
 		<div>
 		<div>
 		fov — Camera frustum vertical field of view.<br />
 		fov — Camera frustum vertical field of view.<br />

+ 42 - 0
docs/api/constants/CustomBlendingEquations.html

@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
+		<h1>Custom Blending Equation Constants</h1>
+
+		<h2>Equations</h2>
+		<div>
+		THREE.AddEquation<br />
+		THREE.SubtractEquation<br />
+		THREE.ReverseSubtractEquation
+		</div>
+
+		<h2>Destination Factors</h2>
+		<div>
+		THREE.ZeroFactor<br />
+		THREE.OneFactor<br />
+		THREE.SrcColorFactor<br />
+		THREE.OneMinusSrcColorFactor<br />
+		THREE.SrcAlphaFactor<br />
+		THREE.OneMinusSrcAlphaFactor<br />
+		THREE.DstAlphaFactor<br />
+		THREE.OneMinusDstAlphaFactor
+		</div>
+
+		<h2>Source Factors</h2>
+		<div>
+		THREE.DstColorFactor<br />
+		THREE.OneMinusDstColorFactor<br />
+		THREE.SrcAlphaSaturateFactor
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/Three.js src/Three.js]
+	</body>
+</html>

+ 30 - 0
docs/api/constants/GLState.html

@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
+		<h1>GL State Conflicts</h1>
+
+		<h2>Cull Face</h2>
+		<div>
+		THREE.CullFaceNone<br />
+		THREE.CullFaceBack<br />
+		THREE.CullFaceFront<br />
+		THREE.CullFaceFrontBack
+		</div>
+
+		<h2>Front Face Direction</h2>
+		<div>
+		THREE.FrontFaceDirectionCW<br />
+		THREE.FrontFaceDirectionCCW<br />
+		</div>
+	
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/Three.js src/Three.js]
+	</body>
+</html>

+ 47 - 0
docs/api/constants/Materials.html

@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
+		<h1>Material Constants</h1>
+
+		<h2>Side</h2>
+		<div>
+		THREE.FrontSide<br />
+		THREE.BackSide<br />
+		THREE.DoubleSide
+		</div>
+
+		<h2>Shading</h2>
+		<div>
+		THREE.NoShading<br />
+		THREE.FlatShading<br />
+		THREE.SmoothShading
+		</div>
+
+		<h2>Colors</h2>
+		<div>
+		THREE.NoColors<br />
+		THREE.FaceColors<br />
+		THREE.VertexColors
+		</div>
+
+		<h2>Blending Mode</h2>
+		<div>
+		THREE.NoBlending<br />
+		THREE.NormalBlending<br />
+		THREE.AdditiveBlending<br />
+		THREE.SubtractiveBlending<br />
+		THREE.MultiplyBlending<br />
+		THREE.CustomBlending
+		</div>
+	
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/Three.js src/Three.js]
+	</body>
+</html>

+ 23 - 0
docs/api/constants/ShadowingTypes.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
+		<h1>Shadowing Type Contants</h1>
+
+		<h2>Shadow Map</h2>
+		<div>
+		THREE.BasicShadowMap<br />
+		THREE.PCFShadowMap<br />
+		THREE.PCFSoftShadowMap
+		</div>
+	
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/Three.js src/Three.js]
+	</body>
+</html>

+ 85 - 0
docs/api/constants/Textures.html

@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
+		<h1>Texture Constants</h1>
+
+		<h2>Operations</h2>
+		<div>
+		THREE.MultiplyOperation<br />
+		THREE.MixOperation<br />
+		THREE.AddOperation
+		</div>
+
+		<h2>Mapping Modes</h2>
+		<div>
+		THREE.UVMapping<br />
+		THREE.CubeReflectionMapping<br />
+		THREE.CubeRefractionMapping<br />
+		THREE.SphericalReflectionMapping<br />
+		THREE.SphericalRefractionMapping
+		</div>
+
+		<h2>Wrapping Modes</h2>
+		<div>
+		THREE.RepeatWrapping<br />
+		THREE.ClampToEdgeWrapping<br />
+		THREE.MirroredRepeatWrapping
+		</div>
+
+		<h2>Filters</h2>
+		<div>
+		THREE.NearestFilter<br />
+		THREE.NearestMipMapNearestFilter<br />
+		THREE.NearestMipMapLinearFilter<br />
+		THREE.LinearFilter<br />
+		THREE.LinearMipMapNearestFilter<br />
+		THREE.LinearMipMapLinearFilter
+		</div>
+
+		<h2>Data Types</h2>
+		<div>
+		THREE.UnsignedByteType<br />
+		THREE.ByteType<br />
+		THREE.ShortType<br />
+		THREE.UnsignedShortType<br />
+		THREE.IntType<br />
+		THREE.UnsignedIntType<br />
+		THREE.FloatType
+		</div>
+
+		<h2>Pixel Types</h2>
+		<div>
+		THREE.UnsignedShort4444Type<br />
+		THREE.UnsignedShort5551Type<br />
+		THREE.UnsignedShort565Type
+		</div>
+
+		<h2>Pixel Formats</h2>
+		<div>
+		THREE.AlphaFormat<br />
+		THREE.RGBFormat<br />
+		THREE.RGBAFormat<br />
+		THREE.LuminanceFormat<br />
+		THREE.LuminanceAlphaFormat
+		</div>
+
+		<h2>Compressed Texture Formats</h2>
+		<div>
+		THREE.RGB_S3TC_DXT1_Format<br />
+		THREE.RGBA_S3TC_DXT1_Format<br />
+		THREE.RGBA_S3TC_DXT3_Format<br />
+		THREE.RGBA_S3TC_DXT5_Format
+		</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/Three.js src/Three.js]
+	</body>
+</html>

+ 2 - 36
docs/api/core/BufferGeometry.html

@@ -73,6 +73,8 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
+		
 		<h3>.applyMatrix( [page:Matrix4 matrix] )</h3>
 		<h3>.applyMatrix( [page:Matrix4 matrix] )</h3>
 		<div>
 		<div>
 		Bakes matrix transform directly into vertex coordinates.
 		Bakes matrix transform directly into vertex coordinates.
@@ -108,47 +110,11 @@
 		You need to call this when you want the bufferGeometry removed while the application is running.
 		You need to call this when you want the bufferGeometry removed while the application is running.
 		</div>
 		</div>
 
 
-
-		<h3>.hasEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.addEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.removeEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
 		<h3>.normalizeNormals() [page:todo]</h3>
 		<h3>.normalizeNormals() [page:todo]</h3>
 		<div>
 		<div>
 		todo
 		todo
 		</div>
 		</div>
 
 
-		<h3>.dispatchEvent([page:todo event]) [page:todo]</h3>
-		<div>
-		event -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 12 - 48
docs/api/core/Geometry.html

@@ -33,7 +33,7 @@
 
 
 		<h3>[name]()</h3>
 		<h3>[name]()</h3>
 		<div>
 		<div>
-		todo
+		The constructor takes no arguments.
 		</div>
 		</div>
 
 
 
 
@@ -52,7 +52,7 @@
 		<h3>.[page:Array vertices]</h3>
 		<h3>.[page:Array vertices]</h3>
 		<div>
 		<div>
 		Array of [page:Vector3 vertices].<br />
 		Array of [page:Vector3 vertices].<br />
-		The array of vertices hold every position of points of the model.<br />
+		The array of vertices holds every position of points in the model.<br />
 		To signal an update in this array, [page:Geometry Geometry.verticesNeedUpdate] needs to be set to true.
 		To signal an update in this array, [page:Geometry Geometry.verticesNeedUpdate] needs to be set to true.
 		</div>
 		</div>
 
 
@@ -74,7 +74,7 @@
 		<h3>.[page:Array faceVertexUvs]</h3>
 		<h3>.[page:Array faceVertexUvs]</h3>
 		<div>
 		<div>
 		Array of face [page:UV] layers.<br />
 		Array of face [page:UV] layers.<br />
-		Each UV layer is an array of [page:UV] matching order and number of vertices in faces.<br />
+		Each UV layer is an array of [page:UV]s matching the order and number of vertices in faces.<br />
 		To signal an update in this array, [page:Geometry Geometry.uvsNeedUpdate] needs to be set to true.
 		To signal an update in this array, [page:Geometry Geometry.uvsNeedUpdate] needs to be set to true.
 		</div>
 		</div>
 
 
@@ -89,7 +89,7 @@
 		<div>
 		<div>
 		Array of morph colors. Morph colors have similar structure as morph targets, each color set is a Javascript object:
 		Array of morph colors. Morph colors have similar structure as morph targets, each color set is a Javascript object:
 		<code>morphColor = { name: "colorName", colors: [ new THREE.Color(), ... ] }</code>
 		<code>morphColor = { name: "colorName", colors: [ new THREE.Color(), ... ] }</code>
-		Morph colors can match either number and order of faces (face colors) or number of vertices (vertex colors).
+		Morph colors can match either the number and order of faces (face colors) or the number of vertices (vertex colors).
 		</div>
 		</div>
 
 
 		<h3>.[page:Array morphNormals]</h3>
 		<h3>.[page:Array morphNormals]</h3>
@@ -172,17 +172,16 @@
 		Set to *true* if an array has changed in length.
 		Set to *true* if an array has changed in length.
 		</div>
 		</div>
 
 
-		<h3>.[page:array morphNormals]</h3>
-		<div>
-		todo
-		</div> 
-
 		<h3>.[page:array lineDistances]</h3>
 		<h3>.[page:array lineDistances]</h3>
 		<div>
 		<div>
-		todo
+		An array containing distances between vertices for Line geometries.
+		This is required for LinePieces/LineDashedMaterial to render correctly.
+		Line distances can also be generated with computeLineDistances.
 		</div> 
 		</div> 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
+		
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
 
 
 		<h3>.applyMatrix( [page:Matrix4 matrix] )</h3>
 		<h3>.applyMatrix( [page:Matrix4 matrix] )</h3>
 		<div>
 		<div>
@@ -243,49 +242,14 @@
 		<h3>.dispose()</h3>
 		<h3>.dispose()</h3>
 		<div>
 		<div>
 		Removes The object from memory. <br />
 		Removes The object from memory. <br />
-		Don't forget to call this method when you remove an geometry because it can cuase meomory leaks. 
-		</div>
-
-
-		<h3>.dispatchEvent([page:todo event]) [page:todo]</h3>
-		<div>
-		event -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.hasEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.removeEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
+		Don't forget to call this method when you remove a geometry because it can cause memory leaks. 
 		</div>
 		</div>
 
 
-		<h3>.computeLineDistances() [page:todo]</h3>
+		<h3>.computeLineDistances()</h3>
 		<div>
 		<div>
-		todo
+		Compute distances between vertices for Line geometries.
 		</div>
 		</div>
 
 
-		<h3>.addEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 

+ 26 - 23
docs/api/core/Object3D.html

@@ -17,7 +17,7 @@
 
 
 		<h3>[name]()</h3>
 		<h3>[name]()</h3>
 		<div>
 		<div>
-		todo
+		The constructor takes no arguments.
 		</div>
 		</div>
 
 
 
 
@@ -48,9 +48,9 @@
 		Object's local position.
 		Object's local position.
 		</div>
 		</div>
 
 
-		<h3>.[page:Vector3 rotation]</h3>
+		<h3>.[page:Euler rotation]</h3>
 		<div>
 		<div>
-		Object's local rotation (<a href="https://en.wikipedia.org/wiki/Euler_angles">Euler angles</a>), in radians.
+		Object's local rotation (<a href="https://en.wikipedia.org/wiki/Euler_angles" target="_blank">Euler angles</a>), in radians.
 		</div>
 		</div>
 
 
 		<h3>.[page:String eulerOrder]</h3>
 		<h3>.[page:String eulerOrder]</h3>
@@ -125,16 +125,19 @@
 
 
 		<h3>.[page:object userData]</h3>
 		<h3>.[page:object userData]</h3>
 		<div>
 		<div>
-		todo
+		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.
 		</div> 
 		</div> 
 
 
 		<h3>.[page:Matrix4 matrixWorld]</h3>
 		<h3>.[page:Matrix4 matrixWorld]</h3>
 		<div>
 		<div>
-		todo
+		The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.
 		</div> 
 		</div> 
 
 
+		
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 		
 		
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
+		
 		<h3>.applyMatrix( [page:Matrix4 matrix])</h3>
 		<h3>.applyMatrix( [page:Matrix4 matrix])</h3>
 		<div>
 		<div>
 		matrix - matrix
 		matrix - matrix
@@ -239,40 +242,40 @@
 		</div>
 		</div>
 
 
 
 
-		<h3>.getObjectByName([page:todo name], [page:todo recursive]) [page:todo]</h3>
+		<h3>.getObjectByName([page:String name], [page:Boolean recursive]) [page:Object3d Object3d]</h3>
 		<div>
 		<div>
-		name -- todo <br />
-		recursive -- todo
+		name -- String to match to the children's Object3d.name property. <br />
+		recursive -- Boolean whether to search through the children's children. Default is false.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Searches through the object's children and returns the first with a matching name, optionally recursive.
 		</div>
 		</div>
 
 
-		<h3>.translateOnAxis([page:todo axis], [page:todo distance]) [page:todo]</h3>
+		<h3>.getObjectById([page:Integer id], [page:Boolean recursive]) [page:Object3D]</h3>
 		<div>
 		<div>
-		axis -- todo <br />
-		distance -- todo
+		id -- Unique number of the object instance<br />
+		recursive -- Boolean whether to search through the children's children. Default is false.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Searches through the object's children and returns the first with a matching id, optionally recursive.
 		</div>
 		</div>
-
-		<h3>.getObjectById([page:todo id], [page:todo recursive]) [page:todo]</h3>
+		
+		<h3>.translateOnAxis([page:Vector3 axis], [page:Float distance]) [page:Object3D]</h3>
 		<div>
 		<div>
-		id -- todo <br />
-		recursive -- todo
+		axis -- A normalized vector in object space.<br />
+		distance -- The distance to translate.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
 		</div>
 		</div>
-
-		<h3>.rotateOnAxis([page:todo axis], [page:todo angle]) [page:todo]</h3>
+		
+		<h3>.rotateOnAxis([page:Vector3 axis], [page:Float angle]) [page:Object3D]</h3>
 		<div>
 		<div>
-		axis -- todo <br />
-		angle -- todo
+		axis -- A normalized vector in object space. <br />
+		angle -- The angle in radians.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Rotate an object along an axis in object space. The axis is assumed to be normalized.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 5 - 5
docs/api/extras/ImageUtils.html

@@ -55,12 +55,12 @@
 		todo
 		todo
 		</div>
 		</div>
 
 
-		<h3>.loadTexture([page:todo url], [page:todo mapping], [page:todo onLoad], [page:todo onError]) [page:todo]</h3>
+		<h3>.loadTexture([page:String url], [page:UVMapping mapping], [page:Function onLoad], [page:Function onError]) [page:todo]</h3>
 		<div>
 		<div>
-		url -- todo <br />
-		mapping -- todo <br />
-		onLoad -- todo <br />
-		onError -- todo
+		url -- the url of the texture<br />
+		mapping -- Can be an instance of [page:UVMapping Three.UVMapping], [page:CubeReflectionMapping THREE.CubeReflectionMapping], [page:SphericalReflectionMapping THREE.SphericalReflectionMapping] or [page:SphericalRefractionMapping THREE.SphericalRefractionMapping]. Describes how the image is applied to the object.<br />Use undefined instead of null as a default value. See mapping property of [page:Texture texture] for more details.
+		onLoad -- callback function<br />
+		onError -- callback function
 		</div>
 		</div>
 		<div>
 		<div>
 		todo
 		todo

+ 1 - 1
docs/api/extras/core/Curve.html

@@ -17,7 +17,7 @@
 
 
 		<h3>[name]()</h3>
 		<h3>[name]()</h3>
 		<div>
 		<div>
-		todo
+		This constructor creates a new [name].
 		</div>
 		</div>
 
 
 
 

+ 7 - 7
docs/api/extras/core/Shape.html

@@ -34,10 +34,10 @@
 
 
 		<h3>.makeGeometry([page:todo options]) [page:todo]</h3>
 		<h3>.makeGeometry([page:todo options]) [page:todo]</h3>
 		<div>
 		<div>
-		options -- todo
+		options -- The options passed as the second argument to [page:ShapeGeometry ShapeGeometry]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Convenience method to return ShapeGeometry
 		</div>
 		</div>
 
 
 		<h3>.extractAllPoints([page:todo divisions]) [page:todo]</h3>
 		<h3>.extractAllPoints([page:todo divisions]) [page:todo]</h3>
@@ -45,15 +45,15 @@
 		divisions -- todo
 		divisions -- todo
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Get points of shape and holes (keypoints based on segments parameter)
 		</div>
 		</div>
 
 
 		<h3>.extrude([page:todo options]) [page:todo]</h3>
 		<h3>.extrude([page:todo options]) [page:todo]</h3>
 		<div>
 		<div>
-		options -- todo
+		options -- The options passed as the second argument to [page:ExtrudeGeometry ExtrudeGeometry]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Convenience method to return ExtrudeGeometry
 		</div>
 		</div>
 
 
 		<h3>.extractPoints([page:todo divisions]) [page:todo]</h3>
 		<h3>.extractPoints([page:todo divisions]) [page:todo]</h3>
@@ -77,7 +77,7 @@
 		divisions -- todo
 		divisions -- todo
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Get points of holes
 		</div>
 		</div>
 
 
 		<h3>.getSpacedPointsHoles([page:todo divisions]) [page:todo]</h3>
 		<h3>.getSpacedPointsHoles([page:todo divisions]) [page:todo]</h3>
@@ -85,7 +85,7 @@
 		divisions -- todo
 		divisions -- todo
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Get points of holes (spaced by regular distance)
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 15 - 0
docs/api/extras/geometries/CircleGeometry.html

@@ -11,6 +11,21 @@
 
 
 		<div class="desc">CircleGeometry is a simple shape of Euclidean geometry.  It is contructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius.  It is built counter-clockwise from a start angle and a given central angle.  It can also be used to create regular polygons, where the number of segments determines the number of sides.
 		<div class="desc">CircleGeometry is a simple shape of Euclidean geometry.  It is contructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius.  It is built counter-clockwise from a start angle and a given central angle.  It can also be used to create regular polygons, where the number of segments determines the number of sides.
 		</div>
 		</div>
+		
+		<h2>Example</h2>
+
+		<code>var material = new THREE.MeshBasicMaterial({
+			color: 0x0000ff
+		});
+		
+		var radius = 5;
+		var segments = 32;
+		
+		var circleGeometry = new THREE.CircleGeometry( radius, segments );				
+		var circle = new THREE.Mesh( circleGeometry, material );
+		scene.add( circle );
+		</code>
+
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 

+ 11 - 1
docs/api/extras/geometries/CubeGeometry.html

@@ -12,6 +12,16 @@
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
 		<div class="desc">CubeGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided with the 'width', 'height', and 'depth' constructor arguments.</div>
 		<div class="desc">CubeGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided with the 'width', 'height', and 'depth' constructor arguments.</div>
+		
+		
+		<h2>Example</h2>
+		
+		
+		<code>var geometry = new THREE.CubeGeometry( 1, 1, 1 );
+		var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
+		var cube = new THREE.Mesh( geometry, material );
+		scene.add( cube );
+		</code>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
@@ -30,7 +40,7 @@
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 		
 		
 		<div>
 		<div>
-		Each of the contructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
+		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>
 		</div>
 		
 		
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 10 - 1
docs/api/extras/geometries/CylinderGeometry.html

@@ -11,7 +11,16 @@
 		
 		
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A class for generating cylinder geometries</div>
+
+
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );
+		var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
+		var cylinder = new THREE.Mesh( geometry, material );
+		scene.add( cylinder );
+		</code>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>

+ 18 - 2
docs/api/extras/geometries/ExtrudeGeometry.html

@@ -19,8 +19,24 @@
 
 
 		<h3>[name]([page:todo shapes], [page:Object options])</h3>
 		<h3>[name]([page:todo shapes], [page:Object options])</h3>
 		<div>
 		<div>
-		shapes — todo <br />
-		options — todo
+		shapes — Shape or an array of shapes. <br />
+		options — Object that can contain the following parameters.
+
+	<ul>
+<li>curveSegments —  int. number of points on the curves</li>
+<li>steps —  int. number of points used for subdividing segements of extrude spline</li>
+<li>amount —  int. Depth to extrude the shape</li>
+<li>bevelEnabled —  bool. turn on bevel</li>
+<li>bevelThickness —  float. how deep into the original shape bevel goes</li>
+<li>bevelSize —  float. how far from shape outline is bevel</li>
+<li>bevelSegments —  int. number of bevel layers</li>
+<li>extrudePath —  THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if (frames aren't defined)</li>
+<li>frames —  THREE.TubeGeometry.FrenetFrames.  containing arrays of tangents, normals, binormals</li>
+<li>material —  int. material index for front and back faces</li>
+<li>extrudeMaterial —  int. material index for extrusion and beveled faces</li>
+<li>uvGenerator —  Object. object that provides UV generator functions</li>
+	</ul>
+
 		</div>
 		</div>
 		<div>
 		<div>
 		todo
 		todo

+ 5 - 5
docs/api/extras/geometries/LatheGeometry.html

@@ -11,7 +11,7 @@
 		
 		
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Z axis.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
@@ -19,10 +19,10 @@
 
 
 		<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
 		<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
 		<div>
 		<div>
-		points — todo <br />
-		segments — todo <br />
-		phiStart — todo <br />
-		phiLength — todo
+		points — Array of Vector3s. Since this rotates around Z axis, the y-values can be set to 0<br />
+		segments — the number of circumference segments to generate. Default is 12.<br />
+		phiStart — the starting angle in radians. Default is 0.<br />
+		phiLength — the radian (0 to 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Default is 2*PI
 		</div>
 		</div>
 		<div>
 		<div>
 		todo
 		todo

+ 10 - 1
docs/api/extras/geometries/PlaneGeometry.html

@@ -11,7 +11,16 @@
 		
 		
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A class for generating plane geometries</div>
+
+
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.PlaneGeometry( 5, 20 );
+		var material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
+		var plane = new THREE.Mesh( geometry, material );
+		scene.add( plane );
+		</code>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>

+ 7 - 0
docs/api/extras/geometries/RingGeometry.html

@@ -13,6 +13,13 @@
 
 
 		<div class="desc">A class for generating a two-dimensional ring geometry.</div>
 		<div class="desc">A class for generating a two-dimensional ring geometry.</div>
 
 
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.RingGeometry( 1, 5, 32 );
+		var material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );
+		var mesh = new THREE.Mesh( geometry, material );
+		scene.add( mesh );
+		</code>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 

+ 24 - 2
docs/api/extras/geometries/ShapeGeometry.html

@@ -13,14 +13,36 @@
 
 
 		<div class="desc">todo</div>
 		<div class="desc">todo</div>
 
 
-
+		<h2>Example</h2>
+		
+		
+		<code>var rectLength = 120, rectWidth = 40;
+		
+		var rectShape = new THREE.Shape();
+		rectShape.moveTo( 0,0 );
+		rectShape.lineTo( 0, rectWidth );
+		rectShape.lineTo( rectLength, rectWidth );
+		rectShape.lineTo( rectLength, 0 );
+		rectShape.lineTo( 0, 0 );
+		
+		var rectGeom = new THREE.ShapeGeometry( rectShape );
+		var rectMesh = new THREE.Mesh( rectGeom, new THREE.MeshBasicMaterial( { color: 0xff0000 } ) ) ;		
+		
+		scene.add( rectMesh );
+		</code>
+	
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
 		<h3>[name]([page:Array shapes], [page:Object options])</h3>
 		<h3>[name]([page:Array shapes], [page:Object options])</h3>
 		<div>
 		<div>
 		shapes — todo <br />
 		shapes — todo <br />
-		options — todo
+		options — 
+		<ul>
+		<li>curveSegments - todo</li>
+		<li>material - todo</li>
+		<li>UVGenerator - todo</li>
+		</ul>
 		</div>
 		</div>
 		<div>
 		<div>
 		todo
 		todo

+ 7 - 0
docs/api/extras/geometries/SphereGeometry.html

@@ -13,6 +13,13 @@
 
 
 		<div class="desc">A class for generating sphere geometries</div>
 		<div class="desc">A class for generating sphere geometries</div>
 
 
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.SphereGeometry( 5, 32, 32 );
+		var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
+		var sphere = new THREE.Mesh( geometry, material );
+		scene.add( sphere );
+		</code>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 

+ 10 - 1
docs/api/extras/geometries/TorusGeometry.html

@@ -11,7 +11,16 @@
 	
 	
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">Creates a torus.</div>
+		<div class="desc">A class for generating torus geometries</div>
+
+
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );
+		var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
+		var torus = new THREE.Mesh( geometry, material );
+		scene.add( torus );
+		</code>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>

+ 9 - 0
docs/api/extras/geometries/TorusKnotGeometry.html

@@ -14,6 +14,15 @@
 		<div class="desc">Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q.  If p and q are not coprime, the result will be a torus link.</div>
 		<div class="desc">Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q.  If p and q are not coprime, the result will be a torus link.</div>
 
 
 
 
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );
+		var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
+		var torusKnot = new THREE.Mesh( geometry, material );
+		scene.add( torusKnot );
+		</code>
+
+
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 

+ 17 - 4
docs/api/extras/helpers/ArrowHelper.html

@@ -12,15 +12,28 @@
 		<div class="desc">todo</div>
 		<div class="desc">todo</div>
 
 
 
 
+		<h2>Example</h2>
+
+		<code>var dir = new THREE.Vector3( 1, 0, 0 );
+		var origin = new THREE.Vector3( 0, 0, 0 );
+		var length = 1;
+		var hex = 0xffff00;
+
+		var arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
+		scene.add( arrowHelper );
+		</code>
+
+
+
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
 		<h3>[name]([page:todo dir], [page:todo origin], [page:todo length], [page:todo hex])</h3>
 		<h3>[name]([page:todo dir], [page:todo origin], [page:todo length], [page:todo hex])</h3>
 		<div>
 		<div>
-		dir -- todo <br />
-		origin -- todo <br />
-		length -- todo <br />
-		hex -- todo
+		dir -- Vector3 -- direction from origin <br />
+		origin -- Vector3 <br />
+		length -- scalar <br />
+		hex -- hexadecimal value to define color ex:0xffff00
 		</div>
 		</div>
 		<div>
 		<div>
 		todo
 		todo

+ 7 - 1
docs/api/extras/helpers/AxisHelper.html

@@ -12,12 +12,18 @@
 		<div class="desc">todo</div>
 		<div class="desc">todo</div>
 
 
 
 
+		<h2>Example</h2>
+
+                <code>var axisHelper = new THREE.AxisHelper( 5 );
+		scene.add( axisHelper );
+                </code>
+
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
 		<h3>[name]([page:todo size])</h3>
 		<h3>[name]([page:todo size])</h3>
 		<div>
 		<div>
-		size -- todo
+		size -- Define the size of the helper
 		</div>
 		</div>
 		<div>
 		<div>
 		todo
 		todo

+ 13 - 1
docs/api/extras/helpers/GridHelper.html

@@ -12,9 +12,21 @@
 		<div class="desc">todo</div>
 		<div class="desc">todo</div>
 
 
 
 
-		<h2>Constructor</h2>
+		<h2>Example</h2>
+
+		<code>var size = 10;
+		var step = 1;
+		var gridHelper = new THREE.GridHelper( size, step );
+		
+		gridHelper.position = new THREE.Vector3( 10, 10, 0 );
+		gridHelper.rotation = new THREE.Euler( 15, 0, 0 );
+		
+		scene.add( gridHelper );
+		</code>
 
 
 
 
+		<h2>Constructor</h2>
+
 		<h3>[name]([page:todo size], [page:todo step])</h3>
 		<h3>[name]([page:todo size], [page:todo step])</h3>
 		<div>
 		<div>
 		size -- todo <br />
 		size -- todo <br />

+ 1 - 3
docs/api/extras/helpers/HemisphereLightHelper.html

@@ -14,7 +14,6 @@
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-
 		<h3>[name]([page:todo light], [page:todo sphereSize], [page:todo arrowLength], [page:todo domeSize])</h3>
 		<h3>[name]([page:todo light], [page:todo sphereSize], [page:todo arrowLength], [page:todo domeSize])</h3>
 		<div>
 		<div>
 		light -- todo <br />
 		light -- todo <br />
@@ -29,7 +28,6 @@
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-
 		<h3>.[page:Mesh lightSphere]</h3>
 		<h3>.[page:Mesh lightSphere]</h3>
 		<div>
 		<div>
 		todo
 		todo
@@ -43,12 +41,12 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-
 		<h3>.update() [page:todo]</h3>
 		<h3>.update() [page:todo]</h3>
 		<div>
 		<div>
 		todo
 		todo
 		</div>
 		</div>
 
 
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 14 - 4
docs/api/extras/helpers/PointLightHelper.html

@@ -9,12 +9,23 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">This display a helper for a pointLight </div>
 
 
 
 
-		<h2>Constructor</h2>
+		<h2>Example</h2>
+
+		<code>var pointLight = new THREE.PointLight( 0xff0000, 1, 100 );
+		pointLight.position.set( 10, 10, 10 );
+		scene.add( pointLight );
+		
+		var sphereSize = 1;
+		var pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );
+		scene.add( pointLightHelper );
+		</code>
 
 
 
 
+		<h2>Constructor</h2>
+
 		<h3>[name]([page:todo light], [page:todo sphereSize])</h3>
 		<h3>[name]([page:todo light], [page:todo sphereSize])</h3>
 		<div>
 		<div>
 		light -- todo <br />
 		light -- todo <br />
@@ -27,7 +38,6 @@
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-
 		<h3>.[page:Mesh lightSphere]</h3>
 		<h3>.[page:Mesh lightSphere]</h3>
 		<div>
 		<div>
 		todo
 		todo
@@ -38,8 +48,8 @@
 		todo
 		todo
 		</div> 
 		</div> 
 
 
-		<h2>Methods</h2>
 
 
+		<h2>Methods</h2>
 
 
 		<h3>.update() [page:todo]</h3>
 		<h3>.update() [page:todo]</h3>
 		<div>
 		<div>

+ 2 - 2
docs/api/lights/AmbientLight.html

@@ -24,12 +24,12 @@ scene.add( light );</code>
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]( [page:Float hex] )</h3>
+		<h3>[name]( [page:Integer hex] )</h3>
 		<div>
 		<div>
 		[page:Integer hex] — Numeric value of the RGB component of the color.
 		[page:Integer hex] — Numeric value of the RGB component of the color.
 		</div>
 		</div>
 		<div>
 		<div>
-		This creates a Ambientlight with a color.
+		This creates an Ambientlight with a color.
 		</div>
 		</div>
 
 
 
 

+ 6 - 5
docs/api/lights/AreaLight.html

@@ -24,10 +24,10 @@ scene.add( areaLight1 );</code>
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]( [page:Float hex], [page:Float intensity])</h3>
+		<h3>[name]( [page:Integer hex], [page:Float intensity])</h3>
 		<div>
 		<div>
 		[page:Integer hex] — Numeric value of the RGB component of the color.<br />
 		[page:Integer hex] — Numeric value of the RGB component of the color.<br />
-		[page:Integer intensity] — The intensity of the light.
+		[page:Float intensity] — Numeric value of the light's strength/intensity.
 		</div>
 		</div>
 		<div>
 		<div>
 		This creates a arealight with color.
 		This creates a arealight with color.
@@ -68,10 +68,11 @@ scene.add( areaLight1 );</code>
 		todo
 		todo
 		</div> 
 		</div> 
 
 
-		<h3>.[page:number intensity]</h3>
+		<h3>.[page:Float intensity]</h3>
 		<div>
 		<div>
-		todo
-		</div> 
+			Light's intensity.<br />
+			Default — *1.0*.
+		</div>
 
 
 		<h3>.[page:number constantAttenuation]</h3>
 		<h3>.[page:number constantAttenuation]</h3>
 		<div>
 		<div>

+ 7 - 4
docs/api/lights/DirectionalLight.html

@@ -28,13 +28,16 @@ scene.add( directionalLight );</code>
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo hex], [page:todo intensity])</h3>
+		<h3>[name]([page:Integer hex], [page:Float intensity])</h3>
 		<div>
 		<div>
-		hex -- todo <br />
-		intensity -- todo
+		[page:Integer hex] -- Numeric value of the RGB component of the color. <br />
+		[page:Float intensity] -- Numeric value of the light's strength/intensity.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Creates a light that shines from a specific direction not from a specific position.  This light will behave
+		as though it is infinitely far away and the rays produced from it are all parallel.  The best
+		analogy would be a light source that acts like the sun: the sun is so far away that all sunlight
+		hitting objects comes from the same angle.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>

+ 3 - 4
docs/api/lights/HemisphereLight.html

@@ -16,11 +16,11 @@
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo skyColorHex], [page:todo groundColorHex], [page:todo intensity])</h3>
+		<h3>[name]([page:Integer skyColorHex], [page:Integer groundColorHex], [page:Float intensity])</h3>
         <div>
         <div>
 		[page:Integer skyColorHex] — Numeric value of the RGB sky color.<br />
 		[page:Integer skyColorHex] — Numeric value of the RGB sky color.<br />
 		[page:Integer groundColorHex] — Numeric value of the RGB ground color.<br />
 		[page:Integer groundColorHex] — Numeric value of the RGB ground color.<br />
-		[page:Integer intensity] — The intensity of the light.
+		[page:Float intensity] — Numeric value of the light's strength/intensity.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
@@ -32,10 +32,9 @@
 		</div>
 		</div>
 
 
 		<h3>.[page:Float intensity]</h3>
 		<h3>.[page:Float intensity]</h3>
-
 		<div>
 		<div>
 			Light's intensity.<br />
 			Light's intensity.<br />
-			Default — *1*.
+			Default — *1.0*.
 		</div>
 		</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>

+ 5 - 4
docs/api/lights/PointLight.html

@@ -26,14 +26,15 @@ scene.add( light );</code>
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo hex], [page:todo intensity], [page:todo distance])</h3>
+		<h3>[name]([page:Integer hex], [page:Float intensity], [page:todo distance])</h3>
 		<div>
 		<div>
-		hex -- todo <br />
-		intensity -- todo <br />
+		[page:Integer hex] — Numeric value of the RGB component of the color. <br />
+		[page:Float intensity] — Numeric value of the light's strength/intensity. <br />
 		distance -- todo
 		distance -- todo
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Creates a light at a specific position in the scene.  The light shines in all directions (roughly similar to a light bulb.)
+	
 		</div>
 		</div>
 
 
 
 

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

@@ -38,10 +38,10 @@ scene.add( spotLight );</code>
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo hex], [page:todo intensity], [page:todo distance], [page:todo angle], [page:todo exponent])</h3>
+		<h3>[name]([page:Integer hex], [page:Float intensity], [page:todo distance], [page:todo angle], [page:todo exponent])</h3>
 		<div>
 		<div>
-		hex -- todo <br />
-		intensity -- todo <br />
+		[page:Integer hex] — Numeric value of the RGB component of the color. <br />
+		[page:Float intensity] — Numeric value of the light's strength/intensity. <br />
 		distance -- todo <br />
 		distance -- todo <br />
 		angle -- todo <br />
 		angle -- todo <br />
 		exponent -- todo
 		exponent -- todo

+ 4 - 4
docs/api/materials/LineBasicMaterial.html

@@ -25,7 +25,7 @@
 		linewidth — Line thickness. Default is 1.<br />
 		linewidth — Line thickness. Default is 1.<br />
 		linecap — Define appearance of line ends. Default is 'round'.<br />
 		linecap — Define appearance of line ends. Default is 'round'.<br />
 		linejoin — Define appearance of line joints. Default is 'round'.<br />
 		linejoin — Define appearance of line joints. Default is 'round'.<br />
-		vertexColors — Define whether the material uses vertex colors, or not. Default is false.<br />
+		vertexColors — Define how the vertices gets colored. Default is THREE.NoColors.<br />
 		fog — Define whether the material color is affected by global fog settings. Default is false.
 		fog — Define whether the material color is affected by global fog settings. Default is false.
 		</div>
 		</div>
 
 
@@ -46,9 +46,9 @@
 		<div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
 		<div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
 
 
-		<h3>.[page:Boolean vertexColors]</h3>
-		<div>Define whether the material uses vertex colors, or not. Default is false.</div>
-		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
+		<h3>.[page:Integer vertexColors]</h3>
+		<div>Define how the vertices gets colored. Possible values are THREE.NoColors, THREE.FaceColors and THREE.VertexColors. Default is THREE.NoColors.</div>
+		<div>This setting might not have any effect when used with certain renderers.</div>
 
 
 		<h3>.[page:Boolean fog]</h3>
 		<h3>.[page:Boolean fog]</h3>
 		<div>Define whether the material color is affected by global fog settings.</div>
 		<div>Define whether the material color is affected by global fog settings.</div>

+ 22 - 45
docs/api/materials/Material.html

@@ -17,7 +17,7 @@
 
 
 		<h3>[name]()</h3>
 		<h3>[name]()</h3>
 		<div>
 		<div>
-		todo
+		This creates a generic material.
 		</div>
 		</div>
 
 
 
 
@@ -33,35 +33,44 @@
 		Material name. Default is an empty string.
 		Material name. Default is an empty string.
 		</div>
 		</div>
 
 
-		<h3>.[page:Number opacity]</h3>
+		<h3>.[page:Float opacity]</h3>
 		<div>
 		<div>
-		Opacity. Default is *1*.
+		Float in the range of 0.0 - 1.0 indicating how transparent the material is.
+		A value of 0.0 indicates fully transparent, 1.0 is fully opaque. If
+		*transparent* is not set to true for the material, the material will remain
+		fully opaque and this value will only affect its color.
 		</div>
 		</div>
+		<div>Default is *1.0*.</div>
 
 
 		<h3>.[page:Boolean transparent]</h3>
 		<h3>.[page:Boolean transparent]</h3>
 		<div>
 		<div>
-		Defines whether this material is transparent. This has an effect on rendering, as transparent objects need an special treatment, and are rendered after the opaque (i.e. non transparent) objects. For a working example of this behaviour, check the [page:WebGLRenderer WebGLRenderer] code.
+		Defines whether this material is transparent. This has an effect on rendering
+		as transparent objects need special treatment and are rendered after 
+		non-transparent objects. For a working example of this behaviour, check the
+		[page:WebGLRenderer WebGLRenderer] code.<br />
+		When set to true, the extent to which the material is transparent is
+		controlled by setting *opacity*.
 		</div>
 		</div>
 		<div>Default is *false*.</div>
 		<div>Default is *false*.</div>
 
 
 		<h3>.[page:Blending blending]</h3>
 		<h3>.[page:Blending blending]</h3>
 		<div>
 		<div>
-		Which blending to use when displaying objects with this material. Default is [page:NormalBlending].
+		Which blending to use when displaying objects with this material. Default is [page:Materials NormalBlending].
 		</div>
 		</div>
 
 
 		<h3>.[page:Integer blendSrc]</h3>
 		<h3>.[page:Integer blendSrc]</h3>
 		<div>
 		<div>
-		Blending source. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *SrcAlphaFactor*.
+		Blending source. It's one of the blending mode constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation SrcAlphaFactor]
 		</div>
 		</div>
 
 
 		<h3>.[page:Integer blendDst]</h3>
 		<h3>.[page:Integer blendDst]</h3>
 		<div>
 		<div>
-		Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is *OneMinusSrcAlphaFactor*.
+		Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
 		</div>
 		</div>
 
 
 		<h3>.[page:Integer blendEquation]</h3>
 		<h3>.[page:Integer blendEquation]</h3>
 		<div>
 		<div>
-		Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is *AddEquation*.
+		Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation AddEquation.]
 		</div>
 		</div>
 
 
 		<h3>.[page:Boolean depthTest]</h3>
 		<h3>.[page:Boolean depthTest]</h3>
@@ -112,19 +121,22 @@
 		Defines which of the face sides will be rendered - front, back or both.
 		Defines which of the face sides will be rendered - front, back or both.
 		</div>
 		</div>
 		<div>
 		<div>
-		Default is *THREE.FrontSide*. Other options are *THREE.BackSide* and *THREE.DoubleSide*.
+		Default is [page:Materials THREE.FrontSide]. Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
 		</div>
 		</div>
 
 
 		<h3>.[page:Boolean needsUpdate]</h3>
 		<h3>.[page:Boolean needsUpdate]</h3>
 		<div>
 		<div>
-		Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL.
+		Specifies that the material needs to be updated at the WebGL level. Set it to true if you made changes that need to be reflected in WebGL.
 		</div>
 		</div>
 		<div>
 		<div>
 		This property is automatically set to *true* when instancing a new material.
 		This property is automatically set to *true* when instancing a new material.
 		</div>
 		</div>
 
 
+		
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 		
 		
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
+		
 		<h3>.clone([page:todo material]) [page:todo]</h3>
 		<h3>.clone([page:todo material]) [page:todo]</h3>
 		<div>
 		<div>
 		material -- todo
 		material -- todo
@@ -133,46 +145,11 @@
 		todo
 		todo
 		</div>
 		</div>
 
 
-		<h3>.removeEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
 		<h3>.dispose() [page:todo]</h3>
 		<h3>.dispose() [page:todo]</h3>
 		<div>
 		<div>
 		todo
 		todo
 		</div>
 		</div>
 
 
-		<h3>.dispatchEvent([page:todo event]) [page:todo]</h3>
-		<div>
-		event -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.addEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.hasEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
 		<h3>.setValues([page:todo values]) [page:todo]</h3>
 		<h3>.setValues([page:todo values]) [page:todo]</h3>
 		<div>
 		<div>
 		values -- todo
 		values -- todo

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

@@ -28,13 +28,13 @@
 		wireframeLinecap — Define appearance of line ends. Default is 'round'.<br />
 		wireframeLinecap — Define appearance of line ends. Default is 'round'.<br />
 		wireframeLinejoin — Define appearance of line joints. Default is 'round'.<br />
 		wireframeLinejoin — Define appearance of line joints. Default is 'round'.<br />
 		shading — Define shading type. Default is THREE.SmoothShading.<br />
 		shading — Define shading type. Default is THREE.SmoothShading.<br />
-		vertexColors — Define whether the material uses vertex colors, or not. Default is false.<br />
+		vertexColors — Define how the vertices gets colored. Default is THREE.NoColors.<br />
 		fog — Define whether the material color is affected by global fog settings. Default is true.<br />
 		fog — Define whether the material color is affected by global fog settings. Default is true.<br />
-		lightMap — TODO. Default is null.<br />
-		specularMap — TODO. Default is null.<br />
-		envMap — TODO. Default is null.<br />
-		skinning — TODO. Default is false.<br />
-		morphTargets — TODO. Default is false.
+		lightMap — Set light map. Default is null.<br />
+		specularMap — Set specular map. Default is null.<br />
+		envMap — Set env map. Default is null.<br />
+		skinning — Define whether the material uses skinning. Default is false.<br />
+		morphTargets — Define whether the material uses morphTargets. Default is false.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
@@ -60,8 +60,8 @@
 		<h3>.[page:String shading]</h3>
 		<h3>.[page:String shading]</h3>
 		<div>Define shading type. Default is THREE.SmoothShading.</div>
 		<div>Define shading type. Default is THREE.SmoothShading.</div>
 
 
-		<h3>.[page:Boolean vertexColors]</h3>
-		<div>Define whether the material uses vertex colors, or not. Default is false.</div>
+		<h3>.[page:Integer vertexColors]</h3>
+		<div>Define how the vertices gets colored. Possible values are THREE.NoColors, THREE.FaceColors and THREE.VertexColors. Default is THREE.NoColors.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 
 
 		<h3>.[page:Boolean fog]</h3>
 		<h3>.[page:Boolean fog]</h3>

+ 10 - 12
docs/api/materials/MeshDepthMaterial.html

@@ -11,35 +11,33 @@
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
-
+		<div class="desc">A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.</div>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
 		<h3>[name]([page:todo parameters])</h3>
 		<h3>[name]([page:todo parameters])</h3>
 		<div>
 		<div>
-		parameters -- todo
+		parameters is an object with one or more properties defining the material's appearance. 
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		wireframe -- Render geometry as wireframe. Default is false (i.e. render as smooth shaded).<br/>
+		wireframeLinewidth -- Controls wireframe thickness. Default is 1.<br/>
 		</div>
 		</div>
 
 
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 
 
-
-		<h3>.[page:number wireframeLinewidth]</h3>
-		<div>
-		todo
-		</div> 
-
 		<h3>.[page:boolean wireframe]</h3>
 		<h3>.[page:boolean wireframe]</h3>
+		<div>Render geometry as wireframe. Default is false (i.e. render as smooth shaded).</div> 
+		
+		<h3>.[page:number wireframeLinewidth]</h3>
 		<div>
 		<div>
-		todo
+			Controls wireframe thickness. Default is 1.<br/><br/>
+			Due to limitations in the ANGLE layer, on Windows platforms linewidth will always be 1 regardless of the set value.
 		</div> 
 		</div> 
-
+		
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 

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

@@ -47,7 +47,7 @@
 		<h3>.[page:Integer shading]</h3>
 		<h3>.[page:Integer shading]</h3>
 		<div>How the triangles of a curved surface are rendered: as a smooth surface, as flat separate facets, or no shading at all.</div>
 		<div>How the triangles of a curved surface are rendered: as a smooth surface, as flat separate facets, or no shading at all.</div>
 
 
-		<div>Options are THREE.SmoothShading (default), THREE.FlatShading, THREE.NoShading.</div>
+		<div>Options are [page:Materials THREE.SmoothShading] (default), [page:Materials THREE.FlatShading], [page:Materials THREE.NoShading].</div>
 		
 		
 		<h3>.[page:Boolean wireframe]</h3>
 		<h3>.[page:Boolean wireframe]</h3>
 		<div>Whether the triangles' edges are displayed instead of surfaces. Default is *false*.</div>
 		<div>Whether the triangles' edges are displayed instead of surfaces. Default is *false*.</div>
@@ -64,8 +64,8 @@
 		<div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
 		<div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
 
 
-		<h3>.[page:Boolean vertexColors]</h3>
-		<div>Define whether the material uses vertex colors, or not. Default is *false*.</div>
+		<h3>.[page:Integer vertexColors]</h3>
+		<div>Define how the vertices gets colored. Possible values are THREE.NoColors, THREE.FaceColors and THREE.VertexColors. Default is THREE.NoColors.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 
 
 		<h3>.[page:Boolean fog]</h3>
 		<h3>.[page:Boolean fog]</h3>
@@ -88,12 +88,12 @@
 		<div>How much the environment map affects the surface; also see "combine".</div> 
 		<div>How much the environment map affects the surface; also see "combine".</div> 
 
 
 		<h3>.[page:Float refractionRatio]</h3>
 		<h3>.[page:Float refractionRatio]</h3>
-		<div>The index of refraction for an environment map using THREE.CubeRefractionMapping. Default is *0.98*.</div>
+		<div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>
 
 
 		<h3>.[page:Integer combine]</h3>
 		<h3>.[page:Integer combine]</h3>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div> 
 		<div>How to combine the result of the surface's color with the environment map, if any.</div> 
 		 
 		 
-		<div>Options are THREE.Multiply (default), THREE.MixOperation, THREE.AddOperation. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
+		<div>Options are [page:Textures THREE.Multiply] (default), [page:Textures THREE.MixOperation], [page:Textures THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
 		 
 		 
 		<h3>.[page:Boolean skinning]</h3>
 		<h3>.[page:Boolean skinning]</h3>
 		<div>Define whether the material uses skinning. Default is *false*.</div>
 		<div>Define whether the material uses skinning. Default is *false*.</div>

+ 17 - 13
docs/api/materials/MeshNormalMaterial.html

@@ -11,7 +11,7 @@
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A material that maps the normal vectors to RGB colors.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
@@ -19,10 +19,13 @@
 
 
 		<h3>[name]([page:todo parameters])</h3>
 		<h3>[name]([page:todo parameters])</h3>
 		<div>
 		<div>
-		parameters -- todo
+		parameters is an object with one or more properties defining the material's appearance. 
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		morphTargets -- Define whether the material uses morphTargets. Default is false.<br/>
+		shading --  How the triangles of a curved surface are rendered. Default is [page:Materials THREE.SmoothShading].<br/>
+		wireframe -- Render geometry as wireframe. Default is false (i.e. render as smooth shaded).<br/>
+		wireframeLinewidth -- Controls wireframe thickness. Default is 1.<br/>
 		</div>
 		</div>
 
 
 
 
@@ -31,23 +34,24 @@
 
 
 
 
 		<h3>.[page:boolean morphTargets]</h3>
 		<h3>.[page:boolean morphTargets]</h3>
-		<div>
-		todo
-		</div> 
+		<div>Define whether the material uses morphTargets. Default is false.</div> 
 
 
 		<h3>.[page:number shading]</h3>
 		<h3>.[page:number shading]</h3>
 		<div>
 		<div>
-		todo
-		</div> 
+			How the triangles of a curved surface are rendered: as a smooth surface, as flat separate facets, or no shading at all.<br/><br/>
+			Options are [page:Materials THREE.SmoothShading] (default), [page:Materials THREE.FlatShading]
+		</div>
+		
 
 
-		<h3>.[page:number wireframeLinewidth]</h3>
+		<h3>.[page:boolean wireframe]</h3>
 		<div>
 		<div>
-		todo
+			Render geometry as wireframe. Default is false (i.e. render as smooth shaded). 
 		</div> 
 		</div> 
-
-		<h3>.[page:boolean wireframe]</h3>
+		
+		<h3>.[page:number wireframeLinewidth]</h3>
 		<div>
 		<div>
-		todo
+			Controls wireframe thickness. Default is 1.<br/><br/>
+			Due to limitations in the ANGLE layer, on Windows platforms linewidth will always be 1 regardless of the set value.
 		</div> 
 		</div> 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>

+ 9 - 7
docs/api/materials/MeshPhongMaterial.html

@@ -19,10 +19,12 @@
 
 
 		<h3>[name]([page:todo parameters])</h3>
 		<h3>[name]([page:todo parameters])</h3>
 		<div>
 		<div>
-		parameters -- todo
+		parameters -- A JSON object with settable parameters.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Example:<br>
+		materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.FlatShading } ) );
+	
 		</div>
 		</div>
 
 
 
 
@@ -55,7 +57,7 @@
 		<h3>.[page:Integer shading]</h3>
 		<h3>.[page:Integer shading]</h3>
 		<div>How the triangles of a curved surface are rendered: as a smooth surface, as flat separate facets, or no shading at all.</div>
 		<div>How the triangles of a curved surface are rendered: as a smooth surface, as flat separate facets, or no shading at all.</div>
 
 
-		<div>Options are THREE.SmoothShading (default), THREE.FlatShading, THREE.NoShading.</div>
+		<div>Options are [page:Materials THREE.SmoothShading] (default), [page:Materials THREE.FlatShading], [page:Materials THREE.NoShading].</div>
 		
 		
 		<h3>.[page:Boolean wireframe]</h3>
 		<h3>.[page:Boolean wireframe]</h3>
 		<div>Whether the triangles' edges are displayed instead of surfaces. Default is *false*.</div>
 		<div>Whether the triangles' edges are displayed instead of surfaces. Default is *false*.</div>
@@ -72,8 +74,8 @@
 		<div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
 		<div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
 
 
-		<h3>.[page:Boolean vertexColors]</h3>
-		<div>Define whether the material uses vertex colors, or not. Default is *false*.</div>
+		<h3>.[page:Integer vertexColors]</h3>
+		<div>Define how the vertices gets colored. Possible values are THREE.NoColors, THREE.FaceColors and THREE.VertexColors. Default is THREE.NoColors.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 
 
 		<h3>.[page:Boolean fog]</h3>
 		<h3>.[page:Boolean fog]</h3>
@@ -96,12 +98,12 @@
 		<div>How much the environment map affects the surface; also see "combine".</div> 
 		<div>How much the environment map affects the surface; also see "combine".</div> 
 
 
 		<h3>.[page:Float refractionRatio]</h3>
 		<h3>.[page:Float refractionRatio]</h3>
-		<div>The index of refraction for an environment map using THREE.CubeRefractionMapping. Default is *0.98*.</div>
+		<div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>
 
 
 		<h3>.[page:Integer combine]</h3>
 		<h3>.[page:Integer combine]</h3>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div> 
 		<div>How to combine the result of the surface's color with the environment map, if any.</div> 
 		 
 		 
-		<div>Options are THREE.Multiply (default), THREE.MixOperation, THREE.AddOperation. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
+		<div>Options are [page:Textures THREE.MultiplyOperation] (default), [page:Textures THREE.MixOperation], [page:Textures THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
 		 
 		 
 		<h3>.[page:Boolean skinning]</h3>
 		<h3>.[page:Boolean skinning]</h3>
 		<div>Define whether the material uses skinning. Default is *false*.</div>
 		<div>Define whether the material uses skinning. Default is *false*.</div>

+ 0 - 2
docs/api/materials/ParticleBasicMaterial.html → docs/api/materials/ParticleSystemMaterial.html

@@ -48,8 +48,6 @@
 		<div>Specify whether particles' size will get smaller with the distance. Default is true.</div>
 		<div>Specify whether particles' size will get smaller with the distance. Default is true.</div>
 
 
 		<h3>.[page:Boolean vertexColors]</h3>
 		<h3>.[page:Boolean vertexColors]</h3>
-		<div>Define whether the material uses vertex colors, or not. Default is false.</div>
-		<div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
 
 
 		<h3>.[page:Boolean fog]</h3>
 		<h3>.[page:Boolean fog]</h3>
 		<div>Define whether the material color is affected by global fog settings.</div>
 		<div>Define whether the material color is affected by global fog settings.</div>

+ 21 - 6
docs/api/materials/ShaderMaterial.html

@@ -17,12 +17,27 @@
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo parameters])</h3>
+		<h3>[name]([page:Object parameters])</h3>
 		<div>
 		<div>
-		parameters -- todo
+		parameters -- An object containing various parameters setting up shaders and their uniforms.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		<br>
+		Example:<br>
+		<br>
+		uniforms = {
+			time: { type: "f", value: 1.0 },
+			resolution: { type: "v2", value: new THREE.Vector2() }
+		};
+
+		material = new THREE.ShaderMaterial( {
+
+			uniforms: uniforms,
+			vertexShader: document.getElementById( 'vertexShader' ).textContent,
+			fragmentShader: document.getElementById( 'fragmentShader' ).textContent
+
+		} );
+
 		</div>
 		</div>
 
 
 
 
@@ -32,17 +47,17 @@
 
 
 		<h3>.[page:object uniforms]</h3>
 		<h3>.[page:object uniforms]</h3>
 		<div>
 		<div>
-		todo
+		Uniforms defined inside GLSL shader code.
 		</div> 
 		</div> 
 
 
 		<h3>.[page:string fragmentShader]</h3>
 		<h3>.[page:string fragmentShader]</h3>
 		<div>
 		<div>
-		todo
+		Fragment shader GLSL code.  This is the actual code for the shader.  In the example above the code is retrieved from DOM elements emnbedded directly in the page although other methods can be used including specifying a string directly.  
 		</div> 
 		</div> 
 
 
 		<h3>.[page:string vertexShader]</h3>
 		<h3>.[page:string vertexShader]</h3>
 		<div>
 		<div>
-		todo
+		Vertex shader GLSL code.  This is the actual code for the shader.  In the example above the code is retrieved from DOM elements embedded directly in the page although other methods can be used including specifying a string directly.  
 		</div> 
 		</div> 
 
 
 		<h3>.[page:boolean morphTargets]</h3>
 		<h3>.[page:boolean morphTargets]</h3>

+ 0 - 0
docs/api/materials/ParticleCanvasMaterial.html → docs/api/materials/SpriteCanvasMaterial.html


+ 16 - 14
docs/api/math/Box2.html

@@ -43,7 +43,7 @@
 
 
 
 
 
 
-		<h3>.set([page:Vector2 min], [page:Vector2 max]) [page:todo]</h3>
+		<h3>.set([page:Vector2 min], [page:Vector2 max]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		min -- Lower (x, y) boundary of the box. <br />
 		min -- Lower (x, y) boundary of the box. <br />
 		max -- Upper (x, y) boundary of the box.
 		max -- Upper (x, y) boundary of the box.
@@ -52,7 +52,7 @@
 		Sets the lower and upper (x, y) boundaries of this box.
 		Sets the lower and upper (x, y) boundaries of this box.
 		</div>
 		</div>
 
 
-		<h3>.expandByPoint([page:Vector2 point]) [page:Box2]</h3>
+		<h3>.expandByPoint([page:Vector2 point]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		point -- Point that should be included in the box.
 		point -- Point that should be included in the box.
 		</div>
 		</div>
@@ -77,7 +77,7 @@
 		Determines whether or not this box intersects *box*.
 		Determines whether or not this box intersects *box*.
 		</div>
 		</div>
 
 
-		<h3>.setFromPoints([page:Array points]) [page:Box2]</h3>
+		<h3>.setFromPoints([page:Array points]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		points -- Set of points that the resulting box will envelop.
 		points -- Set of points that the resulting box will envelop.
 		</div>
 		</div>
@@ -93,7 +93,7 @@
 		Returns the width and height of this box.
 		Returns the width and height of this box.
 		</div>
 		</div>
 
 
-		<h3>.union([page:Box2 box]) [page:Box2]</h3>
+		<h3>.union([page:Box2 box]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		box -- Box that will be unioned with this box.
 		box -- Box that will be unioned with this box.
 		</div>
 		</div>
@@ -103,15 +103,17 @@
 		lower bounds.
 		lower bounds.
 		</div>
 		</div>
 
 
-		<h3>.getParameter([page:Vector2 point]) [page:Vector2]</h3>
+		<h3>.getParameter([page:Vector2 point], [page:Vector2 optionalTarget]) [page:Vector2]</h3>
 		<div>
 		<div>
-		point -- Point to parametrize.
+		point -- [page:Vector2]<br/>
+		optionalTarget -- [page:Vector2]<br/>
+		
 		</div>
 		</div>
 		<div>
 		<div>
-		Returns point as a proportion of this box's width and height.
+		Returns a point as a proportion of this box's width and height.
 		</div>
 		</div>
 
 
-		<h3>.expandByScalar([page:float scalar]) [page:Box2]</h3>
+		<h3>.expandByScalar([page:float scalar]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		scalar -- Distance to expand.
 		scalar -- Distance to expand.
 		</div>
 		</div>
@@ -120,7 +122,7 @@
 		will be contracted.
 		will be contracted.
 		</div>
 		</div>
 
 
-		<h3>.intersect([page:Box2 box]) [page:Box2]</h3>
+		<h3>.intersect([page:Box2 box]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		box -- Box to intersect with.
 		box -- Box to intersect with.
 		</div>
 		</div>
@@ -139,7 +141,7 @@
 		this function also returns true. 
 		this function also returns true. 
 		</div>
 		</div>
 
 
-		<h3>.translate([page:Vector2 offset]) [page:Box2]</h3>
+		<h3>.translate([page:Vector2 offset]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		offset -- Direction and distance of offset.
 		offset -- Direction and distance of offset.
 		</div>
 		</div>
@@ -168,7 +170,7 @@
 		Returns true if this box and *box* share the same lower and upper bounds.
 		Returns true if this box and *box* share the same lower and upper bounds.
 		</div>
 		</div>
 
 
-		<h3>.expandByVector([page:Vector2 vector]) [page:Box2]</h3>
+		<h3>.expandByVector([page:Vector2 vector]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		vector -- Amount to expand this box in each dimension.
 		vector -- Amount to expand this box in each dimension.
 		</div>
 		</div>
@@ -178,7 +180,7 @@
 		this box will be expanded by the y component of *vector* in both directions.
 		this box will be expanded by the y component of *vector* in both directions.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:Box2 box]) [page:Box2]</h3>
+		<h3>.copy([page:Box2 box]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		box -- Box to copy.
 		box -- Box to copy.
 		</div>
 		</div>
@@ -186,7 +188,7 @@
 		Copies the values of *box* to this box.
 		Copies the values of *box* to this box.
 		</div>
 		</div>
 
 
-		<h3>.makeEmpty() [page:Box2]</h3>
+		<h3>.makeEmpty() [page:Box2 this]</h3>
 		<div>
 		<div>
 		Makes this box empty.
 		Makes this box empty.
 		</div>
 		</div>
@@ -216,7 +218,7 @@
 		Returns true if the specified point lies within the boundaries of this box.
 		Returns true if the specified point lies within the boundaries of this box.
 		</div>
 		</div>
 
 
-		<h3>.setFromCenterAndSize([page:Vector2 center], [page:Vector2 size]) [page:Box2]</h3>
+		<h3>.setFromCenterAndSize([page:Vector2 center], [page:Vector2 size]) [page:Box2 this]</h3>
 		<div>
 		<div>
 		center -- Desired center position of the box. <br />
 		center -- Desired center position of the box. <br />
 		size -- Desired x and y dimensions of the box. 
 		size -- Desired x and y dimensions of the box. 

+ 81 - 81
docs/api/math/Box3.html

@@ -9,19 +9,19 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">Represents a boundary box in 3d space.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo min], [page:todo max])</h3>
+		<h3>[name]([page:Vector3 min], [page:Vector3 max])</h3>
 		<div>
 		<div>
-		min -- todo <br />
-		max -- todo
+		min -- Lower (x, y, z) boundary of the box.  <br />
+		max -- Upper (x, y, z) boundary of the box.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Creates a box bounded by min and max
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
@@ -30,202 +30,202 @@
 
 
 		<h3>.[page:Vector3 max]</h3>
 		<h3>.[page:Vector3 max]</h3>
 		<div>
 		<div>
-		todo
+		Upper (x, y, z) boundary of this box.
 		</div> 
 		</div> 
 
 
 		<h3>.[page:Vector3 min]</h3>
 		<h3>.[page:Vector3 min]</h3>
 		<div>
 		<div>
-		todo
+		Lower (x, y, z) boundary of this box.
 		</div> 
 		</div> 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
 
 
-		<h3>.set([page:todo min], [page:todo max]) [page:todo]</h3>
+		<h3>.set([page:Vector3 min], [page:Vector3 max]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		min -- todo <br />
-		max -- todo
+		min -- Upper (x, y, z) boundary of this box. <br />
+		max -- Lower (x, y, z) boundary of this box.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the lower and upper (x, y, z) boundaries of this box.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo matrix]) [page:todo]</h3>
+		<h3>.applyMatrix4([page:Matrix4 matrix]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		matrix -- todo
+		matrix -- [page:Matrix4].
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Transform the box with a Matrix4.
 		</div>
 		</div>
 
 
-		<h3>.expandByPoint([page:todo point]) [page:todo]</h3>
+		<h3>.expandByPoint([page:Vector3 point]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		point -- todo
-		</div>
-		<div>
-		todo
+		Expands the box outwards by the point. It takes the min and max values of the box.
 		</div>
 		</div>
 
 
-		<h3>.clampPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.clampPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		optionalTarget -- todo
+		point -- [page:Vector3] <br />
+		optionalTarget -- [page:Vector3] An optional target point.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Clamp a point within the min and max boundaries of the box. Returns either a new point or the modified passed target.
 		</div>
 		</div>
 
 
-		<h3>.isIntersectionBox([page:todo box]) [page:todo]</h3>
+		<h3>.isIntersectionBox([page:Box3 box]) [page:Boolean]</h3>
 		<div>
 		<div>
-		box -- todo
+		box -- [page:Box3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return whether or not the passed box intersects with this Box3.
 		</div>
 		</div>
 
 
-		<h3>.setFromPoints([page:todo points]) [page:todo]</h3>
+		<h3>.setFromPoints([page:Array points])</h3>
 		<div>
 		<div>
-		points -- todo
+		points -- [page:Array] of [page:Vector3] points
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets this box to the min value and max value of all the points in the array. If the array is empty, then it sets the box as empty.
 		</div>
 		</div>
 
 
-		<h3>.size([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.size([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- [page:Vector3] (optional)
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns either a new Vector3 or the target Vector3 that represents the size of the box from the min point to max point.
 		</div>
 		</div>
 
 
-		<h3>.union([page:todo box]) [page:todo]</h3>
+		<h3>.union([page:Box3 box]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		box -- todo
+		box -- [page:Box3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the box's min and max boundaries to union of the two boxes.
 		</div>
 		</div>
 
 
-		<h3>.getParameter([page:todo point]) [page:todo]</h3>
+		<h3>.getParameter([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]<br/>
+		optionalTarget -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a point as a proportion of this box's width, height, and depth. If the point is contained by the box the x, y, and z of the returned vector will be between 0 and 1.
 		</div>
 		</div>
 
 
-		<h3>.expandByScalar([page:todo scalar]) [page:todo]</h3>
+		<h3>.expandByScalar([page:Float scalar]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		scalar -- todo
+		scalar -- [page:Float] representing the distance to expand
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Expands or contracts the box by adding the scalar value to the box's min and max vectors.
 		</div>
 		</div>
 
 
-		<h3>.intersect([page:todo box]) [page:todo]</h3>
+		<h3>.intersect([page:Box3 box]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		box -- todo
+		box -- [page:Box3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the intersection of the two boxes, setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds.
+ 
 		</div>
 		</div>
 
 
-		<h3>.containsBox([page:todo box]) [page:todo]</h3>
+		<h3>.containsBox([page:Box3 box]) [page:Boolean]</h3>
 		<div>
 		<div>
-		box -- todo
+		box -- [page:Box3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns true if this box includes the entirety of box. If this and box overlap exactly, this function also returns true.
+ 
 		</div>
 		</div>
 
 
-		<h3>.translate([page:todo offset]) [page:todo]</h3>
+		<h3>.translate([page:Vector3 offset]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		offset -- todo
+		offset -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Translates the box the distance of the offset.
 		</div>
 		</div>
 
 
-		<h3>.empty() [page:todo]</h3>
+		<h3>.empty() [page:Boolean]</h3>
 		<div>
 		<div>
-		todo
+		Checks to see if the box is empty. If the lower and upper bounds of the box are equal, this function still returns false as the box would still contain one point.
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.clone() [page:Box3]</h3>
 		<div>
 		<div>
-		todo
+		Returns a copy of this box.
 		</div>
 		</div>
 
 
-		<h3>.equals([page:todo box]) [page:todo]</h3>
+		<h3>.equals([page:Box3 box]) [page:Boolean]</h3>
 		<div>
 		<div>
-		box -- todo
+		box -- [page:Box3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns true if the boes share the same lower and upper bounds. 
 		</div>
 		</div>
 
 
-		<h3>.expandByVector([page:todo vector]) [page:todo]</h3>
+		<h3>.expandByVector([page:Vector3 vector]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		vector -- todo
+		vector -- [page:Vector3] representing the amount to expand this box in each dimension.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Adds the passed vector to the upper boundary, and subtracts it from the lower boundary.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo box]) [page:todo]</h3>
+		<h3>.copy([page:Box3 box]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		box -- todo
+		box -- [page:Box3] to copy.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copies the values of the passed box to this box.
 		</div>
 		</div>
 
 
-		<h3>.makeEmpty() [page:todo]</h3>
+		<h3>.makeEmpty() [page:Box3 this]</h3>
 		<div>
 		<div>
-		todo
+		Makes this box empty so that it cannot contain any points.
 		</div>
 		</div>
 
 
-		<h3>.center([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.center([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- [page:Vector3] If specified, the result will be copied here.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the center point of this box. 
 		</div>
 		</div>
 
 
-		<h3>.getBoundingSphere([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.getBoundingSphere([page:Sphere optionalTarget]) [page:Sphere]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- [page:Sphere]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a bounding sphere.
 		</div>
 		</div>
 
 
-		<h3>.distanceToPoint([page:todo point]) [page:todo]</h3>
+		<h3>.distanceToPoint([page:Vector3 point]) [page:Float]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the distance from any edge of this box to the specified point. If the point lies inside of this box, the distance will be 0.
 		</div>
 		</div>
 
 
-		<h3>.containsPoint([page:todo point]) [page:todo]</h3>
+		<h3>.containsPoint([page:Vector3 point]) [page:Boolean]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns true if the specified point lies within the boundaries of this box.
 		</div>
 		</div>
 
 
-		<h3>.setFromCenterAndSize([page:todo center], [page:todo size]) [page:todo]</h3>
+		<h3>.setFromCenterAndSize([page:Vector3 center], [page:Vector3 size]) [page:Box3 this]</h3>
 		<div>
 		<div>
-		center -- todo <br />
-		size -- todo
+		center -- [page:Vector3] representing the center position.<br />
+		size -- [page:Vector3] representing the dimensions of the box.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets this box based on a center vector, and width, height, and depth vector.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 19 - 19
docs/api/math/Color.html

@@ -47,7 +47,7 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-		<h3>.copy( [page:Color color] ) [page:this]</h3>
+		<h3>.copy( [page:Color color] ) [page:Color this]</h3>
 		<div>
 		<div>
 		color — Color to copy.
 		color — Color to copy.
 		</div>
 		</div>
@@ -55,7 +55,7 @@
 		Copies given color.
 		Copies given color.
 		</div>
 		</div>
 
 
-		<h3>.copyGammaToLinear( [page:Color color] ) [page:this]</h3>
+		<h3>.copyGammaToLinear( [page:Color color] ) [page:Color this]</h3>
 		<div>
 		<div>
 		color — Color to copy.
 		color — Color to copy.
 		</div>
 		</div>
@@ -63,7 +63,7 @@
 		Copies given color making conversion from gamma to linear space.
 		Copies given color making conversion from gamma to linear space.
 		</div>
 		</div>
 
 
-		<h3>.copyLinearToGamma( [page:Color color] ) [page:this]</h3>
+		<h3>.copyLinearToGamma( [page:Color color] ) [page:Color this]</h3>
 		<div>
 		<div>
 		color — Color to copy.
 		color — Color to copy.
 		</div>
 		</div>
@@ -71,17 +71,17 @@
 		Copies given color making conversion from linear to gamma space.
 		Copies given color making conversion from linear to gamma space.
 		</div>
 		</div>
 
 
-		<h3>.convertGammaToLinear() [page:this]</h3>
+		<h3>.convertGammaToLinear() [page:Color this]</h3>
 		<div>
 		<div>
 		Converts this color from gamma to linear space.
 		Converts this color from gamma to linear space.
 		</div>
 		</div>
 
 
-		<h3>.convertLinearToGamma() [page:this]</h3>
+		<h3>.convertLinearToGamma() [page:Color this]</h3>
 		<div>
 		<div>
 		Converts this color from linear to gamma space.
 		Converts this color from linear to gamma space.
 		</div>
 		</div>
 
 
-		<h3>.setRGB( [page:Float r], [page:Float g], [page:Float b] ) [page:this]</h3>
+		<h3>.setRGB( [page:Float r], [page:Float g], [page:Float b] ) [page:Color this]</h3>
 		<div>
 		<div>
 		r — Red channel value between 0 and 1.<br />
 		r — Red channel value between 0 and 1.<br />
 		g — Green channel value between 0 and 1.<br />
 		g — Green channel value between 0 and 1.<br />
@@ -101,7 +101,7 @@
 		Returns the string formated hexadecimal value of this color.
 		Returns the string formated hexadecimal value of this color.
 		</div>
 		</div>
 
 
-		<h3>.setHex( [page:Integer hex] ) [page:this]</h3>
+		<h3>.setHex( [page:Integer hex] ) [page:Color this]</h3>
 		<div>
 		<div>
 		hex — Color in hexadecimal.<br />
 		hex — Color in hexadecimal.<br />
 		</div>
 		</div>
@@ -109,7 +109,7 @@
 		Sets this color from a hexadecimal value.
 		Sets this color from a hexadecimal value.
 		</div>
 		</div>
 
 
-		<h3>.setStyle( [page:String style] ) [page:this]</h3>
+		<h3>.setStyle( [page:String style] ) [page:Color this]</h3>
 		<div>
 		<div>
 		style — color as a CSS-style string, for example, "rgb(250, 0,0)", "rgb(100%,0%,0%)", "#ff0000", "#f00", or "red"
 		style — color as a CSS-style string, for example, "rgb(250, 0,0)", "rgb(100%,0%,0%)", "#ff0000", "#f00", or "red"
 		</div>
 		</div>
@@ -122,7 +122,7 @@
 		Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
 		Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
 		</div>
 		</div>
 
 
-		<h3>.setHSL( [page:Float h], [page:Float s], [page:Float l] ) [page:this]</h3>
+		<h3>.setHSL( [page:Float h], [page:Float s], [page:Float l] ) [page:Color this]</h3>
 		<div>
 		<div>
 		h — hue value between 0.0 and 1.0 <br />
 		h — hue value between 0.0 and 1.0 <br />
 		s — saturation value between 0.0 and 1.0 <br />
 		s — saturation value between 0.0 and 1.0 <br />
@@ -137,37 +137,37 @@
 		Returns an object with properties h, s, and l.
 		Returns an object with properties h, s, and l.
 		</div>
 		</div>
 
 
-		<h3>.offsetHSL( [page:Float h], [page:Float s], [page:Float l] ) [page:this]</h3>
+		<h3>.offsetHSL( [page:Float h], [page:Float s], [page:Float l] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Adds given h, s, and l to this color's existing h, s, and l values.
 		Adds given h, s, and l to this color's existing h, s, and l values.
 		</div>
 		</div>
 
 
-		<h3>.add ( [page:Color color] ) [page:this]</h3>
+		<h3>.add ( [page:Color color] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Adds rgb values of given color to rgb values of this color
 		Adds rgb values of given color to rgb values of this color
 		</div>
 		</div>
 
 
-		<h3>.addColors( [page:Color color1], [page:Color color2] ) [page:this]</h3>
+		<h3>.addColors( [page:Color color1], [page:Color color2] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Sets this color to the sum of color1 and color2
 		Sets this color to the sum of color1 and color2
 		</div>
 		</div>
 
 
-		<h3>.addScalar( [page:Number s] ) [page:this]</h3>
+		<h3>.addScalar( [page:Number s] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Adds s to the rgb values of this color
 		Adds s to the rgb values of this color
 		</div>
 		</div>
 
 
-		<h3>.multiply( [page:Color color] ) [page:this]</h3>
+		<h3>.multiply( [page:Color color] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Multiplies this color's rgb values by given color's rgb values
 		Multiplies this color's rgb values by given color's rgb values
 		</div>
 		</div>
 
 
-		<h3>.multiplyScalar( [page:Number s] ) [page:this]</h3>
+		<h3>.multiplyScalar( [page:Number s] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Multiplies this color's rgb values by s
 		Multiplies this color's rgb values by s
 		</div>
 		</div>
 
 
-		<h3>.lerp( [page:Color color], alpha ) [page:this]</h3>
+		<h3>.lerp( [page:Color color], alpha ) [page:Color this]</h3>
 		<div>
 		<div>
 		alpha -- a number between 0 and 1.
 		alpha -- a number between 0 and 1.
 		</div>
 		</div>
@@ -175,7 +175,7 @@
 		Linear interpolation of this colors rgb values and the rgb values of the first argument. The alpha argument can be thought of as the percent between the two colors, where 0 is this color and 1 is the first argument.
 		Linear interpolation of this colors rgb values and the rgb values of the first argument. The alpha argument can be thought of as the percent between the two colors, where 0 is this color and 1 is the first argument.
 		</div>
 		</div>
 
 
-		<h3>.equals( [page:Color c] ) [page:this]</h3>
+		<h3>.equals( [page:Color c] ) [page:Color this]</h3>
 		<div>
 		<div>
 		Compares this color and c and returns true if they are the same, false otherwise.
 		Compares this color and c and returns true if they are the same, false otherwise.
 		</div>
 		</div>
@@ -185,9 +185,9 @@
 		Clones this color.
 		Clones this color.
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo value]) [page:this]</h3>
+		<h3>.set( value ) [page:Color this]</h3>
 		<div>
 		<div>
-		value -- either an instance of Color, a hexadecimal value, or a css style string
+		value -- either an instance of [page:Color], a [page:Integer hexadecimal] value, or a css style [page:String string]
 		</div>
 		</div>
 		<div>
 		<div>
 		Delegates to .copy, .setStyle, or .setHex depending on input type.
 		Delegates to .copy, .setStyle, or .setHex depending on input type.

+ 17 - 14
docs/api/math/Euler.html

@@ -9,7 +9,10 @@
   <body>
   <body>
     <h1>[name]</h1>
     <h1>[name]</h1>
 
 
-    <div class="desc">Euler Angles.</div>
+    <div class="desc">Euler Angles. <br/><br/>
+    
+    Euler angles describe a rotation transformation by rotating an object on its various axes in specified amounts per axis, and a specified axis order.
+    (More information on <a href='http://en.wikipedia.org/wiki/Euler_angles' target='blank'>Wikipedia</a>)</div>
 
 
     <h2>Example</h2>
     <h2>Example</h2>
 
 
@@ -22,11 +25,11 @@
     <h2>Constructor</h2>
     <h2>Constructor</h2>
 
 
 
 
-    <h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:String Order] )</h3>
+    <h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )</h3>
     <div>
     <div>
-    x -- [page:Float] the angle of the x axis<br />
-    y -- [page:Float] the angle of the y axis<br />
-    z -- [page:Float] the angle of the z axis<br />
+    x -- [page:Float] the angle of the x axis in radians<br />
+    y -- [page:Float] the angle of the y axis in radians<br />
+    z -- [page:Float] the angle of the z axis in radians<br />
     order -- [page:String] A string representing the order that the rotations are applied, defaults to 'XYZ' (must be upper case).
     order -- [page:String] A string representing the order that the rotations are applied, defaults to 'XYZ' (must be upper case).
     </div>
     </div>
     <div>
     <div>
@@ -48,23 +51,23 @@
 
 
     <h2>Methods</h2>
     <h2>Methods</h2>
 
 
-    <h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:String order] ) [page:this]</h3>
+    <h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:String order] ) [page:Euler this]</h3>
     <div>
     <div>
-    x -- [page:Float] Angle in x axis<br />
-    x -- [page:Float] Angle in x axis<br />
-    x -- [page:Float] Angle in x axis<br />
+    x -- [page:Float] Angle in x axis in radians<br />
+    x -- [page:Float] Angle in x axis in radians<br />
+    x -- [page:Float] Angle in x axis in radians<br />
     order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
     order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
     </div>
     </div>
     <div>
     <div>
     Sets the angles of this euler transform.
     Sets the angles of this euler transform.
     </div>
     </div>
 
 
-    <h3>.copy( [page:Euler euler] ) [page:this]</h3>
+    <h3>.copy( [page:Euler euler] ) [page:Euler this]</h3>
     <div>
     <div>
     Copies value of *euler* to this euler.
     Copies value of *euler* to this euler.
     </div>
     </div>
 
 
-    <h3>.setFromRotationMatrix( [page:Matrix4 m], [page:String order] ) [page:this]</h3>
+    <h3>.setFromRotationMatrix( [page:Matrix4 m], [page:String order] ) [page:Euler this]</h3>
     <div>
     <div>
     m -- [page:Matrix4] assumes upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled)<br />
     m -- [page:Matrix4] assumes upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled)<br />
     order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
     order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
@@ -73,7 +76,7 @@
     Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
     Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
     </div>
     </div>
 
 
-    <h3>.setFromQuaternion( [page:Quaternion q], [page:String order] ) [page:this]</h3>
+    <h3>.setFromQuaternion( [page:Quaternion q], [page:String order] ) [page:Euler this]</h3>
     <div>
     <div>
     q -- [page:Quaternion] quaternion must be normalized<br />
     q -- [page:Quaternion] quaternion must be normalized<br />
     order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
     order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
@@ -82,13 +85,13 @@
     Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
     Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
     </div>
     </div>
 
 
-    <h3>.reorder( [page:String newOrder] ) [page:this]</h3>
+    <h3>.reorder( [page:String newOrder] ) [page:Euler this]</h3>
     <div>
     <div>
     Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order. <br />
     Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order. <br />
     WARNING: this discards revolution information.
     WARNING: this discards revolution information.
     </div>
     </div>
 
 
-    <h3>.fromArray([page:Array array]) [page:this]</h3>
+    <h3>.fromArray([page:Array array]) [page:Euler this]</h3>
     <div>
     <div>
     array -- [page:Array] of length 3 or 4. array[3] is an optional order argument.
     array -- [page:Array] of length 3 or 4. array[3] is an optional order argument.
     </div>
     </div>

+ 28 - 28
docs/api/math/Frustum.html

@@ -15,17 +15,17 @@
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo p0], [page:todo p1], [page:todo p2], [page:todo p3], [page:todo p4], [page:todo p5])</h3>
+		<h3>[name]([page:Plane p0], [page:Plane p1], [page:Plane p2], [page:Plane p3], [page:Plane p4], [page:Plane p5])</h3>
 		<div>
 		<div>
-		p0 -- todo <br />
-		p1 -- todo <br />
-		p2 -- todo <br />
-		p3 -- todo <br />
-		p4 -- todo <br />
-		p5 -- todo
+		p0 -- [page:Plane] <br />
+		p1 -- [page:Plane] <br />
+		p2 -- [page:Plane] <br />
+		p3 -- [page:Plane] <br />
+		p4 -- [page:Plane] <br />
+		p5 -- [page:Plane]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Creates a frustum from the designated planes.
 		</div>
 		</div>
 
 
 
 
@@ -33,7 +33,7 @@
 
 
 		<h3>.[page:Array planes]</h3>
 		<h3>.[page:Array planes]</h3>
 		<div>
 		<div>
-		Array of 6 [page:Vector4 vectors].
+		Array of 6 [page:Plane planes].
 		</div>
 		</div>
 
 
 
 
@@ -46,46 +46,46 @@
 		Checks whether the object is inside the Frustum.
 		Checks whether the object is inside the Frustum.
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.clone() [page:Frustum]</h3>
 		<div>
 		<div>
-		todo
+		Return a copy of this Frustum
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo p0], [page:todo p1], [page:todo p2], [page:todo p3], [page:todo p4], [page:todo p5]) [page:todo]</h3>
+		<h3>.set([page:Plane p0], [page:Plane p1], [page:Plane p2], [page:Plane p3], [page:Plane p4], [page:Plane p5]) [page:Boolean]</h3>
 		<div>
 		<div>
-		p0 -- todo <br />
-		p1 -- todo <br />
-		p2 -- todo <br />
-		p3 -- todo <br />
-		p4 -- todo <br />
-		p5 -- todo
+		p0 -- [page:Plane] <br />
+		p1 -- [page:Plane] <br />
+		p2 -- [page:Plane] <br />
+		p3 -- [page:Plane] <br />
+		p4 -- [page:Plane] <br />
+		p5 -- [page:Plane]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the current frustum from the passed planes. No plane order is implicitely implied.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo frustum]) [page:todo]</h3>
+		<h3>.copy([page:Frustum frustum]) [page:Frustum this]</h3>
 		<div>
 		<div>
-		frustum -- todo
+		frustum -- The frustum to copy
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copies the values of the passed frustum.
 		</div>
 		</div>
 
 
-		<h3>.containsPoint([page:todo point]) [page:todo]</h3>
+		<h3>.containsPoint([page:Vector3 point]) [page:Boolean]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3] to test
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if the frustum contains the point.
 		</div>
 		</div>
 
 
-		<h3>.intersectsSphere([page:todo sphere]) [page:todo]</h3>
+		<h3>.intersectsSphere([page:Sphere sphere]) [page:Boolean]</h3>
 		<div>
 		<div>
-		sphere -- todo
+		sphere -- [page:Sphere]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Check to see if the sphere intersects with the frustum.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 50 - 56
docs/api/math/Line3.html

@@ -2,26 +2,26 @@
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
 		<meta charset="utf-8" />
 		<meta charset="utf-8" />
-		<script src="../../../list.js"></script>
-		<script src="../../../page.js"></script>
-		<link type="text/css" rel="stylesheet" href="../../../page.css" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
 	</head>
 	</head>
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A geometric line segment represented by a start and end point.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo start], [page:todo end])</h3>
+		<h3>[name]([page:Vector3 start], [page:Vector3 end])</h3>
 		<div>
 		<div>
-		start -- todo <br />
-		end -- todo
+		start -- [page:Vector3] Start of the line segment<br />
+		end -- [page:Vector3] End of the line segment
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		The start and end vectors default to origin vectors if none are set.
 		</div>
 		</div>
 
 
 
 
@@ -30,109 +30,103 @@
 
 
 
 
 		<h3>.[page:Vector3 start]</h3>
 		<h3>.[page:Vector3 start]</h3>
-		<div>
-		todo
-		</div> 
 
 
 		<h3>.[page:Vector3 end]</h3>
 		<h3>.[page:Vector3 end]</h3>
-		<div>
-		todo
-		</div> 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
 
 
-		<h3>.closestPointToPointParameter([page:todo point], [page:todo clampToLine]) [page:todo]</h3>
+		<h3>.set([page:Vector3 start], [page:Vector3 end]) [page:Line3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		clampToLine -- todo
+		start -- [page:Vector3] <br />
+		end -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the start and end values by copying the provided vectors.
 		</div>
 		</div>
 
 
-		<h3>.distanceSq() [page:todo]</h3>
+		<h3>.copy([page:Line3 line]) [page:Line3]</h3>
 		<div>
 		<div>
-		todo
+		line -- [page:Line3]
 		</div>
 		</div>
-
-		<h3>.copy([page:todo line]) [page:todo]</h3>
 		<div>
 		<div>
-		line -- todo
+		Copies the passed line's start and end vectors to this line.
 		</div>
 		</div>
+
+		<h3>.clone() [page:Line3]</h3>
 		<div>
 		<div>
-		todo
+		Return a new copy of this [page:Line3].
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo matrix]) [page:todo]</h3>
+		<h3>.equals([page:Line3 line]) [page:Boolean]</h3>
 		<div>
 		<div>
-		matrix -- todo
+		line -- [page:Line3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
-		</div>
 
 
-		<h3>.distance() [page:todo]</h3>
+		<h3>.distance() [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		Returns the length of the line segment.
 		</div>
 		</div>
-
-		<h3>.clone() [page:todo]</h3>
+		Returns true if both line's start and end points are equal.
+		</div>
+		
+		<h3>.distanceSq() [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		Returns the line segment's length squared.
 		</div>
 		</div>
 
 
-		<h3>.equals([page:todo line]) [page:todo]</h3>
+		<h3>.applyMatrix4([page:Matrix4 matrix]) [page:Line3 this]</h3>
 		<div>
 		<div>
-		line -- todo
+		matrix -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Apply a matrix transform to the line segment.
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo start], [page:todo end]) [page:todo]</h3>
+		<h3>.at([page:Float t], [page:Vector3 optionalTarget]) [page:Vector]</h3>
 		<div>
 		<div>
-		start -- todo <br />
-		end -- todo
+		t -- [page:Float] Use values 0-1 to return a result on the line segment. <br />
+		optionalTarget -- [page:Vector] Optional target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
 		</div>
 		</div>
-
-		<h3>.at([page:todo t], [page:todo optionalTarget]) [page:todo]</h3>
+		
+		<h3>.center([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		t -- todo <br />
-		optionalTarget -- todo
+		optionalTarget -- [page:Vector3] Optional target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return the center of the line segment.
 		</div>
 		</div>
 
 
-		<h3>.delta([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.delta([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- [page:Vector3] Optional target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the delta vector of the line segment, or the end vector minus the start vector.
 		</div>
 		</div>
 
 
-		<h3>.closestPointToPoint([page:todo point], [page:todo clampToLine], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.closestPointToPoint([page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		clampToLine -- todo <br />
-		optionalTarget -- todo
+		point -- [page:Vector3] <br />
+		clampToLine -- [page:Boolean] <br />
+		optionalTarget -- [page:Vector3] Optional target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the closets point on the line. If clamp to line is true, then the returned value will be clamped to the line segment.
 		</div>
 		</div>
 
 
-		<h3>.center([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.closestPointToPointParameter([page:Vector3 point], [page:Boolean clampToLine]) [page:Float]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		point -- [page:Vector3] <br />
+		clampToLine -- [page:Boolean]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a point parameter based on the closest point as projected on the line segement. If clamp to line is true, then the returned value will be between 0 and 1.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 19 - 17
docs/api/math/Math.html

@@ -72,42 +72,44 @@
 		Returns -1 if *x* is less than 0, 1 if *x* is greater than 0, and 0 if *x* is zero.
 		Returns -1 if *x* is less than 0, 1 if *x* is greater than 0, and 0 if *x* is zero.
 		</div>
 		</div>
 
 
-		<h3>.degToRad([page:todo degrees]) [page:todo]</h3>
+		<h3>.degToRad([page:Float degrees]) [page:Float]</h3>
 		<div>
 		<div>
-		degrees -- todo
+		degrees -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Converts degrees to radians.
 		</div>
 		</div>
 
 
-		<h3>.smoothstep([page:todo x], [page:todo min], [page:todo max]) [page:todo]</h3>
+		<h3>.radToDeg([page:Float radians]) [page:Float]</h3>
 		<div>
 		<div>
-		x -- todo <br />
-		min -- todo <br />
-		max -- todo
+		radians -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Converts radians to degrees
 		</div>
 		</div>
 
 
-		<h3>.smootherstep([page:todo x], [page:todo min], [page:todo max]) [page:todo]</h3>
+		<h3>.smoothstep([page:Float x], [page:Float min], [page:Float max]) [page:Float]</h3>
 		<div>
 		<div>
-		x -- todo <br />
-		min -- todo <br />
-		max -- todo
+		x -- The value to evaluate based on its position between min and max. <br />
+		min -- Any x value below min will be 0 <br />
+		max -- Any x value above max will be 1
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a value between 0-1 that represents the percentage that x has moved between min and max, but smoothed or slowed down the closer X is to the min and max.<br/><br/>
+		
+		[link:http://en.wikipedia.org/wiki/Smoothstep Wikipedia]
 		</div>
 		</div>
 
 
-		<h3>.radToDeg([page:todo radians]) [page:todo]</h3>
+		<h3>.smootherstep([page:Float x], [page:Float min], [page:Float max]) [page:Float]</h3>
 		<div>
 		<div>
-		radians -- todo
+		x -- The value to evaluate based on its position between min and max. <br />
+		min -- Any x value below min will be 0 <br />
+		max --  Any x value above max will be 1
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a value between 0-1. It works the same as smoothstep, but more smooth.
 		</div>
 		</div>
-
+		
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 60 - 47
docs/api/math/Matrix3.html

@@ -15,20 +15,26 @@
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo n11], [page:todo n12], [page:todo n13], [page:todo n21], [page:todo n22], [page:todo n23], [page:todo n31], [page:todo n32], [page:todo n33])</h3>
+		<h3>[name]([page:Float n11], [page:Float n12], [page:Float n13], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n31], [page:Float n32], [page:Float n33])</h3>
 		<div>
 		<div>
-		n11 -- todo <br />
-		n12 -- todo <br />
-		n13 -- todo <br />
-		n21 -- todo <br />
-		n22 -- todo <br />
-		n23 -- todo <br />
-		n31 -- todo <br />
-		n32 -- todo <br />
-		n33 -- todo
+		n11 -- [page:Float] <br />
+		n12 -- [page:Float] <br />
+		n13 -- [page:Float] <br />
+		n21 -- [page:Float] <br />
+		n22 -- [page:Float] <br />
+		n23 -- [page:Float] <br />
+		n31 -- [page:Float] <br />
+		n32 -- [page:Float] <br />
+		n33 -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Initialize the 3x3 matrix with a row-major sequence of values.<br/><br/>
+		
+		n11, n12, n13,<br/>
+		n21, n22, n23,<br/>
+		n31, n32, n33<br/><br/>
+		
+		If no values are sent the matrix will be initialized as an identity matrix.
 		</div>
 		</div>
 
 
 
 
@@ -37,7 +43,7 @@
 
 
 		<h3>.[page:Float32Array elements]</h3>
 		<h3>.[page:Float32Array elements]</h3>
 		<div>
 		<div>
-		Float32Array with matrix values.
+		Float32Array with column-major matrix values.
 		</div>
 		</div>
 
 
 
 
@@ -48,82 +54,89 @@
 		Transposes this matrix in place.
 		Transposes this matrix in place.
 		</div>
 		</div>
 
 
-		<h3>.transposeIntoArray( [page:Array r] ) [page:Matrix3]</h3>
+		<h3>.transposeIntoArray( [page:Array array] ) [page:Matrix3]</h3>
 		<div>
 		<div>
-		Transposes this matrix into the supplied array *r*, and returns itself.
+		array -- [page:Array] <br />
+		</div>
+		<div>
+		Transposes this matrix into the supplied array, and returns itself.
 		</div>
 		</div>
 
 
 
 
-		<h3>.determinant() [page:todo]</h3>
+		<h3>.determinant() [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		Returns the matrix's determinant.
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo n11], [page:todo n12], [page:todo n13], [page:todo n21], [page:todo n22], [page:todo n23], [page:todo n31], [page:todo n32], [page:todo n33]) [page:todo]</h3>
+		<h3>.set([page:Float n11], [page:Float n12], [page:Float n13], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n31], [page:Float n32], [page:Float n33]) [page:Matrix3 this]</h3>
 		<div>
 		<div>
-		n11 -- todo <br />
-		n12 -- todo <br />
-		n13 -- todo <br />
-		n21 -- todo <br />
-		n22 -- todo <br />
-		n23 -- todo <br />
-		n31 -- todo <br />
-		n32 -- todo <br />
-		n33 -- todo
+		n11 -- [page:Float] <br />
+		n12 -- [page:Float] <br />
+		n13 -- [page:Float] <br />
+		n21 -- [page:Float] <br />
+		n22 -- [page:Float] <br />
+		n23 -- [page:Float] <br />
+		n31 -- [page:Float] <br />
+		n32 -- [page:Float] <br />
+		n33 -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Set the 3x3 matrix values to the given row-major sequence of values.
 		</div>
 		</div>
 
 
-		<h3>.multiplyScalar([page:todo s]) [page:todo]</h3>
+		<h3>.multiplyScalar([page:Float scalar]) [page:Matrix3 this]</h3>
 		<div>
 		<div>
-		s -- todo
+		scalar -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Multiply every component of the matrix by a scalar value.
 		</div>
 		</div>
 
 
-		<h3>.multiplyVector3Array([page:todo a]) [page:todo]</h3>
+		<h3>.multiplyVector3Array([page:Array array]) [page:Array]</h3>
 		<div>
 		<div>
-		a -- todo
+		array -- An array in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Multiply (apply) this matrix against every vector3 in the array.
 		</div>
 		</div>
 
 
-		<h3>.getNormalMatrix([page:todo m]) [page:todo]</h3>
+		<h3>.getNormalMatrix([page:Matrix4 matrix4]) [page:Matrix3 this]</h3>
 		<div>
 		<div>
-		m -- todo
+		matrix4 -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Set this matrix as the normal matrix of the passed [page:Matrix4 matrix4]. The normal matrix is the inverse transpose of the matrix.
 		</div>
 		</div>
 
 
-		<h3>.getInverse([page:todo matrix], [page:todo throwOnInvertible]) [page:todo]</h3>
+		<h3>.getInverse([page:Matrix4 matrix4], [page:Boolean throwOnInvertible]) [page:Matrix3 this]</h3>
 		<div>
 		<div>
-		matrix -- todo <br />
-		throwOnInvertible -- todo
+		matrix4 -- [page:Matrix4] <br />
+		throwOnInvertible -- [Page:Boolean] If true, throw an error if the matrix is invertible.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Set this matrix to the inverse of the passed matrix.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo m]) [page:todo]</h3>
+		<h3>.copy([page:Matrix3 matrix]) [page:Matrix3 this]</h3>
 		<div>
 		<div>
-		m -- todo
+		matrix -- [page:Matrix3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copy the values of the passed matrix.
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.clone() [page:Matrix3]</h3>
 		<div>
 		<div>
-		todo
+		Create a copy of the matrix.
 		</div>
 		</div>
 
 
-		<h3>.identity() [page:todo]</h3>
+		<h3>.identity() [page:Matrix3 this]</h3>
 		<div>
 		<div>
-		todo
+		Set as an identity matrix.<br/><br/>
+		
+		1, 0, 0<br/>
+		0, 1, 0<br/>
+		0, 0, 1<br/>
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 36 - 34
docs/api/math/Matrix4.html

@@ -40,62 +40,64 @@
 
 
 		<h3>[name]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] )</h3>
 		<h3>[name]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] )</h3>
 
 
-		<div>Initialises the matrix with the supplied n11..n44 values, or just creates an identity matrix if no values are passed.</div>
+		<div>
+		Initialises the matrix with the supplied row-major values n11..n44, or just creates an identity matrix if no values are passed.
+		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>.[page:Float32Array elements]</h3>
 		<h3>.[page:Float32Array elements]</h3>
-
+		<div>A column-major list of matrix values.</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-		<h3>.set( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] ) [page:Matrix4]</h3>
+		<h3>.set( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
-		Sets all fields of this matrix.
+		Sets all fields of this matrix to the supplied row-major values n11..n44.
 		</div>
 		</div>
 
 
-		<h3>.identity() [page:Matrix4]</h3>
+		<h3>.identity() [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Resets this matrix to identity.
 		Resets this matrix to identity.
 		</div>
 		</div>
 
 
-		<h3>.copy( [page:Matrix4 m] ) [page:Matrix4]</h3>
+		<h3>.copy( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Copies a matrix *m* into this matrix.
 		Copies a matrix *m* into this matrix.
 		</div>
 		</div>
 
 
-		<h3>.copyPosition( [page:Matrix4 m] ) [page:Matrix4]</h3>
+		<h3>.copyPosition( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Copies the translation component of the supplied matrix *m* into this matrix translation component.
 		Copies the translation component of the supplied matrix *m* into this matrix translation component.
 		</div>
 		</div>
 
 
-		<h3>.extractRotation( [page:Matrix4 m] ) [page:Matrix4]</h3>
+		<h3>.extractRotation( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Extracts the rotation of the supplied matrix *m* into this matrix rotation component.
 		Extracts the rotation of the supplied matrix *m* into this matrix rotation component.
 		</div>
 		</div>
 
 
-		<h3>.lookAt( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4]</h3>
+		<h3>.lookAt( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Constructs a rotation matrix, looking from *eye* towards *center* with defined *up* vector.
 		Constructs a rotation matrix, looking from *eye* towards *center* with defined *up* vector.
 		</div>
 		</div>
 
 
-		<h3>.multiply( [page:Matrix4 m] ) [page:Matrix4]</h3>
+		<h3>.multiply( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Multiplies this matrix by *m*.
 		Multiplies this matrix by *m*.
 		</div>
 		</div>
 
 
-		<h3>.multiplyMatrices( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4]</h3>
+		<h3>.multiplyMatrices( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets this matrix to *a x b*.
 		Sets this matrix to *a x b*.
 		</div>
 		</div>
 
 
-		<h3>.multiplyToArray( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4]</h3>
+		<h3>.multiplyToArray( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets this matrix to *a x b* and stores the result into the flat array *r*.<br />
 		Sets this matrix to *a x b* and stores the result into the flat array *r*.<br />
 		*r* can be either a regular Array or a TypedArray.
 		*r* can be either a regular Array or a TypedArray.
 		</div>
 		</div>
 
 
-		<h3>.multiplyScalar( [page:Float s] ) [page:Matrix4]</h3>
+		<h3>.multiplyScalar( [page:Float s] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Multiplies this matrix by *s*.
 		Multiplies this matrix by *s*.
 		</div>
 		</div>
@@ -106,7 +108,7 @@
 		Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm]
 		Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm]
 		</div>
 		</div>
 
 
-		<h3>.transpose() [page:Matrix4]</h3>
+		<h3>.transpose() [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Transposes this matrix.
 		Transposes this matrix.
 		</div>
 		</div>
@@ -121,18 +123,18 @@
 		Flattens this matrix into supplied *flat* array starting from *offset* position in the array.
 		Flattens this matrix into supplied *flat* array starting from *offset* position in the array.
 		</div>
 		</div>
 
 
-		<h3>.setPosition( [page:Vector3 v] ) [page:Matrix4]</h3>
+		<h3>.setPosition( [page:Vector3 v] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets the position component for this matrix from vector *v*.
 		Sets the position component for this matrix from vector *v*.
 		</div>
 		</div>
 
 
-		<h3>.getInverse( [page:Matrix4 m] ) [page:Matrix4]</h3>
+		<h3>.getInverse( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets this matrix to the inverse of matrix *m*.<br />
 		Sets this matrix to the inverse of matrix *m*.<br />
 		Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm].
 		Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm].
 		</div>
 		</div>
 
 
-		<h3>.makeRotationFromEuler( [page:Vector3 v], [page:String order] ) [page:Matrix4]</h3>
+		<h3>.makeRotationFromEuler( [page:Vector3 v], [page:String order] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		v — Rotation vector.
 		v — Rotation vector.
 		order — The order of rotations. Eg. "XYZ".
 		order — The order of rotations. Eg. "XYZ".
@@ -142,17 +144,17 @@
 		Default order is *"XYZ"*.
 		Default order is *"XYZ"*.
 		</div>
 		</div>
 
 
-		<h3>.makeRotationFromQuaternion( [page:Quaternion q] ) [page:Matrix4]</h3>
+		<h3>.makeRotationFromQuaternion( [page:Quaternion q] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets the rotation submatrix of this matrix to the rotation specified by *q*. The rest of the matrix is identity.
 		Sets the rotation submatrix of this matrix to the rotation specified by *q*. The rest of the matrix is identity.
 		</div>
 		</div>
 
 
-		<h3>.scale( [page:Vector3 v] ) [page:Matrix4]</h3>
+		<h3>.scale( [page:Vector3 v] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Multiplies the columns of this matrix by vector *v*.
 		Multiplies the columns of this matrix by vector *v*.
 		</div>
 		</div>
 
 
-		<h3>.compose( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Matrix4]</h3>
+		<h3>.compose( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets this matrix to the transformation composed of *translation*, *quaternion* and *scale*.
 		Sets this matrix to the transformation composed of *translation*, *quaternion* and *scale*.
 		</div>
 		</div>
@@ -163,12 +165,12 @@
 		If parameters are not passed, new instances will be created.
 		If parameters are not passed, new instances will be created.
 		</div>
 		</div>
 
 
-		<h3>.makeTranslation( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]</h3>
+		<h3>.makeTranslation( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets this matrix as translation transform.
 		Sets this matrix as translation transform.
 		</div>
 		</div>
 
 
-		<h3>.makeRotationX( [page:Float theta] ) [page:Matrix4]</h3>
+		<h3>.makeRotationX( [page:Float theta] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		theta — Rotation angle in radians.
 		theta — Rotation angle in radians.
 		</div>
 		</div>
@@ -176,7 +178,7 @@
 		Sets this matrix as rotation transform around x axis by *theta* radians.
 		Sets this matrix as rotation transform around x axis by *theta* radians.
 		</div>
 		</div>
 
 
-		<h3>.makeRotationY( [page:Float theta] ) [page:Matrix4]</h3>
+		<h3>.makeRotationY( [page:Float theta] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		theta — Rotation angle in radians.
 		theta — Rotation angle in radians.
 		</div>
 		</div>
@@ -184,7 +186,7 @@
 		Sets this matrix as rotation transform around y axis by *theta* radians.
 		Sets this matrix as rotation transform around y axis by *theta* radians.
 		</div>
 		</div>
 
 
-		<h3>.makeRotationZ( [page:Float theta] ) [page:Matrix4]</h3>
+		<h3>.makeRotationZ( [page:Float theta] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		theta — Rotation angle in radians.
 		theta — Rotation angle in radians.
 		</div>
 		</div>
@@ -192,7 +194,7 @@
 		Sets this matrix as rotation transform around z axis by *theta* radians.
 		Sets this matrix as rotation transform around z axis by *theta* radians.
 		</div>
 		</div>
 
 
-		<h3>.makeRotationAxis( [page:Vector3 axis], [page:Float theta] ) [page:Matrix4]</h3>
+		<h3>.makeRotationAxis( [page:Vector3 axis], [page:Float theta] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		axis — Rotation axis, should be normalized.
 		axis — Rotation axis, should be normalized.
 		theta — Rotation angle in radians.
 		theta — Rotation angle in radians.
@@ -202,22 +204,22 @@
 		Based on [link:http://www.gamedev.net/reference/articles/article1199.asp].
 		Based on [link:http://www.gamedev.net/reference/articles/article1199.asp].
 		</div>
 		</div>
 
 
-		<h3>.makeScale( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]</h3>
+		<h3>.makeScale( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Sets this matrix as scale transform.
 		Sets this matrix as scale transform.
 		</div>
 		</div>
 
 
-		<h3>.makeFrustum( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4]</h3>
+		<h3>.makeFrustum( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Creates a [page:Frustum frustum] matrix.
 		Creates a [page:Frustum frustum] matrix.
 		</div>
 		</div>
 
 
-		<h3>.makePerspective( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] ) [page:Matrix4]</h3>
+		<h3>.makePerspective( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Creates a perspective projection matrix.
 		Creates a perspective projection matrix.
 		</div>
 		</div>
 
 
-		<h3>.makeOrthographic( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4]</h3>
+		<h3>.makeOrthographic( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4 this]</h3>
 		<div>
 		<div>
 		Creates an orthographic projection matrix.
 		Creates an orthographic projection matrix.
 		</div>
 		</div>
@@ -227,17 +229,17 @@
 		Clones this matrix.
 		Clones this matrix.
 		</div>
 		</div>
 
 
-		<h3>.multiplyVector3Array([page:todo a]) [page:todo]</h3>
+		<h3>.multiplyVector3Array([page:Array a]) [page:Array]</h3>
 		<div>
 		<div>
-		a -- todo
+		array -- An array in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Multiply (apply) this matrix against every vector3 in the array.
 		</div>
 		</div>
 
 
-		<h3>.getMaxScaleOnAxis() [page:todo]</h3>
+		<h3>.getMaxScaleOnAxis() [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		Gets the max scale value of the 3 axes.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 72 - 76
docs/api/math/Plane.html

@@ -9,181 +9,177 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A two dimensional surface that extends infinitely in 3d space.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:Vector3 normal], [page:number constant])</h3>
+		<h3>[name]([page:Vector3 normal], [page:Float constant])</h3>
 		<div>
 		<div>
-		normal -- the normal vector defining the plane <br />
-		constant -- the distance from the origin to the plane along the normal vector
+		normal -- ([Page:Vector3]) normal vector defining the plane pointing towards the origin <br />
+		constant -- ([Page:Float]) the negative distance from the origin to the plane along the normal vector
 		</div>
 		</div>
 
 
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-
-
-		<h3>.[page:number constant]</h3>
-		<div>
-		the distance from the origin to the plane along the normal vector
-		</div> 
-
 		<h3>.[page:Vector3 normal]</h3>
 		<h3>.[page:Vector3 normal]</h3>
-		<div>
-		the normal vector defining the plane
-		</div> 
 
 
+		<h3>.[page:Float constant]</h3>
+		
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
 
 
-		<h3>.normalize() [page:todo]</h3>
+		<h3>.normalize() [page:Plane this]</h3>
 		<div>
 		<div>
-		todo
+		Normalizes the normal vector, and adjusts the constant value accordingly.
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo normal], [page:todo constant]) [page:todo]</h3>
+		<h3>.set([page:Vector3 normal], [page:Float constant]) [page:Plane this]</h3>
 		<div>
 		<div>
-		normal -- todo <br />
-		constant -- todo
+		normal -- [Page:Vector3] <br />
+		constant -- [Page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the plane's values.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo plane]) [page:todo]</h3>
+		<h3>.copy([page:Plane plane]) [page:Plane this]</h3>
 		<div>
 		<div>
-		plane -- todo
+		plane -- [page:Plane] to copy
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copies the values of the passed plane to this plane.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo matrix], [page:todo optionalNormalMatrix]) [page:todo]</h3>
+		<h3>.applyMatrix4([page:Matrix4 matrix], [page:Matrix3 optionalNormalMatrix]) [page:Plane this]</h3>
 		<div>
 		<div>
-		matrix -- todo <br />
-		optionalNormalMatrix -- todo
+		matrix -- [Page:Matrix4] to apply <br />
+		optionalNormalMatrix -- (optional) pre-computed normal [Page:Matrix3] of the Matrix4 to apply
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Apply a Matrix4 to the plane. The second parameter is optional.
+		
+		<code>
+		var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix ) 
+		</code>
 		</div>
 		</div>
 
 
-		<h3>.orthoPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.orthoPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		optionalTarget -- todo
+		point -- [page:Vector3] <br />
+		optionalTarget -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a vector in the same direction as the Plane's normal, but the magnitude is passed point's original distance to the plane.
 		</div>
 		</div>
 
 
-		<h3>.isIntersectionLine([page:todo line]) [page:todo]</h3>
+		<h3>.isIntersectionLine([page:Line3 line]) [page:Boolean]</h3>
 		<div>
 		<div>
-		line -- todo
+		line -- [page:Line3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Tests whether a line segment intersects with the plane. (Do not mistake this for a collinear check.)
 		</div>
 		</div>
 
 
-		<h3>.intersectLine([page:todo line], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.intersectLine([page:Line3 line], [page:Vector3 optionalTarget]) [page:Vector3] or [page:undefined]</h3>
 		<div>
 		<div>
-		line -- todo <br />
-		optionalTarget -- todo
+		line -- [page:Line3] <br />
+		optionalTarget -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the intersection point of the passed line and the plane. Returns undefined if the line does not intersect. Returns the line's starting point if the line is coplanar with the plane.
 		</div>
 		</div>
 
 
-		<h3>.setFromNormalAndCoplanarPoint([page:todo normal], [page:todo point]) [page:todo]</h3>
+		<h3>.setFromNormalAndCoplanarPoint([page:Vector3 normal], [page:Vector3 point]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		normal -- todo <br />
-		point -- todo
+		normal -- [page:Vector3] <br />
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the plane's values as defined by a normal and arbitrary coplanar point.
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.clone() [page:Plane]</h3>
 		<div>
 		<div>
-		todo
+		Returns a new copy of this plane.
 		</div>
 		</div>
 
 
-		<h3>.distanceToPoint([page:todo point]) [page:todo]</h3>
+		<h3>.distanceToPoint([page:Vector3 point]) [page:Float]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the smallest distance from the point to the plane.
 		</div>
 		</div>
 
 
-		<h3>.equals([page:todo plane]) [page:todo]</h3>
+		<h3>.equals([page:Plane plane]) [page:Boolean]</h3>
 		<div>
 		<div>
-		plane -- todo
+		plane -- [page:Planen]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if two planes are equal (their normals and constants match)
 		</div>
 		</div>
 
 
-		<h3>.setComponents([page:todo x], [page:todo y], [page:todo z], [page:todo w]) [page:todo]</h3>
+		<h3>.setComponents([page:Float x], [page:Float y], [page:Float z], [page:Float w]) [page:Plane this]</h3>
 		<div>
 		<div>
-		x -- todo <br />
-		y -- todo <br />
-		z -- todo <br />
-		w -- todo
+		x -- [page:Float] x of the normal vector <br />
+		y -- [page:Float] y of the normal vector<br />
+		z -- [page:Float] z of the normal vector<br />
+		w -- [page:Float] distance of the plane from the origin along the normal vector
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Set the individual components that make up the plane.
 		</div>
 		</div>
 
 
-		<h3>.distanceToSphere([page:todo sphere]) [page:todo]</h3>
+		<h3>.distanceToSphere([page:Sphere sphere]) [page:Float]</h3>
 		<div>
 		<div>
-		sphere -- todo
+		sphere -- [Page:Sphere]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the smallest distance from an edge of the sphere to the plane.
 		</div>
 		</div>
 
 
-		<h3>.setFromCoplanarPoints([page:todo a], [page:todo b], [page:todo c]) [page:todo]</h3>
+		<h3>.setFromCoplanarPoints([page:Vector3 a], [page:Vector3 b], [page:Vector3 c]) [page:Plane this]</h3>
 		<div>
 		<div>
-		a -- todo <br />
-		b -- todo <br />
-		c -- todo
+		a -- [page:Vector3] <br />
+		b -- [page:Vector3] <br />
+		c -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Defines the plane based on the 3 provided points. The winding order is counter clockwise, and determines which direction the normal will point.
 		</div>
 		</div>
 
 
-		<h3>.projectPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.projectPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		optionalTarget -- todo
+		point -- [page:Vector3] <br />
+		optionalTarget -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Projects a point onto the plane. The projected point is the closest point on the plane to the passed point, so a line drawn from the projected point and the passed point would be orthogonal to the plane.
 		</div>
 		</div>
 
 
-		<h3>.negate() [page:todo]</h3>
+		<h3>.negate() [page:Plane this]</h3>
 		<div>
 		<div>
-		todo
+		Negates both the normal vector and constant, effectively mirroring the plane across the origin.
 		</div>
 		</div>
 
 
-		<h3>.translate([page:todo offset]) [page:todo]</h3>
+		<h3>.translate([page:Vector3 offset]) [page:Plane this]</h3>
 		<div>
 		<div>
-		offset -- todo
+		offset -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Translates the plane the distance defined by the vector. Note that this only affects the constant (distance from origin) and will not affect the normal vector.
 		</div>
 		</div>
 
 
-		<h3>.coplanarPoint([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.coplanarPoint([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a coplanar point. (The projection of the normal vector at the origin onto the plane.)
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 89 - 54
docs/api/math/Ray.html

@@ -9,142 +9,177 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A ray that emits from an origin in a certain direction.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo origin], [page:todo direction])</h3>
+		<h3>[name]([page:Vector3 origin], [page:Vector3 direction])</h3>
 		<div>
 		<div>
-		origin -- todo <br />
-		direction -- todo
+		origin -- [page:Vector3] The origin of the [page:Ray].<br />
+		direction -- [page:Vector3] The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Initialises the origin and direction properties to the provided values.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-
-
 		<h3>.[page:Vector3 origin]</h3>
 		<h3>.[page:Vector3 origin]</h3>
 		<div>
 		<div>
-		todo
+		The origin of the [page:Ray].
 		</div> 
 		</div> 
 
 
 		<h3>.[page:Vector3 direction]</h3>
 		<h3>.[page:Vector3 direction]</h3>
 		<div>
 		<div>
-		todo
+		The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
 		</div> 
 		</div> 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-
-
-		<h3>.intersectPlane([page:todo plane], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.applyMatrix4([page:Matrix4 matrix4]) [page:Ray]</h3>
 		<div>
 		<div>
-		plane -- todo <br />
-		optionalTarget -- todo
+		matrix4 -- [page:Matrix4] The [page:Matrix4] to transform this [page:Ray] by.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Transform this [page:Ray] by the [page:Matrix4].
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo origin], [page:todo direction]) [page:todo]</h3>
+		<h3>.at([page:Float t], [page:Vector3 optionalTarget] = null) [page:Vector3]</h3>
 		<div>
 		<div>
-		origin -- todo <br />
-		direction -- todo
+		t -- [page:Float] The distance along the [page:Ray] to retrieve a position for.<br />
+		optionalTarget -- [page:Vector3] Receives the position along the [page:Ray] if passed; otherwise a new [page:Vector3] is created.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Get a [page:Vector3] that is a given distance along this [page:Ray].
 		</div>
 		</div>
 
 
-		<h3>.isIntersectionSphere([page:todo sphere]) [page:todo]</h3>
+		<h3>.clone() [page:Ray]</h3>
 		<div>
 		<div>
-		sphere -- todo
+		Create a clone of this [page:Ray].
 		</div>
 		</div>
+
+		<h3>.closestPointToPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		todo
+		point -- [page:Vector3] The point to get the closest approach to. <br />
+		optionalTarget -- [page:Vector3] Receives the return value if passed; otherwise a new [page:Vector3] is created.
+		</div>
+		<div>
+		Get the point along this [page:Ray] that is closest to the [page:Vector3] provided.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo matrix4]) [page:todo]</h3>
+		<h3>.copy([page:Ray ray]) [page:Ray]</h3>
 		<div>
 		<div>
-		matrix4 -- todo
+		ray -- [page:Ray] The [page:Ray] to copy values from.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copy the properties of the provided [page:Ray], then return this [page:Ray].
 		</div>
 		</div>
-
-		<h3>.distanceToPlane([page:todo plane]) [page:todo]</h3>
+		
+		<h3>.distanceSqToSegment([page:Vector3 v0], [page:Vector3 v1], [page:Vector3 optionalPointOnRay] = null, [page:Vector3 optionalPointOnSegment] = null) [page:Float]</h3>
 		<div>
 		<div>
-		plane -- todo
+		v0 -- [page:Vector3] The start of the line segment.
+		v1 -- [page:Vector3] The end of the line segment.
+		optionalPointOnRay -- [page:Vector3] If this is provided, it receives the point on this [page:Ray] that is closest to the segment.
+		optionalPointOnSegment -- [page:Vector3] If this is provided, it receives the point on the line segment that is closest to this [page:Ray].
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Get the squared distance between this [page:Ray] and a line segment.
 		</div>
 		</div>
 
 
-		<h3>.recast([page:todo t]) [page:todo]</h3>
+		<h3>.distanceToPlane([page:Plane plane]) [page:Float]</h3>
 		<div>
 		<div>
-		t -- todo
+		plane -- [page:Plane] The [page:Plane] to get the distance to.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Get the distance from the origin to the [page:Plane], or *null* if the [page:Ray] doesn't intersect the [page:Plane].
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.distanceToPoint([page:Vector3 point]) [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		point -- [page:Vector3] The [page:Vector3] to compute a distance to.
+		</div>
+		<div>
+		Get the distance of the closest approach between the [page:Ray] and the [page:Vector3].
 		</div>
 		</div>
 
 
-		<h3>.isIntersectionPlane([page:todo plane]) [page:todo]</h3>
+		<h3>.equals([page:Ray ray]) [page:Boolean]</h3>
 		<div>
 		<div>
-		plane -- todo
+		ray -- [page:Ray] The [page:Ray] to compare to.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return whether this and the other [page:Ray] have equal offsets and directions.
 		</div>
 		</div>
 
 
-		<h3>.equals([page:todo ray]) [page:todo]</h3>
+		<h3>.intersectBox([page:Box3 box], [page:Vector3 optionalTarget] = null) [page:Vector3]?</h3>
+		<div>
+		box  -- [page:Box3] The [page:Box3] to intersect with.<br />
+		optionalTarget -- [page:Vector3] The [page:Vector3] to store the result in, or *null* to create a new [page:Vector3].
+		</div>
+		<div>
+		Intersect this [page:Ray] with a [page:Box3], returning the intersection point or *null* if there is no intersection.
+		</div>
+		
+		<h3>.intersectPlane([page:Plane plane], [page:Vector3 optionalTarget] = null) [page:Vector3]?</h3>
+		<div>
+		plane -- [page:Plane] The [page:Plane] to intersect with.<br />
+		optionalTarget -- [page:Vector3] The [page:Vector3] to store the result in, or *null* to create a new [page:Vector3].
+		</div>
+		<div>
+		Intersect this [page:Ray] with a [page:Plane], returning the intersection point or *null* if there is no intersection.
+		</div>
+		function ( a, b, c, backfaceCulling, optionalTarget )
+		
+		<h3>.intersectTriangle([page:Vector3 a], [page:Vector3 b], [page:Vector3 c], [page:Boolean backfaceCulling], [page:Vector3 optionalTarget] = null) [page:Vector3]?</h3>
+		<div>
+		a, b, c -- [page:Vector3] The [page:Vector3] points on the triangle.<br />
+		backfaceCulling -- [page:Boolean] Whether to use backface culling.<br />
+		optionalTarget -- [page:Vector3] The [page:Vector3] to store the result in, or *null* to create a new [page:Vector3].
+		</div>
+		<div>
+		Intersect this [page:Ray] with a triangle, returning the intersection point or *null* if there is no intersection.
+		</div>
+		
+		<h3>.isIntersectionBox([page:Box3 box]) [page:Boolean]</h3>
 		<div>
 		<div>
-		ray -- todo
+		box -- [page:Box3] The [page:Box3] to intersect with.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return whether or not this [page:Ray] intersects with the [page:Box3].
 		</div>
 		</div>
 
 
-		<h3>.at([page:todo t], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.isIntersectionPlane([page:Plane plane]) [page:Boolean]</h3>
 		<div>
 		<div>
-		t -- todo <br />
-		optionalTarget -- todo
+		plane -- [page:Plane] The [page:Plane] to intersect with.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return whether or not this [page:Ray] intersects with the [page:Plane].
 		</div>
 		</div>
 
 
-		<h3>.distanceToPoint([page:todo point]) [page:todo]</h3>
+		<h3>.isIntersectionSphere([page:Sphere sphere]) [page:Boolean]</h3>
 		<div>
 		<div>
-		point -- todo
+		sphere -- [page:Sphere] The [page:Sphere] to intersect with.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return whether or not this [page:Ray] intersects with the [page:Sphere].
 		</div>
 		</div>
 
 
-		<h3>.closestPointToPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.recast([page:Float t])</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		optionalTarget -- todo
+		t -- The distance along the [page:Ray] to interpolate.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Shift the origin of this [page:Ray] along its direction by the distance given.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo ray]) [page:todo]</h3>
+		<h3>.set([page:Vector3 origin], [page:Vector3 direction]) [page:Ray]</h3>
 		<div>
 		<div>
-		ray -- todo
+		origin -- [page:Vector3] The origin of the [page:Ray].<br />
+		direction -- [page:Vector3] The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copy the parameters to the origin and direction properties.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 48 - 57
docs/api/math/Sphere.html

@@ -9,139 +9,130 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A geometric sphere defined by a center position and radius.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo center], [page:todo radius])</h3>
+		<h3>[name]([page:Vector3 center], [page:Float radius])</h3>
 		<div>
 		<div>
-		center -- todo <br />
-		radius -- todo
-		</div>
-		<div>
-		todo
+		center -- [page:Vector3] <br />
+		radius -- [page:Float]
 		</div>
 		</div>
-
+		
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 
 
-
-		<h3>.[page:number radius]</h3>
-		<div>
-		todo
-		</div> 
-
 		<h3>.[page:Vector3 center]</h3>
 		<h3>.[page:Vector3 center]</h3>
-		<div>
-		todo
-		</div> 
-
+		
+		<h3>.[page:Float radius]</h3>
+		
+		
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
 
 
-		<h3>.set([page:todo center], [page:todo radius]) [page:todo]</h3>
+		<h3>.set([page:Vector3 center], [page:Float radius]) [page:this:Sphere]</h3>
 		<div>
 		<div>
-		center -- todo <br />
-		radius -- todo
+		center -- [page:Vector3] <br />
+		radius -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the center and radius.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo matrix]) [page:todo]</h3>
+		<h3>.applyMatrix4([page:Matrix4 matrix]) [page:Sphere this]</h3>
 		<div>
 		<div>
-		matrix -- todo
+		matrix -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Transforms this sphere with the provided [page:Matrix4].
 		</div>
 		</div>
 
 
-		<h3>.clampPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.clampPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		optionalTarget -- todo
+		point -- [page:Vector3] The point to clamp <br />
+		optionalTarget -- [page:Vector3] The optional target point to return
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Clamps a point within the sphere. If the point is is outside the sphere, it will clamp it to the closets point on the edge of the sphere.
 		</div>
 		</div>
 
 
-		<h3>.translate([page:todo offset]) [page:todo]</h3>
+		<h3>.translate([page:Vector3 offset]) [page:Sphere this]</h3>
 		<div>
 		<div>
-		offset -- todo
+		offset -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Translate the sphere's center by the provided offset vector.
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.clone() [page:Sphere]</h3>
 		<div>
 		<div>
-		todo
+		Provides a new copy of the sphere.
 		</div>
 		</div>
 
 
-		<h3>.equals([page:todo sphere]) [page:todo]</h3>
+		<h3>.equals([page:Sphere sphere]) [page:Boolean]</h3>
 		<div>
 		<div>
-		sphere -- todo
+		sphere -- [page:Sphere]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if the two spheres' centers and radii are equal.
 		</div>
 		</div>
 
 
-		<h3>.setFromPoints([page:todo points], [page:Vector3 optionalCenter]) [page:todo]</h3>
+		<h3>.setFromPoints([page:Array points], [page:Vector3 optionalCenter]) [page:Sphere this]</h3>
 		<div>
 		<div>
-		points -- list of [page:Vector3 vector] positions.<br />  
-		optionalCenter -- optional position for the sphere's center.<br />
+		points -- [page:Array] of [page:Vector3] positions.<br />  
+		optionalCenter -- Optional [page:Vector3] position for the sphere's center.<br />
 		</div>
 		</div>
 		<div>
 		<div>
 		Computes the minimum bounding sphere for *points*. If *optionalCenter* is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing *points* is calculated.
 		Computes the minimum bounding sphere for *points*. If *optionalCenter* is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing *points* is calculated.
 		</div>
 		</div>
 
 
-		<h3>.distanceToPoint([page:todo point]) [page:todo]</h3>
+		<h3>.distanceToPoint([page:Vector3 point]) [page:Float]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the closest distance from the boundary of the sphere to the point. If the sphere contains the point, the distance will be negative.
 		</div>
 		</div>
 
 
-		<h3>.getBoundingBox([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.getBoundingBox([page:Box optionalTarget]) [page:Box]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- [page:Box]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns a bounding box for the sphere, optionally setting a provided box target.
 		</div>
 		</div>
 
 
-		<h3>.containsPoint([page:todo point]) [page:todo]</h3>
+		<h3>.containsPoint([page:Vector3 point]) [page:Boolean]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if the sphere contains the provided point inclusive of the edge of the sphere.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo sphere]) [page:todo]</h3>
+		<h3>.copy([page:Sphere sphere]) [page:Sphere]</h3>
 		<div>
 		<div>
-		sphere -- todo
+		sphere -- [page:Sphere] to copy
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copies the values of the passed sphere to this sphere.
 		</div>
 		</div>
 
 
-		<h3>.intersectsSphere([page:todo sphere]) [page:todo]</h3>
+		<h3>.intersectsSphere([page:Sphere sphere]) [page:Boolean]</h3>
 		<div>
 		<div>
-		sphere -- todo
+		sphere -- [page:Sphere]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if two spheres intersect.
 		</div>
 		</div>
 
 
-		<h3>.empty() [page:todo]</h3>
+		<h3>.empty() [page:Boolean]</h3>
 		<div>
 		<div>
-		todo
+		Checks to see if the sphere is empty (the radius set to 0).
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 51 - 50
docs/api/math/Triangle.html

@@ -9,20 +9,20 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A geometric triangle as defined by three vectors.</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:todo a], [page:todo b], [page:todo c])</h3>
+		<h3>[name]([page:Vector3 a], [page:Vector3 b], [page:Vector3 c])</h3>
 		<div>
 		<div>
-		a -- todo <br />
-		b -- todo <br />
-		c -- todo
+		a -- [page:Vector3] <br />
+		b -- [page:Vector3] <br />
+		c -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the triangle's vectors to the passed vectors.
 		</div>
 		</div>
 
 
 
 
@@ -32,109 +32,110 @@
 
 
 		<h3>.[page:Vector3 a]</h3>
 		<h3>.[page:Vector3 a]</h3>
 		<div>
 		<div>
-		todo
-		</div> 
-
+		The first [page:Vector3] of the triangle.
+		</div>
+		
 		<h3>.[page:Vector3 c]</h3>
 		<h3>.[page:Vector3 c]</h3>
 		<div>
 		<div>
-		todo
-		</div> 
+		The second [page:Vector3] of the triangle.
+		</div>
 
 
 		<h3>.[page:Vector3 b]</h3>
 		<h3>.[page:Vector3 b]</h3>
 		<div>
 		<div>
-		todo
-		</div> 
+		The third [page:Vector3] of the triangle.
+		</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
 
 
-		<h3>.setFromPointsAndIndices([page:todo points], [page:todo i0], [page:todo i1], [page:todo i2]) [page:todo]</h3>
+		<h3>.setFromPointsAndIndices([page:Array points], [page:Integer i0], [page:Integer i1], [page:Integer i2]) [page:Triangle this]</h3>
 		<div>
 		<div>
-		points -- todo <br />
-		i0 -- todo <br />
-		i1 -- todo <br />
-		i2 -- todo
+		points -- [page:Array] of [page:Vector3]s <br />
+		i0 -- [page:Integer] index <br />
+		i1 -- [page:Integer] index <br />
+		i2 -- [page:Integer] index
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the triangle's vectors to the vectors in the array.
 		</div>
 		</div>
 
 
-		<h3>.set([page:todo a], [page:todo b], [page:todo c]) [page:todo]</h3>
+		<h3>.set([page:Vector3 a], [page:Vector3 b], [page:Vector3 c]) [page:Triangle this]</h3>
 		<div>
 		<div>
-		a -- todo <br />
-		b -- todo <br />
-		c -- todo
+		a -- [page:Vector3] <br />
+		b -- [page:Vector3] <br />
+		c -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the triangle's vectors to the passed vectors.
 		</div>
 		</div>
 
 
-		<h3>.normal([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.normal([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- Optional [page:Vector3] target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return the calculated normal of the triangle.
 		</div>
 		</div>
 
 
-		<h3>.barycoordFromPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.barycoordFromPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		point -- todo <br />
-		optionalTarget -- todo
+		point -- [page:Vector3] <br />
+		optionalTarget -- Optional [page:Vector3] target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return a barycentric coordinate from the given vector. <br/><br/>
+		[link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png](Picture of barycentric coordinates)
 		</div>
 		</div>
 
 
-		<h3>.clone() [page:todo]</h3>
+		<h3>.clone() [page:Triangle]</h3>
 		<div>
 		<div>
-		todo
+		Return a new copy of this triangle.
 		</div>
 		</div>
 
 
-		<h3>.area() [page:todo]</h3>
+		<h3>.area() [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		Return the area of the triangle.
 		</div>
 		</div>
 
 
-		<h3>.midpoint([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.midpoint([page:Vector3 optionalTarget]) [page:Vector3]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- Optional [page:Vector3] target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return the midpoint of the triangle. Optionally sets a target vector.
 		</div>
 		</div>
 
 
-		<h3>.equals([page:todo triangle]) [page:todo]</h3>
+		<h3>.equals([page:Triangle triangle]) [page:Boolean]</h3>
 		<div>
 		<div>
-		triangle -- todo
+		triangle -- [page:Triangle]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if two triangles are equal (share the same vectors).
 		</div>
 		</div>
 
 
-		<h3>.plane([page:todo optionalTarget]) [page:todo]</h3>
+		<h3>.plane([page:Plane optionalTarget]) [page:Plane]</h3>
 		<div>
 		<div>
-		optionalTarget -- todo
+		optionalTarget -- Optional [page:Plane] target to set the result.
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Return a [page:Plane plane] based on the triangle. Optionally sets a target plane. 
 		</div>
 		</div>
 
 
-		<h3>.containsPoint([page:todo point]) [page:todo]</h3>
+		<h3>.containsPoint([page:Vector3 point]) [page:Boolean]</h3>
 		<div>
 		<div>
-		point -- todo
+		point -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if the passed vector is within the triangle.
 		</div>
 		</div>
 
 
-		<h3>.copy([page:todo triangle]) [page:todo]</h3>
+		<h3>.copy([page:Triangle triangle]) [page:Triangle]</h3>
 		<div>
 		<div>
-		triangle -- todo
+		triangle -- [page:Triangle]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Copies the values of the vertices of the passed triangle to this triangle.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 38 - 38
docs/api/math/Vector2.html

@@ -42,48 +42,48 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-		<h3>.set( [page:Float x], [page:Float y] ) [page:Vector2]</h3>
+		<h3>.set( [page:Float x], [page:Float y] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Sets value of this vector.
 		Sets value of this vector.
 		</div>
 		</div>
 
 
-		<h3>.copy( [page:Vector2 v] ) [page:Vector2]</h3>
+		<h3>.copy( [page:Vector2 v] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Copies value of *v* to this vector.
 		Copies value of *v* to this vector.
 		</div>
 		</div>
 
 
-		<h3>.add( [page:Vector2 v] ) [page:Vector2]</h3>
+		<h3>.add( [page:Vector2 v] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Adds *v* to this vector.
 		Adds *v* to this vector.
 		</div>
 		</div>
 
 
-		<h3>.addVectors( [page:Vector2 a], [page:Vector2 b] ) [page:Vector2]</h3>
+		<h3>.addVectors( [page:Vector2 a], [page:Vector2 b] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Sets this vector to *a + b*.
 		Sets this vector to *a + b*.
 		</div>
 		</div>
 
 
-		<h3>.sub( [page:Vector2 v] ) [page:Vector2]</h3>
+		<h3>.sub( [page:Vector2 v] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Subtracts *v* from this vector.
 		Subtracts *v* from this vector.
 		</div>
 		</div>
 
 
-		<h3>.subVectors( [page:Vector2 a], [page:Vector2 b] ) [page:Vector2]</h3>
+		<h3>.subVectors( [page:Vector2 a], [page:Vector2 b] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Sets this vector to *a - b*.
 		Sets this vector to *a - b*.
 		</div>
 		</div>
 
 
-		<h3>.multiplyScalar( [page:Float s] ) [page:Vector2]</h3>
+		<h3>.multiplyScalar( [page:Float s] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Multiplies this vector by scalar *s*.
 		Multiplies this vector by scalar *s*.
 		</div>
 		</div>
 
 
-		<h3>.divideScalar( [page:Float s] ) [page:Vector2]</h3>
+		<h3>.divideScalar( [page:Float s] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Divides this vector by scalar *s*.<br />
 		Divides this vector by scalar *s*.<br />
 		Set vector to *( 0, 0 )* if *s == 0*.
 		Set vector to *( 0, 0 )* if *s == 0*.
 		</div>
 		</div>
 
 
-		<h3>.negate() [page:Vector2]</h3>
+		<h3>.negate() [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Inverts this vector.
 		Inverts this vector.
 		</div>
 		</div>
@@ -103,7 +103,7 @@
 		Computes length of this vector.
 		Computes length of this vector.
 		</div>
 		</div>
 
 
-		<h3>.normalize() [page:Vector2]</h3>
+		<h3>.normalize() [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Normalizes this vector.
 		Normalizes this vector.
 		</div>
 		</div>
@@ -118,7 +118,7 @@
 		Computes squared distance of this vector to *v*.
 		Computes squared distance of this vector to *v*.
 		</div>
 		</div>
 
 
-		<h3>.setLength( [page:Float l] ) [page:Vector2]</h3>
+		<h3>.setLength( [page:Float l] ) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		Normalizes this vector and multiplies it by *l*.
 		Normalizes this vector and multiplies it by *l*.
 		</div>
 		</div>
@@ -134,7 +134,7 @@
 		</div>
 		</div>
 
 
 
 
-		<h3>.clamp([page:todo min], [page:todo max]) [page:this]</h3>
+		<h3>.clamp([page:Vector2 min], [page:Vector2 max]) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		min -- [page:Vector2] containing the min x and y values in the desired range <br />
 		min -- [page:Vector2] containing the min x and y values in the desired range <br />
 		max -- [page:Vector2] containing the max x and y values in the desired range
 		max -- [page:Vector2] containing the max x and y values in the desired range
@@ -143,12 +143,7 @@
 		If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value. <br />  If this vector's x or y value is less than the min vector's x or y value, it is replace by the corresponding value.
 		If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value. <br />  If this vector's x or y value is less than the min vector's x or y value, it is replace by the corresponding value.
 		</div>
 		</div>
 
 
-		<h3>.toArray() [page:Array]</h3>
-		<div>
-		Returns an array [x, y].
-		</div>
-
-		<h3>.lerp([page:todo v], [page:todo alpha]) [page:this]</h3>
+		<h3>.lerp([page:Vector2 v], [page:Float alpha]) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		v -- [page:Vector2] <br />
 		v -- [page:Vector2] <br />
 		alpha -- [page:Float] between 0 and 1;
 		alpha -- [page:Float] between 0 and 1;
@@ -157,33 +152,25 @@
 		Linear interpolation between this vector and v, where alpha is the percent along the line.
 		Linear interpolation between this vector and v, where alpha is the percent along the line.
 		</div>
 		</div>
 
 
-		<h3>.setComponent([page:todo index], [page:todo value]) [page:undefined]</h3>
+		<h3>.setComponent([page:Integer index], [page:Float value]) [page:undefined]</h3>
 		<div>
 		<div>
 		index -- 0 or 1 <br />
 		index -- 0 or 1 <br />
-		value -- [page:todo Float]
+		value -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
 		if index equals 0 method replaces this.x with value. <br />
 		if index equals 0 method replaces this.x with value. <br />
 		if index equals 1 method replaces this.y with value.
 		if index equals 1 method replaces this.y with value.
 		</div>
 		</div>
 
 
-		<h3>.min([page:todo v]) [page:this]</h3>
-		<div>
-		v -- [page:Vector2]
-		</div>
-		<div>
-		If this vector's x or y value is less than v's x or y value, replace that value with the corresponding min value.
-		</div>
-
-		<h3>.addScalar([page:todo s]) [page:this]</h3>
+		<h3>.addScalar([page:Float s]) [page:Vector2 this]</h3>
 		<div>
 		<div>
-		s -- [page:todo Float]
+		s -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
 		Add the scalar value s to this vector's x and y values.
 		Add the scalar value s to this vector's x and y values.
 		</div>
 		</div>
 
 
-		<h3>.getComponent([page:todo index]) [page:todo Float]</h3>
+		<h3>.getComponent([page:Integer index]) [page:Float]</h3>
 		<div>
 		<div>
 		index -- 0 or 1
 		index -- 0 or 1
 		</div>
 		</div>
@@ -192,15 +179,28 @@
 		if index equals 1 returns the y value.
 		if index equals 1 returns the y value.
 		</div>
 		</div>
 
 
-		<h3>.fromArray([page:todo array]) [page:todo this]</h3>
+		<h3>.fromArray([page:Array array]) [page:Vector2 this]</h3>
 		<div>
 		<div>
-		array -- [page:todo Array] of length 2
+		array -- [page:Array] of length 2
 		</div>
 		</div>
 		<div>
 		<div>
 		Sets this vector's x value to be array[0] and y value to be array[1].
 		Sets this vector's x value to be array[0] and y value to be array[1].
 		</div>
 		</div>
 
 
-		<h3>.max([page:todo v]) [page:todo this]</h3>
+		<h3>.toArray() [page:Array]</h3>
+		<div>
+		Returns an array [x, y].
+		</div>
+
+		<h3>.min([page:Vector2 v]) [page:Vector2 this]</h3>
+		<div>
+		v -- [page:Vector2]
+		</div>
+		<div>
+		If this vector's x or y value is less than v's x or y value, replace that value with the corresponding min value.
+		</div>
+
+		<h3>.max([page:Vector2 v]) [page:Vector2 this]</h3>
 		<div>
 		<div>
 		v -- [page:Vector2]
 		v -- [page:Vector2]
 		</div>
 		</div>
@@ -208,17 +208,17 @@
 		If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding max value.
 		If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding max value.
 		</div>
 		</div>
 
 
-		<h3>.setX([page:todo x]) [page:todo this]</h3>
+		<h3>.setX([page:Float x]) [page:Vector2 this]</h3>
 		<div>
 		<div>
-		x -- [page:todo Float]
+		x -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
 		replace this vector's x value with x.
 		replace this vector's x value with x.
 		</div>
 		</div>
 
 
-		<h3>.setY([page:todo y]) [page:todo this]</h3>
+		<h3>.setY([page:Float y]) [page:Vector2 this]</h3>
 		<div>
 		<div>
-		y -- [page:todo Float]
+		y -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
 		replace this vector's y value with y.
 		replace this vector's y value with y.

+ 83 - 81
docs/api/math/Vector3.html

@@ -47,63 +47,63 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-		<h3>.set( [page:Float x], [page:Float y], [page:Float z] ) [page:this]</h3>
+		<h3>.set( [page:Float x], [page:Float y], [page:Float z] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets value of this vector.
 		Sets value of this vector.
 		</div>
 		</div>
 
 
-		<h3>.setX( [page:Float x] ) [page:this]</h3>
+		<h3>.setX( [page:Float x] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets x value of this vector.
 		Sets x value of this vector.
 		</div>
 		</div>
 
 
-		<h3>.setY( [page:Float y] ) [page:this]</h3>
+		<h3>.setY( [page:Float y] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets y value of this vector.
 		Sets y value of this vector.
 		</div>
 		</div>
 
 
-		<h3>.setZ( [page:Float z] ) [page:this]</h3>
+		<h3>.setZ( [page:Float z] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets z value of this vector.
 		Sets z value of this vector.
 		</div>
 		</div>
 
 
-		<h3>.copy( [page:Vector3 v] ) [page:this]</h3>
+		<h3>.copy( [page:Vector3 v] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Copies value of *v* to this vector.
 		Copies value of *v* to this vector.
 		</div>
 		</div>
 
 
-		<h3>.add( [page:Vector3 v] ) [page:this]</h3>
+		<h3>.add( [page:Vector3 v] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Adds *v* to this vector.
 		Adds *v* to this vector.
 		</div>
 		</div>
 
 
-		<h3>.addVectors( [page:Vector3 a], [page:Vector3 b] ) [page:this]</h3>
+		<h3>.addVectors( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets this vector to *a + b*.
 		Sets this vector to *a + b*.
 		</div>
 		</div>
 
 
-		<h3>.sub( [page:Vector3 v] ) [page:this]</h3>
+		<h3>.sub( [page:Vector3 v] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Subtracts *v* from this vector.
 		Subtracts *v* from this vector.
 		</div>
 		</div>
 
 
-		<h3>.subVectors( [page:Vector3 a], [page:Vector3 b] ) [page:this]</h3>
+		<h3>.subVectors( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets this vector to *a - b*.
 		Sets this vector to *a - b*.
 		</div>
 		</div>
 
 
-		<h3>.multiplyScalar( [page:Float s] ) [page:this]</h3>
+		<h3>.multiplyScalar( [page:Float s] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Multiplies this vector by scalar *s*.
 		Multiplies this vector by scalar *s*.
 		</div>
 		</div>
 
 
-		<h3>.divideScalar( [page:Float s] ) [page:this]</h3>
+		<h3>.divideScalar( [page:Float s] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Divides this vector by scalar *s*.<br />
 		Divides this vector by scalar *s*.<br />
 		Set vector to *( 0, 0, 0 )* if *s == 0*.
 		Set vector to *( 0, 0, 0 )* if *s == 0*.
 		</div>
 		</div>
 
 
-		<h3>.negate() [page:this]</h3>
+		<h3>.negate() [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Inverts this vector.
 		Inverts this vector.
 		</div>
 		</div>
@@ -129,7 +129,7 @@
 		[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
 		[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
 		</div>
 		</div>
 
 
-		<h3>.normalize() [page:this]</h3>
+		<h3>.normalize() [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Normalizes this vector. Transforms this Vector into a Unit vector by dividing the vector by it's length.
 		Normalizes this vector. Transforms this Vector into a Unit vector by dividing the vector by it's length.
 		</div>
 		</div>
@@ -144,27 +144,27 @@
 		Computes squared distance of this vector to *v*.
 		Computes squared distance of this vector to *v*.
 		</div>
 		</div>
 
 
-		<h3>.setLength( [page:Float l] ) [page:this]</h3>
+		<h3>.setLength( [page:Float l] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Normalizes this vector and multiplies it by *l*.
 		Normalizes this vector and multiplies it by *l*.
 		</div>
 		</div>
 
 
-		<h3>.cross( [page:Vector3 v] ) [page:this]</h3>
+		<h3>.cross( [page:Vector3 v] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets this vector to cross product of itself and *v*.
 		Sets this vector to cross product of itself and *v*.
 		</div>
 		</div>
 
 
-		<h3>.crossVectors( [page:Vector3 a], [page:Vector3 b] ) [page:this]</h3>
+		<h3>.crossVectors( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets this vector to cross product of *a* and *b*.
 		Sets this vector to cross product of *a* and *b*.
 		</div>
 		</div>
 
 
-		<h3>.getPositionFromMatrix( [page:Matrix4 m] ) [page:this]</h3>
+		<h3>.setFromMatrixPosition( [page:Matrix4 m] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets this vector extracting position from matrix transform.
 		Sets this vector extracting position from matrix transform.
 		</div>
 		</div>
 
 
-		<h3>.getScaleFromMatrix( [page:Matrix4 m] ) [page:this]</h3>
+		<h3>.setFromMatrixScale( [page:Matrix4 m] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		Sets this vector extracting scale from matrix transform.
 		Sets this vector extracting scale from matrix transform.
 		</div>
 		</div>
@@ -180,16 +180,17 @@
 		</div>
 		</div>
 
 
 
 
-		<h3>.clamp([page:todo min], [page:todo max]) [page:this]</h3>
+		<h3>.clamp([page:Vector3 min], [page:Vector3 max]) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		min -- [page:Vector3] <br />
 		min -- [page:Vector3] <br />
 		max -- [page:Vector3]
 		max -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		If this vector's x, y or z value is greater than the max vector's x, y or z value, it is replaced by the corresponding value. <br />  If this vector's x, y or z value is less than the min vector's x, y or z value, it is replace by the corresponding value.
+		If this vector's x, y or z value is greater than the max vector's x, y or z value, it is replaced by the corresponding value. <br /><br />
+		If this vector's x, y or z value is less than the min vector's x, y or z value, it is replace by the corresponding value.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix3([page:todo m]) [page:this]</h3>
+		<h3>.applyMatrix3([page:Matrix3 m]) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		m -- [page:Matrix3]
 		m -- [page:Matrix3]
 		</div>
 		</div>
@@ -197,58 +198,66 @@
 		Multiplies this vector times a 3 x 3 matrix.
 		Multiplies this vector times a 3 x 3 matrix.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo m]) [page:todo this]</h3>
+		<h3>.applyMatrix4([page:Matrix3 m]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		m -- [page:todo Matrix4]
+		m -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
 		Multiplies this vector by 4 x 3 subset of a Matrix4.
 		Multiplies this vector by 4 x 3 subset of a Matrix4.
 		</div>
 		</div>
 
 
-		<h3>.projectOnPlane([page:todo planeNormal]) [page:todo this]</h3>
+		<h3>.projectOnPlane([page:Vector3 planeNormal]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		planeNormal -- [page:todo Plane.normal]
+		planeNormal -- [page:Vector3 planeNormal] A vector representing a plane normal.
 		</div>
 		</div>
 		<div>
 		<div>
 		Projects this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.
 		Projects this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.
 		</div>
 		</div>
 
 
-		<h3>.projectOnVector([page:todo vector]) [page:todo this]</h3>
+		<h3>.projectOnVector([page:Vector3]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		vector -- [page:todo Vector3]
+		vector -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
 		Projects this vector onto another vector.
 		Projects this vector onto another vector.
 		</div>
 		</div>
 
 
-		<h3>.addScalar([page:todo s]) [page:todo this]</h3>
+		<h3>.addScalar([page:Float]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		s -- [page:todo Float]
+		s -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
 		Adds a s to this vector.
 		Adds a s to this vector.
 		</div>
 		</div>
 
 
-		<h3>.divide([page:todo v]) [page:todo this]</h3>
+		<h3>.divide([page:Vector3 v]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		v -- [page:todo Vector3]
+		v -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
 		Divides this vector by vector v.
 		Divides this vector by vector v.
 		</div>
 		</div>
 
 
-		<h3>.min([page:todo v]) [page:todo]</h3>
+		<h3>.min([page:Vector3 v]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		v -- [page:todo Vector3]
+		v -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
 		If this vector's x, y, or z value is less than vector v's x, y, or z value, that value is replaced by the corresponding vector v value.
 		If this vector's x, y, or z value is less than vector v's x, y, or z value, that value is replaced by the corresponding vector v value.
 		</div>
 		</div>
 
 
-		<h3>.setComponent([page:todo index], [page:todo value]) [page:todo this]</h3>
+		<h3>.max([page:Vector3 v]) [page:Vector3 this]</h3>
+		<div>
+		v -- [page:Vector3]
+		</div>
+		<div>
+		If this vector's x, y, or z value is greater than vector v's x, y, or z value, that value is replaced by the corresponding vector v value.
+		</div>
+
+		<h3>.setComponent([page:Integer index], [page:Float value]) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		index -- 0, 1, or 2 <br />
 		index -- 0, 1, or 2 <br />
-		value -- [page:todo Float]
+		value -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
 		If index equals 0 the method sets this vector's x value to value <br />
 		If index equals 0 the method sets this vector's x value to value <br />
@@ -256,111 +265,104 @@
 		If index equals 2 the method sets this vector's z value to value
 		If index equals 2 the method sets this vector's z value to value
 		</div>
 		</div>
 
 
-		<h3>.transformDirection([page:todo m]) [page:todo this]</h3>
+		<h3>.transformDirection([page:Matrix4 m]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		m -- [page:todo Matrix4]
+		m -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
-		Multiplies this vector by a 3 x 3 subset of a Matrix4 and then normalizes the results.
+		Transforms the direction of this vector by a matrix (a 3 x 3 subset of a Matrix4) and then normalizes the result.
 		</div>
 		</div>
 
 
-		<h3>.multiplyVectors([page:todo a], [page:todo b]) [page:todo this]</h3>
+		<h3>.multiplyVectors([page:Vector3 a], [page:Vector3 b]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		a -- [page:todo Vector3] <br />
-		b -- [page:todo Vector3]
+		a -- [page:Vector3] <br />
+		b -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
-		Sets this vector equal the result of multiplying vector a by vector b.
+		Sets this vector equal to the result of multiplying vector a by vector b.
 		</div>
 		</div>
 
 
-		<h3>.getComponent([page:todo index]) [page:todo Float]</h3>
+		<h3>.getComponent([page:Integer index]) [page:Float]</h3>
 		<div>
 		<div>
-		index -- 0, 1, or 2
+		index -- [page:Integer] 0, 1, or 2
 		</div>
 		</div>
 		<div>
 		<div>
-		If index equals 0 the method returns this vector's x value <br />
-		If index equals 1 the method returns this vector's y value <br />
-		If index equals 2 the method returns this vector's z value
+		
+		Returns the value of the vector component x, y, or z by an index. <br /><br />
+		
+		Index 0: x <br />
+		Index 1: y <br />
+		Index 2: z <br />
 		</div>
 		</div>
 
 
-		<h3>.applyAxisAngle([page:todo axis], [page:todo angle]) [page:todo this]</h3>
+		<h3>.applyAxisAngle([page:Vector3 axis], [page:Float angle]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		axis -- a normalized [page:todo Vector3] <br />
-		angle -- an angle in radians
+		axis -- A normalized [page:Vector3] <br />
+		angle -- An angle in radians
 		</div>
 		</div>
 		<div>
 		<div>
 		Applies a rotation specified by an axis and an angle to this vector.
 		Applies a rotation specified by an axis and an angle to this vector.
 		</div>
 		</div>
 
 
-		<h3>.lerp([page:todo v], [page:todo alpha]) [page:todo this]</h3>
+		<h3>.lerp([page:Vector3 v], [page:Float alpha]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		v -- [page:todo Vector3] <br />
-		alpha -- [page:todo Float] between 0 and 1.
+		v -- [page:Vector3] <br />
+		alpha -- [page:Float] between 0 and 1.
 		</div>
 		</div>
 		<div>
 		<div>
 		Linear Interpolation between this vector and vector v, where alpha is the percent along the line.
 		Linear Interpolation between this vector and vector v, where alpha is the percent along the line.
 		</div>
 		</div>
 
 
-		<h3>.max([page:todo v]) [page:todo this]</h3>
-		<div>
-		v -- [page:todo Vector3]
-		</div>
-		<div>
-		If this vector's x, y, or z value is greater than vector v's x, y, or z value, that value is replaced by the corresponding vector v value.
-		</div>
-
-		<h3>.angleTo([page:todo v]) [page:todo Float]</h3>
+		<h3>.angleTo([page:Vector3 v]) [page:Float]</h3>
 		<div>
 		<div>
-		v -- [page:todo Vector3]
+		v -- [page:Vector3]
 		</div>
 		</div>
 		<div>
 		<div>
 		Returns the angle between this vector and vector v in radians.
 		Returns the angle between this vector and vector v in radians.
 		</div>
 		</div>
 
 
-		<h3>.getColumnFromMatrix([page:todo index], [page:todo matrix]) [page:todo this]</h3>
+		<h3>.setFromMatrixColumn([page:Integer index], [page:Matrix4 matrix]) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		index -- 0, 1, 2, or 3 <br />
 		index -- 0, 1, 2, or 3 <br />
-		matrix -- [page:todo Matrix4]
+		matrix -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
 		Sets this vector's x, y, and z equal to the column of the matrix specified by the index.
 		Sets this vector's x, y, and z equal to the column of the matrix specified by the index.
 		</div>
 		</div>
 
 
-		<h3>.reflect([page:todo vector]) [page:todo this]</h3>
+		<h3>.reflect([page:Vector3 vector]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		vector -- [page:todo Vector3] the vector to reflect about
+		vector -- [page:Vector3] the vector to reflect about
 		</div>
 		</div>
 		<div>
 		<div>
 		Reflects this vector about a vector.
 		Reflects this vector about a vector.
 		</div>
 		</div>
 
 
-		<h3>.fromArray([page:todo array]) [page:todo this]</h3>
+		<h3>.fromArray([page:Array array]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		array -- [page:todo Array]
+		array -- [page:Array] [x, y, z]
 		</div>
 		</div>
 		<div>
 		<div>
-		Assigns this vectors x value to array[0]. <br />
-		Assigns this vectors y value to array[1]. <br />
-		Assigns this vectors z value to array[2]. <br />
+		Sets the vector's components based on an array formatted like [x, y, z]
 		</div>
 		</div>
 
 
-		<h3>.multiply([page:todo v]) [page:todo this]</h3>
+		<h3>.multiply([page:Vector3 v]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		v -- [page:todo Vector3] <br />
+		v -- [page:Vector3] <br />
 		</div>
 		</div>
 		<div>
 		<div>
 		Multipies this vector by vector v.
 		Multipies this vector by vector v.
 		</div>
 		</div>
 
 
-		<h3>.applyProjection([page:todo m]) [page:todo ths]</h3>
+		<h3>.applyProjection([page:Matrix4 m]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		m -- [page:todo Matrix4] projection matrix.
+		m -- [page:Matrix4] projection matrix.
 		</div>
 		</div>
 		<div>
 		<div>
 		Multiplies this vector and m, and divides by perspective.
 		Multiplies this vector and m, and divides by perspective.
 		</div>
 		</div>
 
 
-		<h3>.toArray() [page:todo Array]</h3>
+		<h3>.toArray() [page:Array]</h3>
 		<div>
 		<div>
 		Assigns this vector's x value to array[0]. <br />
 		Assigns this vector's x value to array[0]. <br />
 		Assigns this vector's y value to array[1]. <br />
 		Assigns this vector's y value to array[1]. <br />
@@ -368,17 +370,17 @@
 		Returns the created array.
 		Returns the created array.
 		</div>
 		</div>
 
 
-		<h3>.applyEuler( [page:todo euler] ) [page:todo this]</h3>
+		<h3>.applyEuler([page:Euler euler]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		euler -- [page:todo Euler]
+		euler -- [page:Euler]
 		</div>
 		</div>
 		<div>
 		<div>
 		Applies euler transform to this vector by converting the [page:Euler] obect to a [page:Quaternion] and applying.
 		Applies euler transform to this vector by converting the [page:Euler] obect to a [page:Quaternion] and applying.
 		</div>
 		</div>
 
 
-		<h3>.applyQuaternion([page:todo q]) [page:todo this]</h3>
+		<h3>.applyQuaternion([page:Quaternion quaternion]) [page:Vector3 this]</h3>
 		<div>
 		<div>
-		q -- [page:Quaternion]
+		quaternion -- [page:Quaternion]
 		</div>
 		</div>
 		<div>
 		<div>
 		Applies a [page:Quaternion] transform to this vector.
 		Applies a [page:Quaternion] transform to this vector.

+ 89 - 73
docs/api/math/Vector4.html

@@ -17,13 +17,10 @@
 
 
 		<h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
 		<h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
 		<div>
 		<div>
-		x -- todo <br />
-		y -- todo <br />
-		z -- todo <br />
-		w -- todo
-		</div>
-		<div>
-		todo
+		x -- [page:Float] <br />
+		y -- [page:Float] <br />
+		z -- [page:Float] <br />
+		w -- [page:Float]
 		</div>
 		</div>
 
 
 
 
@@ -40,22 +37,22 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-		<h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:Float w] ) [page:Vector4]</h3>
+		<h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:Float w] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Sets value of this vector.
 		Sets value of this vector.
 		</div>
 		</div>
 
 
-		<h3>.copy( [page:Vector4 v] ) [page:Vector4]</h3>
+		<h3>.copy( [page:Vector4 v] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Copies value of *v* to this vector.
 		Copies value of *v* to this vector.
 		</div>
 		</div>
 
 
-		<h3>.add( [page:Vector4 v] ) [page:Vector4]</h3>
+		<h3>.add( [page:Vector4 v] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Adds *v* to this vector.
 		Adds *v* to this vector.
 		</div>
 		</div>
 
 
-		<h3>.addVectors( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
+		<h3>.addVectors( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Sets this vector to *a + b*.
 		Sets this vector to *a + b*.
 		</div>
 		</div>
@@ -65,23 +62,23 @@
 		Subtracts *v* from this vector.
 		Subtracts *v* from this vector.
 		</div>
 		</div>
 
 
-		<h3>.subVectors( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
+		<h3>.subVectors( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Sets this vector to *a - b*.
 		Sets this vector to *a - b*.
 		</div>
 		</div>
 
 
-		<h3>.multiplyScalar( [page:Float s] ) [page:Vector4]</h3>
+		<h3>.multiplyScalar( [page:Float s] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Multiplies this vector by scalar *s*.
 		Multiplies this vector by scalar *s*.
 		</div>
 		</div>
 
 
-		<h3>.divideScalar( [page:Float s] ) [page:Vector4]</h3>
+		<h3>.divideScalar( [page:Float s] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Divides this vector by scalar *s*.<br />
 		Divides this vector by scalar *s*.<br />
 		Set vector to *( 0, 0, 0 )* if *s == 0*.
 		Set vector to *( 0, 0, 0 )* if *s == 0*.
 		</div>
 		</div>
 
 
-		<h3>.negate() [page:Vector4]</h3>
+		<h3>.negate() [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Inverts this vector.
 		Inverts this vector.
 		</div>
 		</div>
@@ -101,17 +98,17 @@
 		Computes length of this vector.
 		Computes length of this vector.
 		</div>
 		</div>
 
 
-		<h3>.normalize() [page:Vector4]</h3>
+		<h3>.normalize() [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Normalizes this vector.
 		Normalizes this vector.
 		</div>
 		</div>
 
 
-		<h3>.setLength( [page:Float l] ) [page:Vector4]</h3>
+		<h3>.setLength( [page:Float l] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Normalizes this vector and multiplies it by *l*.
 		Normalizes this vector and multiplies it by *l*.
 		</div>
 		</div>
 
 
-		<h3>.lerp( [page:Vector4 v], [page:Float alpha] ) [page:Vector4]</h3>
+		<h3>.lerp( [page:Vector4 v], [page:Float alpha] ) [page:Vector4 this]</h3>
 		<div>
 		<div>
 		Linearly interpolate between this vector and *v* with *alpha* factor.
 		Linearly interpolate between this vector and *v* with *alpha* factor.
 		</div>
 		</div>
@@ -122,136 +119,155 @@
 		</div>
 		</div>
 
 
 
 
-		<h3>.clamp([page:todo min], [page:todo max]) [page:todo]</h3>
+		<h3>.clamp([page:Vector4 min], [page:Vector4 max]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		min -- todo <br />
-		max -- todo
+		min -- [page:Vector4] <br />
+		max -- [page:Vector4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
-		</div>
+		If this vector's x, y, z, or w value is greater than the max vector's x, y, z, or w value, it is replaced by the corresponding value.<br/><br/>
 
 
-		<h3>.toArray() [page:todo]</h3>
-		<div>
-		todo
+		If this vector's x, y, z, or w value is less than the min vector's x, y, z, or w value, it is replace by the corresponding value.
 		</div>
 		</div>
 
 
-		<h3>.applyMatrix4([page:todo m]) [page:todo]</h3>
+		<h3>.applyMatrix4([page:Matrix4 m]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		m -- todo
+		m -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Transforms the vector by the matrix.
 		</div>
 		</div>
 
 
-		<h3>.min([page:todo v]) [page:todo]</h3>
+		<h3>.min([page:Vector4 v]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		v -- todo
+		v -- [page:Vector4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		If this vector's x, y, z, or w value is less than vector v's x, y, z, or w value, that value is replaced by the corresponding vector v value.
 		</div>
 		</div>
 
 
-		<h3>.max([page:todo v]) [page:todo]</h3>
+		<h3>.max([page:Vector4 v]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		v -- todo
+		v -- [page:Vector4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		If this vector's x, y, z, or w value is greater than vector v's x, y, z, or w value, that value is replaced by the corresponding vector v value. 
 		</div>
 		</div>
 
 
-		<h3>.setAxisAngleFromRotationMatrix([page:todo m]) [page:todo]</h3>
+		<h3>.addScalar([page:Float s]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		m -- todo
+		s -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Adds a scalar value to all of the vector's components.
 		</div>
 		</div>
 
 
-		<h3>.addScalar([page:todo s]) [page:todo]</h3>
+		<h3>.equals([page:Vector4 v]) [page:Boolean]</h3>
 		<div>
 		<div>
-		s -- todo
+		v -- [page:Vector4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Checks to see if this vector matches vector v.
 		</div>
 		</div>
-
-		<h3>.equals([page:todo v]) [page:todo]</h3>
+		
+		<h3>.setAxisAngleFromRotationMatrix([page:Matrix4 m]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		v -- todo
+		m -- [page:Matrix4]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets this Vector4 to the computed <a href='http://en.wikipedia.org/wiki/Axis%E2%80%93angle_representation' target='_blank'>axis-angle representation</a> of the rotation defined by Matrix4 m. Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).<br/><br/>
+
+		The axis is stored in components (x, y, z) of the vector, and the rotation in radians is stored in component w
 		</div>
 		</div>
 
 
-		<h3>.setAxisAngleFromQuaternion([page:todo q]) [page:todo]</h3>
+		<h3>.setAxisAngleFromQuaternion([page:Quaternion q]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		q -- todo
+		q -- [page:Quaternion]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets this Vector4 to the computed <a href='http://en.wikipedia.org/wiki/Axis%E2%80%93angle_representation' target='_blank'>axis-angle representation</a> of the rotation defined by Quaternion q.<br/><br/>
+
+		The axis is stored in components (x, y, z) of the vector, and the rotation in radians is stored in component w
 		</div>
 		</div>
 
 
-		<h3>.setW([page:todo w]) [page:todo]</h3>
+		<h3>.getComponent([page:Integer index]) [page:Float]</h3>
 		<div>
 		<div>
-		w -- todo
+		index -- [page:Integer] 0, 1, 2, or 3
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Returns the value of the vector component x, y, or z by an index.<br/><br/>
+
+		Index 0: x<br/>
+		Index 1: y<br/>
+		Index 2: z<br/>
+		Index 3: w<br/>
+ 
 		</div>
 		</div>
 
 
-		<h3>.getComponent([page:todo index]) [page:todo]</h3>
+		<h3>.setComponent([page:Integer index], [page:Float value])</h3>
 		<div>
 		<div>
-		index -- todo
+		index -- [page:Integer] 0 - 3 <br />
+		value -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the value of the vector component  x, y, or z by an index.<br/><br/>
+		
+		Index 0: x<br/>
+		Index 1: y<br/>
+		Index 2: z<br/>
+		Index 3: w<br/>
+		</div>
+		
+		<h3>.fromArray([page:Array array]) [page:Vector4 this]</h3>
+		<div>
+		array -- [page:Array] An array formatted [x, y, z, w]
 		</div>
 		</div>
-
-		<h3>.fromArray([page:todo array]) [page:todo]</h3>
 		<div>
 		<div>
-		array -- todo
+		Sets the vector's components based on an array formatted like [x, y, z, w]
 		</div>
 		</div>
+
+		<h3>.toArray() [page:Array]</h3>
 		<div>
 		<div>
-		todo
+		Returns an array in the format [x, y, z, w]
 		</div>
 		</div>
 
 
-		<h3>.lengthManhattan() [page:todo]</h3>
+		<h3>.lengthManhattan() [page:Float]</h3>
 		<div>
 		<div>
-		todo
+		Computes Manhattan length of this vector.<br />
+		[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
 		</div>
 		</div>
 
 
-		<h3>.setComponent([page:todo index], [page:todo value]) [page:todo]</h3>
+
+		<h3>.setX([page:Float x]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		index -- todo <br />
-		value -- todo
+		x -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the x component of the vector.
 		</div>
 		</div>
 
 
-		<h3>.setX([page:todo x]) [page:todo]</h3>
+		<h3>.setY([page:Float y]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		x -- todo
+		y -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the y component of the vector.
 		</div>
 		</div>
 
 
-		<h3>.setY([page:todo y]) [page:todo]</h3>
+		<h3>.setZ([page:Float z]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		y -- todo
+		z -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the z component of the vector.
 		</div>
 		</div>
 
 
-		<h3>.setZ([page:todo z]) [page:todo]</h3>
+		<h3>.setW([page:Float w]) [page:Vector4 this]</h3>
 		<div>
 		<div>
-		z -- todo
+		w -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Sets the w component of the vector.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 17 - 0
docs/api/objects/Line.html

@@ -14,6 +14,23 @@
 		<div class="desc">A line or a series of lines.</div>
 		<div class="desc">A line or a series of lines.</div>
 
 
 
 
+		<h2>Example</h2>
+
+
+		<code>var material = new THREE.LineBasicMaterial({
+			color: 0x0000ff
+		});
+		
+		var geometry = new THREE.Geometry();
+		geometry.vertices.push( new THREE.Vector3( -10, 0, 0 ) );
+		geometry.vertices.push( new THREE.Vector3( 0, 10, 0 ) );
+		geometry.vertices.push( new THREE.Vector3( 10, 0, 0 ) );
+
+		var line = new THREE.Line( geometry, material );
+		scene.add( line );
+		</code>
+
+		
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 

+ 9 - 27
docs/api/objects/Mesh.html

@@ -14,19 +14,17 @@
 		<div class="desc">Base class for Mesh objects, such as [page:MorphAnimMesh] and [page:SkinnedMesh].</div>
 		<div class="desc">Base class for Mesh objects, such as [page:MorphAnimMesh] and [page:SkinnedMesh].</div>
 
 
 
 
+		<h2>Example</h2>
+		
+		<code>var geometry = new THREE.CubeGeometry( 1, 1, 1 );
+		var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
+		var mesh = new THREE.Mesh( geometry, material );
+		scene.add( mesh );
+		</code>
+
+				
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-
-		<h3>[name]([page:todo geometry], [page:todo material])</h3>
-		<div>
-		geometry -- todo <br />
-		material -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-
 		<h3>[name]( [page:Geometry geometry], [page:Material material] )</h3>
 		<h3>[name]( [page:Geometry geometry], [page:Material material] )</h3>
 
 
 		<div>
 		<div>
@@ -55,22 +53,6 @@
 
 
 		Returns the index of a morph target defined by name.
 		Returns the index of a morph target defined by name.
 
 
-		<h3>.setMaterial([page:todo material]) [page:todo]</h3>
-		<div>
-		material -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-		<h3>.setGeometry([page:todo geometry]) [page:todo]</h3>
-		<div>
-		geometry -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
 		<h3>.updateMorphTargets() [page:todo]</h3>
 		<h3>.updateMorphTargets() [page:todo]</h3>
 		<div>
 		<div>
 		todo
 		todo

+ 0 - 40
docs/api/objects/Particle.html

@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<script src="../../list.js"></script>
-		<script src="../../page.js"></script>
-		<link type="text/css" rel="stylesheet" href="../../page.css" />
-	</head>
-	<body>
-		[page:Object3D] &rarr;
-
-		<h1>[name]</h1>
-
-		<div class="desc">todo</div>
-
-
-		<h2>Constructor</h2>
-
-		<h3>[name]([page:todo material])</h3>
-		<div>
-		material -- todo
-		</div>
-		<div>
-		todo
-		</div>
-
-
-		<h2>Properties</h2>
-
-		<h3>.[page:todo material]</h3>
-		<div>
-		todo
-		</div> 
-
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

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

@@ -32,7 +32,7 @@
 
 
 		<h3>.[page:Material material]</h3>
 		<h3>.[page:Material material]</h3>
 
 
-		<div>An instance of [page:Material], defining the object's appearance. Default is a [page:ParticleBasicMaterial] with randomised colour.</div>
+		<div>An instance of [page:Material], defining the object's appearance. Default is a [page:ParticleSystemMaterial] with randomised colour.</div>
 
 
 		<h3>.[page:Boolean frustrumCulled]</h3>
 		<h3>.[page:Boolean frustrumCulled]</h3>
 		
 		

+ 1 - 1
docs/api/renderers/WebGLRenderTarget.html

@@ -35,7 +35,7 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-
+		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 

+ 2 - 9
docs/api/renderers/WebGLRenderer.html

@@ -23,13 +23,11 @@
 		<div>
 		<div>
 		canvas — A [page:Canvas] where the renderer draws its output.<br />
 		canvas — A [page:Canvas] where the renderer draws its output.<br />
 		precision — shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*.<br />
 		precision — shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*.<br />
-		alpha — [page:Boolean], default is *true*.<br />
+		alpha — [page:Boolean], default is *false*.<br />
 		premultipliedAlpha — [page:Boolean], default is *true*.<br />
 		premultipliedAlpha — [page:Boolean], default is *true*.<br />
 		antialias — [page:Boolean], default is *false*.<br />
 		antialias — [page:Boolean], default is *false*.<br />
 		stencil — [page:Boolean], default is *true*.<br />
 		stencil — [page:Boolean], default is *true*.<br />
 		preserveDrawingBuffer — [page:Boolean], default is *false*.<br />
 		preserveDrawingBuffer — [page:Boolean], default is *false*.<br />
-		clearColor — [page:Integer], default is *0x000000*.<br />
-		clearAlpha — [page:Float], default is *0*.<br />
 		maxLights — [page:Integer], default is *4*.<br />
 		maxLights — [page:Integer], default is *4*.<br />
 		</div>
 		</div>
 
 
@@ -68,7 +66,7 @@
 
 
 		<div>Defines whether the renderer should sort objects. Default is true.</div>
 		<div>Defines whether the renderer should sort objects. Default is true.</div>
 
 
-		<div>TODO</div>
+		<div>Note: Sorting is used to attempt to properly render objects that have some degree of transparency.  By definition, sorting objects may not work in all cases.  Depending on the needs of application, it may be neccessary to turn off sorting and use other methods to deal with transparency rendering e.g. manually determining the object rendering order.</div>
 
 
 
 
 		<h3>.[page:Boolean autoUpdateObjects]</h3>
 		<h3>.[page:Boolean autoUpdateObjects]</h3>
@@ -89,11 +87,6 @@
 		<div>Default is false. TODO</div>
 		<div>Default is false. TODO</div>
 
 
 
 
-		<h3>.[page:Boolean physicallyBasedShading]</h3>
-
-		<div>Default is false. TODO</div>
-
-
 		<h3>.[page:Boolean shadowMapEnabled]</h3>
 		<h3>.[page:Boolean shadowMapEnabled]</h3>
 
 
 		<div>Default is false. TODO</div>
 		<div>Default is false. TODO</div>

+ 4 - 8
docs/api/renderers/WebGLShaders.html → docs/api/renderers/shaders/ShaderChunk.html

@@ -2,20 +2,16 @@
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
 		<meta charset="utf-8" />
 		<meta charset="utf-8" />
-		<script src="../../list.js"></script>
-		<script src="../../page.js"></script>
-		<link type="text/css" rel="stylesheet" href="../../page.css" />
+		<script src="../../../list.js"></script>
+		<script src="../../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../../page.css" />
 	</head>
 	</head>
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">Shader chunks for WebLG Shader library</div>
 
 
 
 
-		<h2>Constructor</h2>
-
-		<h3>[name]()</h3>
-
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 

+ 27 - 0
docs/api/renderers/shaders/ShaderLib.html

@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<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">Webgl Shader Library for three.js</div>
+
+
+		<h2>Properties</h2>
+
+
+
+		<h2>Methods</h2>
+
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 28 - 0
docs/api/renderers/shaders/UniformsLib.html

@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<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">Uniforms library for shared webgl shaders</div>
+
+
+
+		<h2>Properties</h2>
+
+
+
+		<h2>Methods</h2>
+
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 26 - 0
docs/api/renderers/shaders/UniformsUtils.html

@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<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">Uniform Utilities. Support merging and cloning of uniform variables</div>
+
+		<h2>Properties</h2>
+
+
+
+		<h2>Methods</h2>
+
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 3 - 14
docs/index.html

@@ -27,34 +27,25 @@
 			}
 			}
 
 
 			a {
 			a {
-
 				color: #2194CE;
 				color: #2194CE;
-
+				text-decoration: none;
 			}
 			}
 
 
 			#panel	{
 			#panel	{
-
 				position: fixed;
 				position: fixed;
-
 				width: 260px;
 				width: 260px;
 				height: 100%;
 				height: 100%;
-
 				overflow: auto;
 				overflow: auto;
-
 			}
 			}
 
 
 				#panel h1 {
 				#panel h1 {
 					margin-top: 20px;
 					margin-top: 20px;
+					margin-bottom: 40px;
 					margin-left: 20px;
 					margin-left: 20px;
 					font-size: 25px;
 					font-size: 25px;
 					font-weight: normal;
 					font-weight: normal;
 				}
 				}
 
 
-				#panel h1 a {
-					color: #444;
-					text-decoration: none;
-				}
-
 				#panel h2 {
 				#panel h2 {
 					color: #454545;
 					color: #454545;
 					font-size: 18px;
 					font-size: 18px;
@@ -97,12 +88,10 @@
 
 
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script>
 		<script>
-			var REVISION = '61';
-
 			var panel = document.getElementById( 'panel' );
 			var panel = document.getElementById( 'panel' );
 			var viewer = document.getElementById( 'viewer' );
 			var viewer = document.getElementById( 'viewer' );
 
 
-			var html = '<h1><a href="http://threejs.org">three.js</a><span style="font-size: 50%; vertical-align: super;"> r' + REVISION + '</span></h1>';
+			var html = '<h1><a href="http://threejs.org">three.js</a> / docs</h1>';
 
 
 			var DELIMITER = '/';
 			var DELIMITER = '/';
 			var nameCategoryMap = {};
 			var nameCategoryMap = {};

+ 21 - 8
docs/list.js

@@ -7,6 +7,14 @@ var list = {
 	},
 	},
 
 
 	"Reference": {
 	"Reference": {
+    "Constants": [
+      [ "CustomBlendingEquation", "api/constants/CustomBlendingEquations"],
+      [ "GLState", "api/constants/GLState"],
+      [ "Materials", "api/constants/Materials"],
+      [ "ShadowingTypes", "api/constants/ShadowingTypes"],
+      [ "Textures", "api/constants/Textures"]
+    ],
+
 		"Cameras": [
 		"Cameras": [
 			[ "Camera", "api/cameras/Camera" ],
 			[ "Camera", "api/cameras/Camera" ],
 			[ "OrthographicCamera", "api/cameras/OrthographicCamera" ],
 			[ "OrthographicCamera", "api/cameras/OrthographicCamera" ],
@@ -55,12 +63,10 @@ var list = {
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
-			[ "ParticleBasicMaterial", "api/materials/ParticleBasicMaterial" ],
-			[ "ParticleCanvasMaterial", "api/materials/ParticleCanvasMaterial" ],
-			[ "ParticleDOMMaterial", "api/materials/ParticleDOMMaterial" ],
+			[ "ParticleSystemMaterial", "api/materials/ParticleSystemMaterial" ],
 			[ "ShaderMaterial", "api/materials/ShaderMaterial" ],
 			[ "ShaderMaterial", "api/materials/ShaderMaterial" ],
-			[ "SpriteMaterial", "api/materials/SpriteMaterial" ]
-
+			[ "SpriteMaterial", "api/materials/SpriteMaterial" ],
+			[ "SpriteCanvasMaterial", "api/materials/SpriteCanvasMaterial" ]
 		],
 		],
 
 
 		"Math": [
 		"Math": [
@@ -69,6 +75,7 @@ var list = {
 			[ "Color", "api/math/Color" ],
 			[ "Color", "api/math/Color" ],
 			[ "Euler", "api/math/Euler" ],
 			[ "Euler", "api/math/Euler" ],
 			[ "Frustum", "api/math/Frustum" ],
 			[ "Frustum", "api/math/Frustum" ],
+			[ "Line3", "api/math/Line3" ],
 			[ "Math", "api/math/Math" ],
 			[ "Math", "api/math/Math" ],
 			[ "Matrix3", "api/math/Matrix3" ],
 			[ "Matrix3", "api/math/Matrix3" ],
 			[ "Matrix4", "api/math/Matrix4" ],
 			[ "Matrix4", "api/math/Matrix4" ],
@@ -89,7 +96,6 @@ var list = {
 			[ "LOD", "api/objects/LOD" ],
 			[ "LOD", "api/objects/LOD" ],
 			[ "Mesh", "api/objects/Mesh" ],
 			[ "Mesh", "api/objects/Mesh" ],
 			[ "MorphAnimMesh", "api/objects/MorphAnimMesh" ],
 			[ "MorphAnimMesh", "api/objects/MorphAnimMesh" ],
-			[ "Particle", "api/objects/Particle" ],
 			[ "ParticleSystem", "api/objects/ParticleSystem" ],
 			[ "ParticleSystem", "api/objects/ParticleSystem" ],
 			[ "SkinnedMesh", "api/objects/SkinnedMesh" ],
 			[ "SkinnedMesh", "api/objects/SkinnedMesh" ],
 			[ "Sprite", "api/objects/Sprite" ]
 			[ "Sprite", "api/objects/Sprite" ]
@@ -100,8 +106,7 @@ var list = {
 			[ "CanvasRenderer", "api/renderers/CanvasRenderer" ],
 			[ "CanvasRenderer", "api/renderers/CanvasRenderer" ],
 			[ "WebGLRenderer", "api/renderers/WebGLRenderer" ],
 			[ "WebGLRenderer", "api/renderers/WebGLRenderer" ],
 			[ "WebGLRenderTarget", "api/renderers/WebGLRenderTarget" ],
 			[ "WebGLRenderTarget", "api/renderers/WebGLRenderTarget" ],
-			[ "WebGLRenderTargetCube", "api/renderers/WebGLRenderTargetCube" ],
-			[ "WebGLShaders", "api/renderers/WebGLShaders" ]
+			[ "WebGLRenderTargetCube", "api/renderers/WebGLRenderTargetCube" ]
 		],
 		],
 
 
 		"Renderers / Renderables": [
 		"Renderers / Renderables": [
@@ -112,6 +117,13 @@ var list = {
 			[ "RenderableVertex", "api/renderers/renderables/RenderableVertex" ]
 			[ "RenderableVertex", "api/renderers/renderables/RenderableVertex" ]
 		],
 		],
 
 
+		"Renderers / Shaders": [
+			[ "ShaderChunk", "api/renderers/shaders/ShaderChunk" ],
+			[ "UniformsUtils", "api/renderers/shaders/UniformsUtils" ],
+			[ "UniformsLib", "api/renderers/shaders/UniformsLib" ],
+			[ "ShaderLib", "api/renderers/shaders/ShaderLib" ]
+		],
+
 		"Scenes": [
 		"Scenes": [
 			[ "Fog", "api/scenes/Fog" ],
 			[ "Fog", "api/scenes/Fog" ],
 			[ "FogExp2", "api/scenes/FogExp2" ],
 			[ "FogExp2", "api/scenes/FogExp2" ],
@@ -163,6 +175,7 @@ var list = {
 			[ "ParametricGeometry", "api/extras/geometries/ParametricGeometry" ],
 			[ "ParametricGeometry", "api/extras/geometries/ParametricGeometry" ],
 			[ "PlaneGeometry", "api/extras/geometries/PlaneGeometry" ],
 			[ "PlaneGeometry", "api/extras/geometries/PlaneGeometry" ],
 			[ "PolyhedronGeometry", "api/extras/geometries/PolyhedronGeometry" ],
 			[ "PolyhedronGeometry", "api/extras/geometries/PolyhedronGeometry" ],
+			[ "RingGeometry", "api/extras/geometries/RingGeometry" ],
 			[ "ShapeGeometry", "api/extras/geometries/ShapeGeometry" ],
 			[ "ShapeGeometry", "api/extras/geometries/ShapeGeometry" ],
 			[ "SphereGeometry", "api/extras/geometries/SphereGeometry" ],
 			[ "SphereGeometry", "api/extras/geometries/SphereGeometry" ],
 			[ "TetrahedronGeometry", "api/extras/geometries/TetrahedronGeometry" ],
 			[ "TetrahedronGeometry", "api/extras/geometries/TetrahedronGeometry" ],

+ 7 - 10
editor/css/dark.css

@@ -50,7 +50,7 @@ button {
 	-webkit-user-select: none;
 	-webkit-user-select: none;
 	-ms-user-select: none;
 	-ms-user-select: none;
 
 
-		/* No support for these yet */
+	/* No support for these yet */
 	-o-user-select: none;
 	-o-user-select: none;
 	user-select: none;
 	user-select: none;
 }
 }
@@ -83,11 +83,11 @@ input.Number {
 }
 }
 
 
 #viewport {
 #viewport {
+	position: absolute;
 	top: 32px;
 	top: 32px;
 	left: 0px;
 	left: 0px;
 	right: 300px;
 	right: 300px;
 	bottom: 32px;
 	bottom: 32px;
-	background-color: #333333;
 }
 }
 
 
 #menubar {
 #menubar {
@@ -110,12 +110,17 @@ input.Number {
 	}
 	}
 
 
 		#menubar .menu .options {
 		#menubar .menu .options {
+			display: none;
 			padding: 5px 0px;
 			padding: 5px 0px;
 			background-color: #111;
 			background-color: #111;
 			width: 140px;
 			width: 140px;
 			border-top: solid 1px #1D1D1D;
 			border-top: solid 1px #1D1D1D;
 		}
 		}
 
 
+		#menubar .menu:hover .options {
+			display: block;
+		}
+
 			#menubar .menu .options hr {
 			#menubar .menu .options hr {
 				border-color: #444;
 				border-color: #444;
 			}
 			}
@@ -172,14 +177,6 @@ input.Number {
 
 
 	}
 	}
 
 
-	#sidebar #outliner .type {
-		padding: 2px 4px;
-		font-size: 10px;
-		background: #474747;
-		border-radius: 2px 2px;
-		color: #aaa;
-	}
-
 #toolbar {
 #toolbar {
 	position: absolute;
 	position: absolute;
 	left: 0px;
 	left: 0px;

+ 9 - 11
editor/css/light.css

@@ -19,12 +19,11 @@ button {
 }
 }
 
 
 .Panel {
 .Panel {
-
 	-moz-user-select: none;
 	-moz-user-select: none;
 	-webkit-user-select: none;
 	-webkit-user-select: none;
 	-ms-user-select: none;
 	-ms-user-select: none;
 
 
-		/* No support for these yet */
+	/* No support for these yet */
 	-o-user-select: none;
 	-o-user-select: none;
 	user-select: none;
 	user-select: none;
 }
 }
@@ -40,11 +39,12 @@ button {
 
 
 	.FancySelect .option {
 	.FancySelect .option {
 		padding: 4px;
 		padding: 4px;
+		color: #666;
 		white-space: nowrap;
 		white-space: nowrap;
 	}
 	}
 
 
 	.FancySelect .option.active {
 	.FancySelect .option.active {
-		background-color: #F0F0F0;
+		background-color: #f8f8f8;
 	}
 	}
 
 
 input.Number {
 input.Number {
@@ -57,11 +57,11 @@ input.Number {
 }
 }
 
 
 #viewport {
 #viewport {
+	position: absolute;
 	top: 32px;
 	top: 32px;
 	left: 0px;
 	left: 0px;
 	right: 300px;
 	right: 300px;
 	bottom: 32px;
 	bottom: 32px;
-	background-color: #aaaaaa;
 }
 }
 
 
 #menubar {
 #menubar {
@@ -84,11 +84,16 @@ input.Number {
 	}
 	}
 
 
 		#menubar .menu .options {
 		#menubar .menu .options {
+			display: none;
 			padding: 5px 0px;
 			padding: 5px 0px;
 			background: #eee;
 			background: #eee;
 			width: 140px;
 			width: 140px;
 		}
 		}
 
 
+		#menubar .menu:hover .options {
+			display: block;
+		}
+
 			#menubar .menu .options hr {
 			#menubar .menu .options hr {
 				border-color: #ddd;
 				border-color: #ddd;
 			}
 			}
@@ -139,13 +144,6 @@ input.Number {
 		font-size: 12px;
 		font-size: 12px;
 	}
 	}
 
 
-	#sidebar #outliner .type {
-		padding: 2px 4px;
-		font-size: 10px;
-		background: #eee;
-		color: #aaa;
-	}
-
 #toolbar {
 #toolbar {
 	position: absolute;
 	position: absolute;
 	left: 0px;
 	left: 0px;

+ 50 - 0
editor/css/types.css

@@ -0,0 +1,50 @@
+.type {
+	position:relative;
+	top:-2px;
+	padding: 0px 2px;
+	color: #ddd;
+}
+.type:after {
+	content: '■';
+}
+
+.Scene {
+	color: #ccccff;
+}
+
+.Object3D {
+	color: #aaaaee;
+}
+
+.Mesh {
+	color: #8888ee;
+}
+
+/* */
+
+.PointLight {
+	color: #dddd00;
+}
+
+/* */
+
+.Geometry {
+	color: #88ff88;
+}
+
+.CubeGeometry {
+	color: #bbeebb;
+}
+.TorusGeometry {
+	color: #aaeeaa;	
+}
+
+/* */
+
+.Material {
+	color: #ff8888;
+}
+
+.MeshPhongMaterial {
+	color: #ffaa88;
+}

+ 63 - 20
editor/index.html

@@ -6,6 +6,7 @@
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 	</head>
 	</head>
 	<body>
 	<body>
+		<link href="css/types.css" rel="stylesheet" />
 		<link id="theme" href="css/light.css" rel="stylesheet" />
 		<link id="theme" href="css/light.css" rel="stylesheet" />
 
 
 		<script src="../build/three.min.js"></script>
 		<script src="../build/three.min.js"></script>
@@ -39,18 +40,20 @@
 		<script src="../examples/js/exporters/ObjectExporter.js"></script>
 		<script src="../examples/js/exporters/ObjectExporter.js"></script>
 		<script src="../examples/js/renderers/WebGLRenderer3.js"></script>
 		<script src="../examples/js/renderers/WebGLRenderer3.js"></script>
 
 
-		<script src="js/libs/rawdeflate.js"></script>
-		<script src="js/libs/rawinflate.js"></script>
 		<script src="js/libs/signals.min.js"></script>
 		<script src="js/libs/signals.min.js"></script>
 		<script src="js/libs/ui.js"></script>
 		<script src="js/libs/ui.js"></script>
 		<script src="js/libs/ui.three.js"></script>
 		<script src="js/libs/ui.three.js"></script>
 
 
+		<script src="js/Storage.js"></script>
+
 		<script src="js/Editor.js"></script>
 		<script src="js/Editor.js"></script>
+		<script src="js/Config.js"></script>
 		<script src="js/Loader.js"></script>
 		<script src="js/Loader.js"></script>
 		<script src="js/Menubar.js"></script>
 		<script src="js/Menubar.js"></script>
 		<script src="js/Menubar.File.js"></script>
 		<script src="js/Menubar.File.js"></script>
 		<script src="js/Menubar.Edit.js"></script>
 		<script src="js/Menubar.Edit.js"></script>
 		<script src="js/Menubar.Add.js"></script>
 		<script src="js/Menubar.Add.js"></script>
+		<script src="js/Menubar.View.js"></script>
 		<script src="js/Menubar.Help.js"></script>
 		<script src="js/Menubar.Help.js"></script>
 		<script src="js/Sidebar.js"></script>
 		<script src="js/Sidebar.js"></script>
 		<script src="js/Sidebar.Renderer.js"></script>
 		<script src="js/Sidebar.Renderer.js"></script>
@@ -91,6 +94,60 @@
 
 
 			//
 			//
 
 
+			editor.setTheme( editor.config.getKey( 'theme' ) );
+
+			editor.storage.init( function () {
+
+				editor.storage.get( function ( state ) {
+
+					if ( state !== undefined ) {
+
+						var loader = new THREE.ObjectLoader();
+						var scene = loader.parse( state );
+
+						editor.setScene( scene );
+
+					}
+
+					var selected = editor.config.getKey( 'selected' );
+
+					if ( selected !== undefined ) {
+
+						editor.selectByUuid( selected );
+
+					}
+
+				} );
+
+				//
+
+				var timeout;
+				var exporter = new THREE.ObjectExporter();
+
+				var saveState = function ( scene ) {
+
+					clearTimeout( timeout );
+
+					timeout = setTimeout( function () {
+
+						editor.storage.set( exporter.parse( editor.scene ) );
+
+					}, 1000 );
+
+				};
+
+				var signals = editor.signals;
+
+				signals.objectAdded.add( saveState );
+				signals.objectChanged.add( saveState );
+				signals.objectRemoved.add( saveState );
+				signals.materialChanged.add( saveState );
+				signals.sceneGraphChanged.add( saveState );
+
+			} );
+
+			//
+
 			document.addEventListener( 'dragover', function ( event ) {
 			document.addEventListener( 'dragover', function ( event ) {
 
 
 				event.preventDefault();
 				event.preventDefault();
@@ -109,14 +166,15 @@
 
 
 				switch ( event.keyCode ) {
 				switch ( event.keyCode ) {
 
 
+					case 8: // prevent browser back 
+						event.preventDefault();
+						break;
 					case 46: // delete
 					case 46: // delete
-
 						editor.removeObject( editor.selected );
 						editor.removeObject( editor.selected );
 						editor.deselect();
 						editor.deselect();
-
 						break;
 						break;
 
 
-					}
+				}
 
 
 			}, false );
 			}, false );
 
 
@@ -130,21 +188,6 @@
 
 
 			onWindowResize();
 			onWindowResize();
 
 
-			var hash = window.location.hash.substr( 1 );
-
-			if ( hash !== '' && hash.substr( 0, 2 ) === 'A/' ) {
-
-				var string = RawDeflate.inflate( window.atob( hash.substr( 2 ) ) );
-				var json = JSON.parse( string );
-				var scene = new THREE.ObjectLoader().parse( json );
-				editor.setScene( scene );
-				
-			} else {
-
-				editor.loader.loadLocalStorage();
-
-			}
-
 		</script>
 		</script>
 	</body>
 	</body>
 </html>
 </html>

+ 51 - 0
editor/js/Config.js

@@ -0,0 +1,51 @@
+var Config = function () {
+
+	var name = 'threejs-editor';
+
+	var storage = {
+		theme: 'css/light.css',
+		camera: {
+			position: [ 500, 250, 500 ],
+			target: [ 0, 0, 0 ] 
+		}
+	};
+
+	if ( window.localStorage[ name ] !== undefined ) {
+
+		var data = JSON.parse( window.localStorage[ name ] );
+
+		for ( var key in data ) {
+
+			storage[ key ] = data[ key ];
+
+		}
+
+	}
+
+	return {
+
+		getKey: function ( key ) {
+
+			return storage[ key ];
+
+		},
+
+		setKey: function ( key, value ) {
+
+			storage[ key ] = value;
+
+			window.localStorage[ name ] = JSON.stringify( storage );
+
+			console.log( '[' + /\d\d\:\d\d\:\d\d/.exec( new Date() )[ 0 ] + ']', 'Saved config to LocalStorage.' );
+
+		},
+
+		clear: function () {
+
+			delete window.localStorage[ name ];
+
+		}
+
+	}
+
+};

+ 45 - 6
editor/js/Editor.js

@@ -10,6 +10,8 @@ var Editor = function () {
 
 
 		// notifications
 		// notifications
 
 
+		themeChanged: new SIGNALS.Signal(),
+
 		transformModeChanged: new SIGNALS.Signal(),
 		transformModeChanged: new SIGNALS.Signal(),
 		snapChanged: new SIGNALS.Signal(),
 		snapChanged: new SIGNALS.Signal(),
 		spaceChanged: new SIGNALS.Signal(),
 		spaceChanged: new SIGNALS.Signal(),
@@ -34,7 +36,9 @@ var Editor = function () {
 		windowResize: new SIGNALS.Signal()
 		windowResize: new SIGNALS.Signal()
 
 
 	};
 	};
-
+	
+	this.config = new Config();
+	this.storage = new Storage();
 	this.loader = new Loader( this );
 	this.loader = new Loader( this );
 
 
 	this.scene = new THREE.Scene();
 	this.scene = new THREE.Scene();
@@ -52,6 +56,14 @@ var Editor = function () {
 
 
 Editor.prototype = {
 Editor.prototype = {
 
 
+	setTheme: function ( value ) {
+
+		document.getElementById( 'theme' ).href = value;
+
+		this.signals.themeChanged.dispatch( value );
+
+	},
+
 	setScene: function ( scene ) {
 	setScene: function ( scene ) {
 
 
 		this.scene.name = scene.name;
 		this.scene.name = scene.name;
@@ -280,25 +292,50 @@ Editor.prototype = {
 	select: function ( object ) {
 	select: function ( object ) {
 
 
 		this.selected = object;
 		this.selected = object;
+
+		if ( object !== null ) {
+
+			this.config.setKey( 'selected', object.uuid );
+
+		} else {
+
+			this.config.setKey( 'selected', null );
+
+		}
+
 		this.signals.objectSelected.dispatch( object );
 		this.signals.objectSelected.dispatch( object );
 
 
 	},
 	},
 
 
 	selectById: function ( id ) {
 	selectById: function ( id ) {
 
 
-		var object = null;
+		var scope = this;
 
 
 		this.scene.traverse( function ( child ) {
 		this.scene.traverse( function ( child ) {
 
 
 			if ( child.id === id ) {
 			if ( child.id === id ) {
 
 
-				object = child;
+				scope.select( child );
 
 
 			}
 			}
 
 
 		} );
 		} );
 
 
-		this.select( object );
+	},
+
+	selectByUuid: function ( uuid ) {
+
+		var scope = this;
+
+		this.scene.traverse( function ( child ) {
+
+			if ( child.uuid === uuid ) {
+
+				scope.select( child );
+
+			}
+
+		} );
 
 
 	},
 	},
 
 
@@ -322,6 +359,7 @@ Editor.prototype = {
 			'PointLight': THREE.PointLight,
 			'PointLight': THREE.PointLight,
 			'SpotLight': THREE.SpotLight,
 			'SpotLight': THREE.SpotLight,
 			'Mesh': THREE.Mesh,
 			'Mesh': THREE.Mesh,
+			'Sprite': THREE.Sprite,
 			'Object3D': THREE.Object3D
 			'Object3D': THREE.Object3D
 
 
 		};
 		};
@@ -380,9 +418,10 @@ Editor.prototype = {
 			'MeshLambertMaterial': THREE.MeshLambertMaterial,
 			'MeshLambertMaterial': THREE.MeshLambertMaterial,
 			'MeshNormalMaterial': THREE.MeshNormalMaterial,
 			'MeshNormalMaterial': THREE.MeshNormalMaterial,
 			'MeshPhongMaterial': THREE.MeshPhongMaterial,
 			'MeshPhongMaterial': THREE.MeshPhongMaterial,
-			'ParticleBasicMaterial': THREE.ParticleBasicMaterial,
-			'ParticleCanvasMaterial': THREE.ParticleCanvasMaterial,
+			'ParticleSystemMaterial': THREE.ParticleSystemMaterial,
 			'ShaderMaterial': THREE.ShaderMaterial,
 			'ShaderMaterial': THREE.ShaderMaterial,
+			'SpriteCanvasMaterial': THREE.SpriteCanvasMaterial,
+			'SpriteMaterial': THREE.SpriteMaterial,
 			'Material': THREE.Material
 			'Material': THREE.Material
 
 
 		};
 		};

+ 0 - 34
editor/js/Loader.js

@@ -3,40 +3,6 @@ var Loader = function ( editor ) {
 	var scope = this;
 	var scope = this;
 	var signals = editor.signals;
 	var signals = editor.signals;
 
 
-	this.loadLocalStorage = function () {
-
-		if ( localStorage.threejsEditor !== undefined ) {
-
-			var loader = new THREE.ObjectLoader();
-			var scene = loader.parse( JSON.parse( localStorage.threejsEditor ) );
-
-			editor.setScene( scene );
-
-		}
-
-	};
-
-	var exporter = new THREE.ObjectExporter();
-	var timeout;
-
-	this.saveLocalStorage = function ( scene ) {
-
-		clearTimeout( timeout );
-
-		timeout = setTimeout( function () {
-
-			localStorage.threejsEditor = JSON.stringify( exporter.parse( editor.scene ) );
-			console.log( '[' + /\d\d\:\d\d\:\d\d/.exec( new Date() )[ 0 ] + ']', 'Saved state to LocalStorage.' );
-
-		}, 3000 );
-
-	};
-
-	signals.objectAdded.add( this.saveLocalStorage );
-	signals.objectChanged.add( this.saveLocalStorage );
-	signals.objectRemoved.add( this.saveLocalStorage );
-	signals.sceneGraphChanged.add( this.saveLocalStorage );
-
 	this.loadFile = function ( file ) {
 	this.loadFile = function ( file ) {
 
 
 		var filename = file.name;
 		var filename = file.name;

+ 20 - 4
editor/js/Menubar.Add.js

@@ -2,9 +2,6 @@ Menubar.Add = function ( editor ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 
 	var title = new UI.Panel();
 	var title = new UI.Panel();
 	title.setTextContent( 'Add' );
 	title.setTextContent( 'Add' );
@@ -16,7 +13,6 @@ Menubar.Add = function ( editor ) {
 
 
 	var options = new UI.Panel();
 	var options = new UI.Panel();
 	options.setClass( 'options' );
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 	container.add( options );
 
 
 	var meshCount = 0;
 	var meshCount = 0;
@@ -210,6 +206,26 @@ Menubar.Add = function ( editor ) {
 
 
 	options.add( new UI.HorizontalRule() );
 	options.add( new UI.HorizontalRule() );
 
 
+	// add sprite
+
+	var option = new UI.Panel();
+	option.setClass( 'option' );
+	option.setTextContent( 'Sprite' );
+	option.onClick( function () {
+
+		var sprite = new THREE.Sprite( new THREE.SpriteMaterial() );
+		sprite.name = 'Sprite ' + ( ++ meshCount );
+
+		editor.addObject( sprite );
+		editor.select( sprite );
+
+	} );
+	options.add( option );
+
+	// divider
+
+	options.add( new UI.HorizontalRule() );
+
 	// add point light
 	// add point light
 
 
 	var option = new UI.Panel();
 	var option = new UI.Panel();

+ 0 - 4
editor/js/Menubar.Edit.js

@@ -2,9 +2,6 @@ Menubar.Edit = function ( editor ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 
 	var title = new UI.Panel();
 	var title = new UI.Panel();
 	title.setTextContent( 'Edit' );
 	title.setTextContent( 'Edit' );
@@ -16,7 +13,6 @@ Menubar.Edit = function ( editor ) {
 
 
 	var options = new UI.Panel();
 	var options = new UI.Panel();
 	options.setClass( 'options' );
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 	container.add( options );
 
 
 	// clone
 	// clone

+ 30 - 54
editor/js/Menubar.File.js

@@ -2,9 +2,6 @@ Menubar.File = function ( editor ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 
 	var title = new UI.Panel();
 	var title = new UI.Panel();
 	title.setTextContent( 'File' );
 	title.setTextContent( 'File' );
@@ -16,7 +13,6 @@ Menubar.File = function ( editor ) {
 
 
 	var options = new UI.Panel();
 	var options = new UI.Panel();
 	options.setClass( 'options' );
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 	container.add( options );
 
 
 	// new
 	// new
@@ -28,13 +24,12 @@ Menubar.File = function ( editor ) {
 
 
 		if ( confirm( 'Are you sure?' ) ) {
 		if ( confirm( 'Are you sure?' ) ) {
 
 
-			if ( localStorage.threejsEditor !== undefined ) {
+			editor.config.clear();
+			editor.storage.clear( function () {
 
 
-				delete localStorage.threejsEditor;
+				location.href = location.pathname;
 
 
-			}
-
-			location.href = location.pathname;
+			} );
 
 
 		}
 		}
 
 
@@ -74,37 +69,37 @@ Menubar.File = function ( editor ) {
 	option.setTextContent( 'Export Geometry' );
 	option.setTextContent( 'Export Geometry' );
 	option.onClick( function () {
 	option.onClick( function () {
 
 
-		var geometry = editor.selected.geometry;
+		var object = editor.selected;
 
 
-		if ( geometry instanceof THREE.BufferGeometry ) {
+		if ( object === null ) {
 
 
-			exportGeometry( THREE.BufferGeometryExporter );
+			alert( 'No object selected.' );
+			return;
 
 
-		} else if ( geometry instanceof THREE.Geometry ) {
+		}
 
 
-			exportGeometry( THREE.GeometryExporter );
+		var geometry = object.geometry;
+
+		if ( geometry === undefined ) {
+
+			alert( 'The selected object doesn\'t have geometry.' );
+			return;
 
 
 		}
 		}
 
 
-	} );
-	options.add( option );
+		if ( geometry instanceof THREE.BufferGeometry ) {
 
 
-	/*
+			exportGeometry( THREE.BufferGeometryExporter );
 
 
-	// export scene
+		} else if ( geometry instanceof THREE.Geometry ) {
 
 
-	var option = new UI.Panel();
-	option.setClass( 'option' );
-	option.setTextContent( 'Export Scene' );
-	option.onClick( function () {
+			exportGeometry( THREE.GeometryExporter );
 
 
-		exportScene( THREE.SceneExporter );
+		}
 
 
 	} );
 	} );
 	options.add( option );
 	options.add( option );
 
 
-	*/
-
 	// export object
 	// export object
 
 
 	var option = new UI.Panel();
 	var option = new UI.Panel();
@@ -112,6 +107,13 @@ Menubar.File = function ( editor ) {
 	option.setTextContent( 'Export Object' );
 	option.setTextContent( 'Export Object' );
 	option.onClick( function () {
 	option.onClick( function () {
 
 
+		if ( editor.selected === null ) {
+
+			alert( 'No object selected' );
+			return;
+
+		}
+
 		exportObject( THREE.ObjectExporter );
 		exportObject( THREE.ObjectExporter );
 
 
 	} );
 	} );
@@ -144,19 +146,12 @@ Menubar.File = function ( editor ) {
 	var exportGeometry = function ( exporterClass ) {
 	var exportGeometry = function ( exporterClass ) {
 
 
 		var object = editor.selected;
 		var object = editor.selected;
-
-		if ( object.geometry === undefined ) {
-
-			alert( "Selected object doesn't have any geometry" );
-			return;
-
-		}
-
 		var exporter = new exporterClass();
 		var exporter = new exporterClass();
 
 
 		var output;
 		var output;
 
 
-		if ( exporter instanceof THREE.BufferGeometryExporter || exporter instanceof THREE.GeometryExporter ) {
+		if ( exporter instanceof THREE.BufferGeometryExporter ||
+		     exporter instanceof THREE.GeometryExporter ) {
 
 
 			output = JSON.stringify( exporter.parse( object.geometry ), null, '\t' );
 			output = JSON.stringify( exporter.parse( object.geometry ), null, '\t' );
 			output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
 			output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
@@ -177,9 +172,8 @@ Menubar.File = function ( editor ) {
 
 
 	var exportObject = function ( exporterClass ) {
 	var exportObject = function ( exporterClass ) {
 
 
-		var exporter = new exporterClass();
-
 		var object = editor.selected;
 		var object = editor.selected;
+		var exporter = new exporterClass();
 
 
 		var output = JSON.stringify( exporter.parse( object ), null, '\t' );
 		var output = JSON.stringify( exporter.parse( object ), null, '\t' );
 		output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
 		output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
@@ -207,24 +201,6 @@ Menubar.File = function ( editor ) {
 
 
 	};
 	};
 
 
-	options.add( new UI.HorizontalRule() );
-
-
-	// share
-
-	var option = new UI.Panel();
-	option.setClass( 'option' );
-	option.setTextContent( 'Share' );
-	option.onClick( function () {
-
-		var exporter = new THREE.ObjectExporter();
-		var string = JSON.stringify( exporter.parse( editor.scene ) );
-		window.location.hash = 'A/' + window.btoa( RawDeflate.deflate( string ) );
-
-	} );
-	options.add( option );
-
-
 	return container;
 	return container;
 
 
 }
 }

+ 0 - 4
editor/js/Menubar.Help.js

@@ -2,9 +2,6 @@ Menubar.Help = function ( editor ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 
 	var title = new UI.Panel();
 	var title = new UI.Panel();
 	title.setTextContent( 'Help' );
 	title.setTextContent( 'Help' );
@@ -16,7 +13,6 @@ Menubar.Help = function ( editor ) {
 
 
 	var options = new UI.Panel();
 	var options = new UI.Panel();
 	options.setClass( 'options' );
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 	container.add( options );
 
 
 	// source code
 	// source code

+ 48 - 0
editor/js/Menubar.View.js

@@ -0,0 +1,48 @@
+Menubar.View = function ( editor ) {
+
+	var container = new UI.Panel();
+	container.setClass( 'menu' );
+
+	var title = new UI.Panel();
+	title.setTextContent( 'View' );
+	title.setMargin( '0px' );
+	title.setPadding( '8px' );
+	container.add( title );
+
+	//
+
+	var options = new UI.Panel();
+	options.setClass( 'options' );
+	container.add( options );
+
+	// themes
+
+	var option = new UI.Panel();
+	option.setClass( 'option' );
+	option.setTextContent( 'Light theme' );
+	option.onClick( function () {
+
+		editor.setTheme( 'css/light.css' );
+		editor.config.setKey( 'theme', 'css/light.css' );
+
+	} );
+	options.add( option );
+
+	// about
+
+	var option = new UI.Panel();
+	option.setClass( 'option' );
+	option.setTextContent( 'Dark theme' );
+	option.onClick( function () {
+
+		editor.setTheme( 'css/dark.css' );
+		editor.config.setKey( 'theme', 'css/dark.css' );
+
+	} );
+	options.add( option );
+
+	//
+
+	return container;
+
+}

+ 1 - 0
editor/js/Menubar.js

@@ -5,6 +5,7 @@ var Menubar = function ( editor ) {
 	container.add( new Menubar.File( editor ) );
 	container.add( new Menubar.File( editor ) );
 	container.add( new Menubar.Edit( editor ) );
 	container.add( new Menubar.Edit( editor ) );
 	container.add( new Menubar.Add( editor ) );
 	container.add( new Menubar.Add( editor ) );
+	container.add( new Menubar.View( editor ) );
 	container.add( new Menubar.Help( editor ) );
 	container.add( new Menubar.Help( editor ) );
 
 
 	return container;
 	return container;

+ 7 - 7
editor/js/Sidebar.Geometry.CylinderGeometry.js

@@ -34,15 +34,15 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 
 
 	container.add( heightRow );
 	container.add( heightRow );
 
 
-	// radiusSegments
+	// radialSegments
 
 
-	var radiusSegmentsRow = new UI.Panel();
-	var radiusSegments = new UI.Integer( geometry.radiusSegments ).setRange( 1, Infinity ).onChange( update );
+	var radialSegmentsRow = new UI.Panel();
+	var radialSegments = new UI.Integer( geometry.radialSegments ).setRange( 1, Infinity ).onChange( update );
 
 
-	radiusSegmentsRow.add( new UI.Text( 'Radius segments' ).setWidth( '90px' ) );
-	radiusSegmentsRow.add( radiusSegments );
+	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
+	radialSegmentsRow.add( radialSegments );
 
 
-	container.add( radiusSegmentsRow );
+	container.add( radialSegmentsRow );
 
 
 	// heightSegments
 	// heightSegments
 
 
@@ -76,7 +76,7 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 			radiusTop.getValue(),
 			radiusTop.getValue(),
 			radiusBottom.getValue(),
 			radiusBottom.getValue(),
 			height.getValue(),
 			height.getValue(),
-			radiusSegments.getValue(),
+			radialSegments.getValue(),
 			heightSegments.getValue(),
 			heightSegments.getValue(),
 			openEnded.getValue()
 			openEnded.getValue()
 		);
 		);

+ 19 - 23
editor/js/Sidebar.Material.js

@@ -12,9 +12,10 @@ Sidebar.Material = function ( editor ) {
 		'MeshLambertMaterial': THREE.MeshLambertMaterial,
 		'MeshLambertMaterial': THREE.MeshLambertMaterial,
 		'MeshNormalMaterial': THREE.MeshNormalMaterial,
 		'MeshNormalMaterial': THREE.MeshNormalMaterial,
 		'MeshPhongMaterial': THREE.MeshPhongMaterial,
 		'MeshPhongMaterial': THREE.MeshPhongMaterial,
-		'ParticleBasicMaterial': THREE.ParticleBasicMaterial,
-		'ParticleCanvasMaterial': THREE.ParticleCanvasMaterial,
+		'ParticleSystemMaterial': THREE.ParticleSystemMaterial,
 		'ShaderMaterial': THREE.ShaderMaterial,
 		'ShaderMaterial': THREE.ShaderMaterial,
+		'SpriteMaterial': THREE.SpriteMaterial,
+		'SpriteCanvasMaterial': THREE.SpriteCanvasMaterial,
 		'Material': THREE.Material
 		'Material': THREE.Material
 
 
 	};
 	};
@@ -69,7 +70,8 @@ Sidebar.Material = function ( editor ) {
 		'MeshFaceMaterial': 'MeshFaceMaterial',
 		'MeshFaceMaterial': 'MeshFaceMaterial',
 		'MeshLambertMaterial': 'MeshLambertMaterial',
 		'MeshLambertMaterial': 'MeshLambertMaterial',
 		'MeshNormalMaterial': 'MeshNormalMaterial',
 		'MeshNormalMaterial': 'MeshNormalMaterial',
-		'MeshPhongMaterial': 'MeshPhongMaterial'
+		'MeshPhongMaterial': 'MeshPhongMaterial',
+		'SpriteMaterial': 'SpriteMaterial'
 
 
 	} ).setWidth( '150px' ).setColor( '#444' ).setFontSize( '12px' ).onChange( update );
 	} ).setWidth( '150px' ).setColor( '#444' ).setFontSize( '12px' ).onChange( update );
 
 
@@ -309,6 +311,7 @@ Sidebar.Material = function ( editor ) {
 		var textureWarning = false;
 		var textureWarning = false;
 		var objectHasUvs = false;
 		var objectHasUvs = false;
 
 
+		if ( object instanceof THREE.Sprite ) objectHasUvs = true;
 		if ( geometry instanceof THREE.Geometry && geometry.faceVertexUvs[ 0 ].length > 0 ) objectHasUvs = true;
 		if ( geometry instanceof THREE.Geometry && geometry.faceVertexUvs[ 0 ].length > 0 ) objectHasUvs = true;
 		if ( geometry instanceof THREE.BufferGeometry && geometry.attributes.uv !== undefined ) objectHasUvs = true;
 		if ( geometry instanceof THREE.BufferGeometry && geometry.attributes.uv !== undefined ) objectHasUvs = true;
 
 
@@ -373,8 +376,12 @@ Sidebar.Material = function ( editor ) {
 
 
 				if ( objectHasUvs )  {
 				if ( objectHasUvs )  {
 
 
-					geometry.buffersNeedUpdate = true;
-					geometry.uvsNeedUpdate = true;
+					if ( geometry !== undefined ) {
+
+						geometry.buffersNeedUpdate = true;
+						geometry.uvsNeedUpdate = true;
+
+					}
 
 
 					material.map = mapEnabled ? materialMap.getValue() : null;
 					material.map = mapEnabled ? materialMap.getValue() : null;
 					material.needsUpdate = true;
 					material.needsUpdate = true;
@@ -562,29 +569,18 @@ Sidebar.Material = function ( editor ) {
 			'opacity': materialOpacityRow,
 			'opacity': materialOpacityRow,
 			'transparent': materialTransparentRow,
 			'transparent': materialTransparentRow,
 			'wireframe': materialWireframeRow
 			'wireframe': materialWireframeRow
-
 		};
 		};
 
 
-		var object = editor.selected;
+		var material = editor.selected.material;
 
 
 		for ( var property in properties ) {
 		for ( var property in properties ) {
 
 
-			properties[ property ].setDisplay( object.material[ property ] !== undefined ? '' : 'none' );
+			properties[ property ].setDisplay( material[ property ] !== undefined ? '' : 'none' );
 
 
 		}
 		}
 
 
 	};
 	};
 
 
-	function getMaterialInstanceName( material ) {
-
-		for ( var key in materialClasses ) {
-
-			if ( material instanceof materialClasses[ key ] ) return key;
-
-		}
-
-	}
-
 	// events
 	// events
 
 
 	signals.objectSelected.add( function ( object ) {
 	signals.objectSelected.add( function ( object ) {
@@ -607,29 +603,29 @@ Sidebar.Material = function ( editor ) {
 
 
 			}
 			}
 
 
-			materialClass.setValue( getMaterialInstanceName( material ) );
+			materialClass.setValue( editor.getMaterialType( material ) );
 
 
 			if ( material.color !== undefined ) {
 			if ( material.color !== undefined ) {
 
 
-				materialColor.setValue( '#' + material.color.getHexString() );
+				materialColor.setHexValue( material.color.getHexString() );
 
 
 			}
 			}
 
 
 			if ( material.ambient !== undefined ) {
 			if ( material.ambient !== undefined ) {
 
 
-				materialAmbient.setValue( '#' + material.ambient.getHexString() );
+				materialAmbient.setHexValue( material.ambient.getHexString() );
 
 
 			}
 			}
 
 
 			if ( material.emissive !== undefined ) {
 			if ( material.emissive !== undefined ) {
 
 
-				materialEmissive.setValue( '#' + material.emissive.getHexString() );
+				materialEmissive.setHexValue( material.emissive.getHexString() );
 
 
 			}
 			}
 
 
 			if ( material.specular !== undefined ) {
 			if ( material.specular !== undefined ) {
 
 
-				materialSpecular.setValue( '#' + material.specular.getHexString() );
+				materialSpecular.setHexValue( material.specular.getHexString() );
 
 
 			}
 			}
 
 

+ 3 - 27
editor/js/Sidebar.Object3D.js

@@ -416,30 +416,6 @@ Sidebar.Object3D = function ( editor ) {
 
 
 	}
 	}
 
 
-	function getObjectInstanceName( object ) {
-
-		var objects = {
-
-			'Scene': THREE.Scene,
-			'PerspectiveCamera': THREE.PerspectiveCamera,
-			'AmbientLight': THREE.AmbientLight,
-			'DirectionalLight': THREE.DirectionalLight,
-			'HemisphereLight': THREE.HemisphereLight,
-			'PointLight': THREE.PointLight,
-			'SpotLight': THREE.SpotLight,
-			'Mesh': THREE.Mesh,
-			'Object3D': THREE.Object3D
-
-		};
-
-		for ( var key in objects ) {
-
-			if ( object instanceof objects[ key ] ) return key;
-
-		}
-
-	}
-
 	// events
 	// events
 
 
 	signals.objectSelected.add( function ( object ) {
 	signals.objectSelected.add( function ( object ) {
@@ -492,7 +468,7 @@ Sidebar.Object3D = function ( editor ) {
 
 
 			container.setDisplay( 'block' );
 			container.setDisplay( 'block' );
 
 
-			objectType.setValue( getObjectInstanceName( object ) );
+			objectType.setValue( editor.getObjectType( object ) );
 
 
 			objectUUID.setValue( object.uuid );
 			objectUUID.setValue( object.uuid );
 			objectName.setValue( object.name );
 			objectName.setValue( object.name );
@@ -541,13 +517,13 @@ Sidebar.Object3D = function ( editor ) {
 
 
 			if ( object.color !== undefined ) {
 			if ( object.color !== undefined ) {
 
 
-				objectColor.setValue( '#' + object.color.getHexString() );
+				objectColor.setHexValue( object.color.getHexString() );
 
 
 			}
 			}
 
 
 			if ( object.groundColor !== undefined ) {
 			if ( object.groundColor !== undefined ) {
 
 
-				objectGroundColor.setValue( '#' + object.groundColor.getHexString() );
+				objectGroundColor.setHexValue( object.groundColor.getHexString() );
 
 
 			}
 			}
 
 

+ 5 - 24
editor/js/Sidebar.Renderer.js

@@ -37,37 +37,18 @@ Sidebar.Renderer = function ( editor ) {
 
 
 	container.add( rendererTypeRow );
 	container.add( rendererTypeRow );
 
 
-	// Quick hack to expose a user control to switch themes - for easy review purposes only
+	if ( editor.config.getKey( 'renderer' ) !== undefined ) {
 
 
-	var themeLink = document.getElementById( 'theme' );
-	var themeRow = new UI.Panel();
-	var originalColor;
+		rendererType.setValue( editor.config.getKey( 'renderer' ) );
 
 
-	var theme = new UI.Select().setOptions( [ 'Light', 'Dark' ] ).setWidth( '150px ').setColor( '#444' ).setFontSize( '12px ');
-	theme.onChange( function () {
-
-		switch ( this.value ) {
-
-			case '0': themeLink.href = 'css/light.css'; break;
-			case '1': themeLink.href = 'css/dark.css'; break;
-
-		}
-
-	} );
-
-	themeRow.add( new UI.Text('Theme').setWidth('90px') );
-	themeRow.add( theme );
-
-	container.add( themeRow );
+	}
 
 
 	//
 	//
 
 
 	function updateRenderer() {
 	function updateRenderer() {
 
 
-		var renderer = new rendererTypes[ rendererType.getValue() ]( {
-			antialias: true
-		} );
-		signals.rendererChanged.dispatch( renderer );
+		signals.rendererChanged.dispatch( rendererType.getValue() );
+		editor.config.setKey( 'renderer', rendererType.getValue() );
 
 
 	}
 	}
 
 

+ 9 - 4
editor/js/Sidebar.Scene.js

@@ -121,26 +121,31 @@ Sidebar.Scene = function ( editor ) {
 	signals.sceneGraphChanged.add( function () {
 	signals.sceneGraphChanged.add( function () {
 
 
 		var scene = editor.scene;
 		var scene = editor.scene;
+		var sceneType = editor.getObjectType( scene );
 
 
 		var options = {};
 		var options = {};
 
 
-		options[ scene.id ] = '<span class="type">' + editor.getObjectType( scene ).replace( /[a-z]/g, '' ) + '</span> ' + scene.name;
+		options[ scene.id ] = '<span class="type ' + sceneType + '"></span> ' + scene.name;
 
 
 		( function addObjects( objects, pad ) {
 		( function addObjects( objects, pad ) {
 
 
 			for ( var i = 0, l = objects.length; i < l; i ++ ) {
 			for ( var i = 0, l = objects.length; i < l; i ++ ) {
 
 
 				var object = objects[ i ];
 				var object = objects[ i ];
+				var objectType = editor.getObjectType( object );
 
 
-				var option = pad + '<span class="type">' + editor.getObjectType( object ).replace( /[a-z]/g, '' ) + '</span> ' + object.name;
+				var option = pad + '<span class="type ' + objectType + '"></span> ' + object.name;
 
 
 				if ( object instanceof THREE.Mesh ) {
 				if ( object instanceof THREE.Mesh ) {
 
 
 					var geometry = object.geometry;
 					var geometry = object.geometry;
 					var material = object.material;
 					var material = object.material;
 
 
-					option += ' — <span class="type">' + editor.getGeometryType( geometry ).replace( /[a-z]/g, '' ) + '</span> ' + geometry.name + ', ';
-					option += ' <span class="type">' + editor.getMaterialType( material ).replace( /[a-z]/g, '' ) + '</span> ' + material.name;
+					var geometryType = editor.getGeometryType( geometry );
+					var materialType = editor.getMaterialType( material );
+
+					option += ' <span class="type ' + geometryType + '"></span> ' + geometry.name;
+					option += ' <span class="type ' + materialType + '"></span> ' + material.name;
 
 
 				}
 				}
 
 

+ 83 - 0
editor/js/Storage.js

@@ -0,0 +1,83 @@
+var Storage = function () {
+
+	var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
+
+	var name = 'threejs-editor';
+	var version = 1;
+
+	var database;
+
+	return {
+
+		init: function ( callback ) {
+
+			var request = indexedDB.open( name, version );
+			request.onupgradeneeded = function ( event ) {
+
+				var db = event.target.result;
+
+				if ( db.objectStoreNames.contains( 'states' ) === false ) {
+
+					db.createObjectStore( 'states' );
+
+				}
+
+			};
+			request.onsuccess = function ( event ) {
+
+				database = event.target.result;
+
+				callback();
+
+			};
+			request.onerror = function ( event ) {
+
+				console.error( 'IndexedDB', event );
+
+			};
+			
+
+		},
+
+		get: function ( callback ) {
+
+			var transaction = database.transaction( [ 'states' ], 'readwrite' );
+			var objectStore = transaction.objectStore( 'states' );
+			var request = objectStore.get( 0 );
+			request.onsuccess = function ( event ) {
+
+				callback( event.target.result );
+
+			};
+
+		},
+
+		set: function ( data, callback ) {
+
+			var transaction = database.transaction( [ 'states' ], 'readwrite' );
+			var objectStore = transaction.objectStore( 'states' );
+			var request = objectStore.put( data, 0 );
+			request.onsuccess = function ( event ) {
+
+				console.log( '[' + /\d\d\:\d\d\:\d\d/.exec( new Date() )[ 0 ] + ']', 'Saved state to IndexedDB.' );
+
+			};
+
+		},
+
+		clear: function ( callback ) {
+
+			var transaction = database.transaction( [ 'states' ], 'readwrite' );
+			var objectStore = transaction.objectStore( 'states' );
+			var request = objectStore.clear();
+			request.onsuccess = function ( event ) {
+
+				callback();
+			
+			};
+
+		}
+
+	}
+
+};

+ 48 - 12
editor/js/Viewport.js

@@ -27,8 +27,8 @@ var Viewport = function ( editor ) {
 	//
 	//
 
 
 	var camera = new THREE.PerspectiveCamera( 50, container.dom.offsetWidth / container.dom.offsetHeight, 1, 5000 );
 	var camera = new THREE.PerspectiveCamera( 50, container.dom.offsetWidth / container.dom.offsetHeight, 1, 5000 );
-	camera.position.set( 500, 250, 500 );
-	camera.lookAt( scene.position );
+	camera.position.fromArray( editor.config.getKey( 'camera' ).position );
+	camera.lookAt( new THREE.Vector3().fromArray( editor.config.getKey( 'camera' ).target ) );
 
 
 	//
 	//
 
 
@@ -76,8 +76,8 @@ var Viewport = function ( editor ) {
 	var getIntersects = function ( event, object ) {
 	var getIntersects = function ( event, object ) {
 
 
 		var rect = container.dom.getBoundingClientRect();
 		var rect = container.dom.getBoundingClientRect();
-		x = (event.clientX - rect.left) / rect.width;
-		y = (event.clientY - rect.top) / rect.height;
+		x = ( event.clientX - rect.left ) / rect.width;
+		y = ( event.clientY - rect.top ) / rect.height;
 		var vector = new THREE.Vector3( ( x ) * 2 - 1, - ( y ) * 2 + 1, 0.5 );
 		var vector = new THREE.Vector3( ( x ) * 2 - 1, - ( y ) * 2 + 1, 0.5 );
 
 
 		projector.unprojectVector( vector, camera );
 		projector.unprojectVector( vector, camera );
@@ -139,7 +139,7 @@ var Viewport = function ( editor ) {
 
 
 			} else {
 			} else {
 
 
-				editor.select( camera );
+				editor.select( null );
 
 
 			}
 			}
 
 
@@ -170,6 +170,7 @@ var Viewport = function ( editor ) {
 	// otherwise controls.enabled doesn't work.
 	// otherwise controls.enabled doesn't work.
 
 
 	var controls = new THREE.EditorControls( camera, container.dom );
 	var controls = new THREE.EditorControls( camera, container.dom );
+	controls.center.fromArray( editor.config.getKey( 'camera' ).target )
 	controls.addEventListener( 'change', function () {
 	controls.addEventListener( 'change', function () {
 
 
 		transformControls.update();
 		transformControls.update();
@@ -179,6 +180,27 @@ var Viewport = function ( editor ) {
 
 
 	// signals
 	// signals
 
 
+	signals.themeChanged.add( function ( value ) {
+
+		switch ( value ) {
+
+			case 'css/light.css':
+				grid.setColors( 0x444444, 0x888888 );
+				clearColor = 0xaaaaaa;
+				break;
+			case 'css/dark.css':
+				grid.setColors( 0xbbbbbb, 0x888888 );
+				clearColor = 0x333333;
+				break;
+
+		}
+		
+		renderer.setClearColor( clearColor );
+
+		render();
+
+	} );
+
 	signals.transformModeChanged.add( function ( mode ) {
 	signals.transformModeChanged.add( function ( mode ) {
 
 
 		transformControls.setMode( mode );
 		transformControls.setMode( mode );
@@ -197,13 +219,14 @@ var Viewport = function ( editor ) {
 
 
 	} );
 	} );
 
 
-	signals.rendererChanged.add( function ( object ) {
+	signals.rendererChanged.add( function ( type ) {
 
 
 		container.dom.removeChild( renderer.domElement );
 		container.dom.removeChild( renderer.domElement );
 
 
-		renderer = object;
+		renderer = new THREE[ type ]( { antialias: true } );
 		renderer.autoClear = false;
 		renderer.autoClear = false;
 		renderer.autoUpdateScene = false;
 		renderer.autoUpdateScene = false;
+		renderer.setClearColor( clearColor );
 		renderer.setSize( container.dom.offsetWidth, container.dom.offsetHeight );
 		renderer.setSize( container.dom.offsetWidth, container.dom.offsetHeight );
 
 
 		container.dom.appendChild( renderer.domElement );
 		container.dom.appendChild( renderer.domElement );
@@ -221,6 +244,11 @@ var Viewport = function ( editor ) {
 
 
 	signals.cameraChanged.add( function () {
 	signals.cameraChanged.add( function () {
 
 
+		editor.config.setKey( 'camera', {
+			position: camera.position.toArray(),
+			target: controls.center.toArray()
+		} );
+
 		render();
 		render();
 
 
 	} );
 	} );
@@ -409,15 +437,23 @@ var Viewport = function ( editor ) {
 
 
 	//
 	//
 
 
-	var renderer;
+	var clearColor, renderer;
 
 
-	if ( System.support.webgl === true ) {
+	if ( editor.config.getKey( 'renderer' ) !== undefined ) {
 
 
-		renderer = new THREE.WebGLRenderer( { antialias: true } );
+		renderer = new THREE[ editor.config.getKey( 'renderer' ) ]( { antialias: true } );
 
 
 	} else {
 	} else {
 
 
-		renderer = new THREE.CanvasRenderer();
+		if ( System.support.webgl === true ) {
+
+			renderer = new THREE.WebGLRenderer( { antialias: true } );
+
+		} else {
+
+			renderer = new THREE.CanvasRenderer();
+
+		}
 
 
 	}
 	}
 
 
@@ -458,7 +494,7 @@ var Viewport = function ( editor ) {
 
 
 					} else {
 					} else {
 
 
-						faces += vertices / 3;
+						faces += geometry.attributes.position.array.length / 9;
 
 
 					}
 					}
 
 

+ 0 - 1671
editor/js/libs/rawdeflate.js

@@ -1,1671 +0,0 @@
-/*
- * $Id: rawdeflate.js,v 0.3 2009/03/01 19:05:05 dankogai Exp dankogai $
- *
- * Original:
- *   http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt
- */
-
-(function(){
-
-/* Copyright (C) 1999 Masanao Izumo <[email protected]>
- * Version: 1.0.1
- * LastModified: Dec 25 1999
- */
-
-/* Interface:
- * data = zip_deflate(src);
- */
-
-/* constant parameters */
-var zip_WSIZE = 32768;		// Sliding Window size
-var zip_STORED_BLOCK = 0;
-var zip_STATIC_TREES = 1;
-var zip_DYN_TREES    = 2;
-
-/* for deflate */
-var zip_DEFAULT_LEVEL = 6;
-var zip_FULL_SEARCH = true;
-var zip_INBUFSIZ = 32768;	// Input buffer size
-var zip_INBUF_EXTRA = 64;	// Extra buffer
-var zip_OUTBUFSIZ = 1024 * 8;
-var zip_window_size = 2 * zip_WSIZE;
-var zip_MIN_MATCH = 3;
-var zip_MAX_MATCH = 258;
-var zip_BITS = 16;
-// for SMALL_MEM
-var zip_LIT_BUFSIZE = 0x2000;
-var zip_HASH_BITS = 13;
-// for MEDIUM_MEM
-// var zip_LIT_BUFSIZE = 0x4000;
-// var zip_HASH_BITS = 14;
-// for BIG_MEM
-// var zip_LIT_BUFSIZE = 0x8000;
-// var zip_HASH_BITS = 15;
-if(zip_LIT_BUFSIZE > zip_INBUFSIZ)
-    alert("error: zip_INBUFSIZ is too small");
-if((zip_WSIZE<<1) > (1<<zip_BITS))
-    alert("error: zip_WSIZE is too large");
-if(zip_HASH_BITS > zip_BITS-1)
-    alert("error: zip_HASH_BITS is too large");
-if(zip_HASH_BITS < 8 || zip_MAX_MATCH != 258)
-    alert("error: Code too clever");
-var zip_DIST_BUFSIZE = zip_LIT_BUFSIZE;
-var zip_HASH_SIZE = 1 << zip_HASH_BITS;
-var zip_HASH_MASK = zip_HASH_SIZE - 1;
-var zip_WMASK = zip_WSIZE - 1;
-var zip_NIL = 0; // Tail of hash chains
-var zip_TOO_FAR = 4096;
-var zip_MIN_LOOKAHEAD = zip_MAX_MATCH + zip_MIN_MATCH + 1;
-var zip_MAX_DIST = zip_WSIZE - zip_MIN_LOOKAHEAD;
-var zip_SMALLEST = 1;
-var zip_MAX_BITS = 15;
-var zip_MAX_BL_BITS = 7;
-var zip_LENGTH_CODES = 29;
-var zip_LITERALS =256;
-var zip_END_BLOCK = 256;
-var zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES;
-var zip_D_CODES = 30;
-var zip_BL_CODES = 19;
-var zip_REP_3_6 = 16;
-var zip_REPZ_3_10 = 17;
-var zip_REPZ_11_138 = 18;
-var zip_HEAP_SIZE = 2 * zip_L_CODES + 1;
-var zip_H_SHIFT = parseInt((zip_HASH_BITS + zip_MIN_MATCH - 1) /
-			   zip_MIN_MATCH);
-
-/* variables */
-var zip_free_queue;
-var zip_qhead, zip_qtail;
-var zip_initflag;
-var zip_outbuf = null;
-var zip_outcnt, zip_outoff;
-var zip_complete;
-var zip_window;
-var zip_d_buf;
-var zip_l_buf;
-var zip_prev;
-var zip_bi_buf;
-var zip_bi_valid;
-var zip_block_start;
-var zip_ins_h;
-var zip_hash_head;
-var zip_prev_match;
-var zip_match_available;
-var zip_match_length;
-var zip_prev_length;
-var zip_strstart;
-var zip_match_start;
-var zip_eofile;
-var zip_lookahead;
-var zip_max_chain_length;
-var zip_max_lazy_match;
-var zip_compr_level;
-var zip_good_match;
-var zip_nice_match;
-var zip_dyn_ltree;
-var zip_dyn_dtree;
-var zip_static_ltree;
-var zip_static_dtree;
-var zip_bl_tree;
-var zip_l_desc;
-var zip_d_desc;
-var zip_bl_desc;
-var zip_bl_count;
-var zip_heap;
-var zip_heap_len;
-var zip_heap_max;
-var zip_depth;
-var zip_length_code;
-var zip_dist_code;
-var zip_base_length;
-var zip_base_dist;
-var zip_flag_buf;
-var zip_last_lit;
-var zip_last_dist;
-var zip_last_flags;
-var zip_flags;
-var zip_flag_bit;
-var zip_opt_len;
-var zip_static_len;
-var zip_deflate_data;
-var zip_deflate_pos;
-
-/* objects (deflate) */
-
-var zip_DeflateCT = function() {
-    this.fc = 0; // frequency count or bit string
-    this.dl = 0; // father node in Huffman tree or length of bit string
-}
-
-var zip_DeflateTreeDesc = function() {
-    this.dyn_tree = null;	// the dynamic tree
-    this.static_tree = null;	// corresponding static tree or NULL
-    this.extra_bits = null;	// extra bits for each code or NULL
-    this.extra_base = 0;	// base index for extra_bits
-    this.elems = 0;		// max number of elements in the tree
-    this.max_length = 0;	// max bit length for the codes
-    this.max_code = 0;		// largest code with non zero frequency
-}
-
-/* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
-var zip_DeflateConfiguration = function(a, b, c, d) {
-    this.good_length = a; // reduce lazy search above this match length
-    this.max_lazy = b;    // do not perform lazy search above this match length
-    this.nice_length = c; // quit search above this match length
-    this.max_chain = d;
-}
-
-var zip_DeflateBuffer = function() {
-    this.next = null;
-    this.len = 0;
-    this.ptr = new Array(zip_OUTBUFSIZ);
-    this.off = 0;
-}
-
-/* constant tables */
-var zip_extra_lbits = new Array(
-    0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0);
-var zip_extra_dbits = new Array(
-    0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13);
-var zip_extra_blbits = new Array(
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7);
-var zip_bl_order = new Array(
-    16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15);
-var zip_configuration_table = new Array(
-	new zip_DeflateConfiguration(0,    0,   0,    0),
-	new zip_DeflateConfiguration(4,    4,   8,    4),
-	new zip_DeflateConfiguration(4,    5,  16,    8),
-	new zip_DeflateConfiguration(4,    6,  32,   32),
-	new zip_DeflateConfiguration(4,    4,  16,   16),
-	new zip_DeflateConfiguration(8,   16,  32,   32),
-	new zip_DeflateConfiguration(8,   16, 128,  128),
-	new zip_DeflateConfiguration(8,   32, 128,  256),
-	new zip_DeflateConfiguration(32, 128, 258, 1024),
-	new zip_DeflateConfiguration(32, 258, 258, 4096));
-
-
-/* routines (deflate) */
-
-var zip_deflate_start = function(level) {
-    var i;
-
-    if(!level)
-	level = zip_DEFAULT_LEVEL;
-    else if(level < 1)
-	level = 1;
-    else if(level > 9)
-	level = 9;
-
-    zip_compr_level = level;
-    zip_initflag = false;
-    zip_eofile = false;
-    if(zip_outbuf != null)
-	return;
-
-    zip_free_queue = zip_qhead = zip_qtail = null;
-    zip_outbuf = new Array(zip_OUTBUFSIZ);
-    zip_window = new Array(zip_window_size);
-    zip_d_buf = new Array(zip_DIST_BUFSIZE);
-    zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA);
-    zip_prev = new Array(1 << zip_BITS);
-    zip_dyn_ltree = new Array(zip_HEAP_SIZE);
-    for(i = 0; i < zip_HEAP_SIZE; i++)
-	zip_dyn_ltree[i] = new zip_DeflateCT();
-    zip_dyn_dtree = new Array(2*zip_D_CODES+1);
-    for(i = 0; i < 2*zip_D_CODES+1; i++)
-	zip_dyn_dtree[i] = new zip_DeflateCT();
-    zip_static_ltree = new Array(zip_L_CODES+2);
-    for(i = 0; i < zip_L_CODES+2; i++)
-	zip_static_ltree[i] = new zip_DeflateCT();
-    zip_static_dtree = new Array(zip_D_CODES);
-    for(i = 0; i < zip_D_CODES; i++)
-	zip_static_dtree[i] = new zip_DeflateCT();
-    zip_bl_tree = new Array(2*zip_BL_CODES+1);
-    for(i = 0; i < 2*zip_BL_CODES+1; i++)
-	zip_bl_tree[i] = new zip_DeflateCT();
-    zip_l_desc = new zip_DeflateTreeDesc();
-    zip_d_desc = new zip_DeflateTreeDesc();
-    zip_bl_desc = new zip_DeflateTreeDesc();
-    zip_bl_count = new Array(zip_MAX_BITS+1);
-    zip_heap = new Array(2*zip_L_CODES+1);
-    zip_depth = new Array(2*zip_L_CODES+1);
-    zip_length_code = new Array(zip_MAX_MATCH-zip_MIN_MATCH+1);
-    zip_dist_code = new Array(512);
-    zip_base_length = new Array(zip_LENGTH_CODES);
-    zip_base_dist = new Array(zip_D_CODES);
-    zip_flag_buf = new Array(parseInt(zip_LIT_BUFSIZE / 8));
-}
-
-var zip_deflate_end = function() {
-    zip_free_queue = zip_qhead = zip_qtail = null;
-    zip_outbuf = null;
-    zip_window = null;
-    zip_d_buf = null;
-    zip_l_buf = null;
-    zip_prev = null;
-    zip_dyn_ltree = null;
-    zip_dyn_dtree = null;
-    zip_static_ltree = null;
-    zip_static_dtree = null;
-    zip_bl_tree = null;
-    zip_l_desc = null;
-    zip_d_desc = null;
-    zip_bl_desc = null;
-    zip_bl_count = null;
-    zip_heap = null;
-    zip_depth = null;
-    zip_length_code = null;
-    zip_dist_code = null;
-    zip_base_length = null;
-    zip_base_dist = null;
-    zip_flag_buf = null;
-}
-
-var zip_reuse_queue = function(p) {
-    p.next = zip_free_queue;
-    zip_free_queue = p;
-}
-
-var zip_new_queue = function() {
-    var p;
-
-    if(zip_free_queue != null)
-    {
-	p = zip_free_queue;
-	zip_free_queue = zip_free_queue.next;
-    }
-    else
-	p = new zip_DeflateBuffer();
-    p.next = null;
-    p.len = p.off = 0;
-
-    return p;
-}
-
-var zip_head1 = function(i) {
-    return zip_prev[zip_WSIZE + i];
-}
-
-var zip_head2 = function(i, val) {
-    return zip_prev[zip_WSIZE + i] = val;
-}
-
-/* put_byte is used for the compressed output, put_ubyte for the
- * uncompressed output. However unlzw() uses window for its
- * suffix table instead of its output buffer, so it does not use put_ubyte
- * (to be cleaned up).
- */
-var zip_put_byte = function(c) {
-    zip_outbuf[zip_outoff + zip_outcnt++] = c;
-    if(zip_outoff + zip_outcnt == zip_OUTBUFSIZ)
-	zip_qoutbuf();
-}
-
-/* Output a 16 bit value, lsb first */
-var zip_put_short = function(w) {
-    w &= 0xffff;
-    if(zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) {
-	zip_outbuf[zip_outoff + zip_outcnt++] = (w & 0xff);
-	zip_outbuf[zip_outoff + zip_outcnt++] = (w >>> 8);
-    } else {
-	zip_put_byte(w & 0xff);
-	zip_put_byte(w >>> 8);
-    }
-}
-
-/* ==========================================================================
- * Insert string s in the dictionary and set match_head to the previous head
- * of the hash chain (the most recent string with same hash key). Return
- * the previous length of the hash chain.
- * IN  assertion: all calls to to INSERT_STRING are made with consecutive
- *    input characters and the first MIN_MATCH bytes of s are valid
- *    (except for the last MIN_MATCH-1 bytes of the input file).
- */
-var zip_INSERT_STRING = function() {
-    zip_ins_h = ((zip_ins_h << zip_H_SHIFT)
-		 ^ (zip_window[zip_strstart + zip_MIN_MATCH - 1] & 0xff))
-	& zip_HASH_MASK;
-    zip_hash_head = zip_head1(zip_ins_h);
-    zip_prev[zip_strstart & zip_WMASK] = zip_hash_head;
-    zip_head2(zip_ins_h, zip_strstart);
-}
-
-/* Send a code of the given tree. c and tree must not have side effects */
-var zip_SEND_CODE = function(c, tree) {
-    zip_send_bits(tree[c].fc, tree[c].dl);
-}
-
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. dist_code[256] and dist_code[257] are never
- * used.
- */
-var zip_D_CODE = function(dist) {
-    return (dist < 256 ? zip_dist_code[dist]
-	    : zip_dist_code[256 + (dist>>7)]) & 0xff;
-}
-
-/* ==========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
-var zip_SMALLER = function(tree, n, m) {
-    return tree[n].fc < tree[m].fc ||
-      (tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]);
-}
-
-/* ==========================================================================
- * read string data
- */
-var zip_read_buff = function(buff, offset, n) {
-    var i;
-    for(i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++)
-	buff[offset + i] =
-	    zip_deflate_data.charCodeAt(zip_deflate_pos++) & 0xff;
-    return i;
-}
-
-/* ==========================================================================
- * Initialize the "longest match" routines for a new file
- */
-var zip_lm_init = function() {
-    var j;
-
-    /* Initialize the hash table. */
-    for(j = 0; j < zip_HASH_SIZE; j++)
-//	zip_head2(j, zip_NIL);
-	zip_prev[zip_WSIZE + j] = 0;
-    /* prev will be initialized on the fly */
-
-    /* Set the default configuration parameters:
-     */
-    zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy;
-    zip_good_match     = zip_configuration_table[zip_compr_level].good_length;
-    if(!zip_FULL_SEARCH)
-	zip_nice_match = zip_configuration_table[zip_compr_level].nice_length;
-    zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain;
-
-    zip_strstart = 0;
-    zip_block_start = 0;
-
-    zip_lookahead = zip_read_buff(zip_window, 0, 2 * zip_WSIZE);
-    if(zip_lookahead <= 0) {
-	zip_eofile = true;
-	zip_lookahead = 0;
-	return;
-    }
-    zip_eofile = false;
-    /* Make sure that we always have enough lookahead. This is important
-     * if input comes from a device such as a tty.
-     */
-    while(zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile)
-	zip_fill_window();
-
-    /* If lookahead < MIN_MATCH, ins_h is garbage, but this is
-     * not important since only literal bytes will be emitted.
-     */
-    zip_ins_h = 0;
-    for(j = 0; j < zip_MIN_MATCH - 1; j++) {
-//      UPDATE_HASH(ins_h, window[j]);
-	zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[j] & 0xff)) & zip_HASH_MASK;
-    }
-}
-
-/* ==========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- */
-var zip_longest_match = function(cur_match) {
-    var chain_length = zip_max_chain_length; // max hash chain length
-    var scanp = zip_strstart; // current string
-    var matchp;		// matched string
-    var len;		// length of current match
-    var best_len = zip_prev_length;	// best match length so far
-
-    /* Stop when cur_match becomes <= limit. To simplify the code,
-     * we prevent matches with the string of window index 0.
-     */
-    var limit = (zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL);
-
-    var strendp = zip_strstart + zip_MAX_MATCH;
-    var scan_end1 = zip_window[scanp + best_len - 1];
-    var scan_end  = zip_window[scanp + best_len];
-
-    /* Do not waste too much time if we already have a good match: */
-    if(zip_prev_length >= zip_good_match)
-	chain_length >>= 2;
-
-//  Assert(encoder->strstart <= window_size-MIN_LOOKAHEAD, "insufficient lookahead");
-
-    do {
-//    Assert(cur_match < encoder->strstart, "no future");
-	matchp = cur_match;
-
-	/* Skip to next match if the match length cannot increase
-	    * or if the match length is less than 2:
-	*/
-	if(zip_window[matchp + best_len]	!= scan_end  ||
-	   zip_window[matchp + best_len - 1]	!= scan_end1 ||
-	   zip_window[matchp]			!= zip_window[scanp] ||
-	   zip_window[++matchp]			!= zip_window[scanp + 1]) {
-	    continue;
-	}
-
-	/* The check at best_len-1 can be removed because it will be made
-         * again later. (This heuristic is not always a win.)
-         * It is not necessary to compare scan[2] and match[2] since they
-         * are always equal when the other bytes match, given that
-         * the hash keys are equal and that HASH_BITS >= 8.
-         */
-	scanp += 2;
-	matchp++;
-
-	/* We check for insufficient lookahead only every 8th comparison;
-         * the 256th check will be made at strstart+258.
-         */
-	do {
-	} while(zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		zip_window[++scanp] == zip_window[++matchp] &&
-		scanp < strendp);
-
-      len = zip_MAX_MATCH - (strendp - scanp);
-      scanp = strendp - zip_MAX_MATCH;
-
-      if(len > best_len) {
-	  zip_match_start = cur_match;
-	  best_len = len;
-	  if(zip_FULL_SEARCH) {
-	      if(len >= zip_MAX_MATCH) break;
-	  } else {
-	      if(len >= zip_nice_match) break;
-	  }
-
-	  scan_end1  = zip_window[scanp + best_len-1];
-	  scan_end   = zip_window[scanp + best_len];
-      }
-    } while((cur_match = zip_prev[cur_match & zip_WMASK]) > limit
-	    && --chain_length != 0);
-
-    return best_len;
-}
-
-/* ==========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead, and sets eofile if end of input file.
- * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0
- * OUT assertions: at least one byte has been read, or eofile is set;
- *    file reads are performed for at least two bytes (required for the
- *    translate_eol option).
- */
-var zip_fill_window = function() {
-    var n, m;
-
-    // Amount of free space at the end of the window.
-    var more = zip_window_size - zip_lookahead - zip_strstart;
-
-    /* If the window is almost full and there is insufficient lookahead,
-     * move the upper half to the lower one to make room in the upper half.
-     */
-    if(more == -1) {
-	/* Very unlikely, but possible on 16 bit machine if strstart == 0
-         * and lookahead == 1 (input done one byte at time)
-         */
-	more--;
-    } else if(zip_strstart >= zip_WSIZE + zip_MAX_DIST) {
-	/* By the IN assertion, the window is not empty so we can't confuse
-         * more == 0 with more == 64K on a 16 bit machine.
-         */
-//	Assert(window_size == (ulg)2*WSIZE, "no sliding with BIG_MEM");
-
-//	System.arraycopy(window, WSIZE, window, 0, WSIZE);
-	for(n = 0; n < zip_WSIZE; n++)
-	    zip_window[n] = zip_window[n + zip_WSIZE];
-      
-	zip_match_start -= zip_WSIZE;
-	zip_strstart    -= zip_WSIZE; /* we now have strstart >= MAX_DIST: */
-	zip_block_start -= zip_WSIZE;
-
-	for(n = 0; n < zip_HASH_SIZE; n++) {
-	    m = zip_head1(n);
-	    zip_head2(n, m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL);
-	}
-	for(n = 0; n < zip_WSIZE; n++) {
-	    /* If n is not on any hash chain, prev[n] is garbage but
-	     * its value will never be used.
-	     */
-	    m = zip_prev[n];
-	    zip_prev[n] = (m >= zip_WSIZE ? m - zip_WSIZE : zip_NIL);
-	}
-	more += zip_WSIZE;
-    }
-    // At this point, more >= 2
-    if(!zip_eofile) {
-	n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more);
-	if(n <= 0)
-	    zip_eofile = true;
-	else
-	    zip_lookahead += n;
-    }
-}
-
-/* ==========================================================================
- * Processes a new input file and return its compressed length. This
- * function does not perform lazy evaluationof matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
-var zip_deflate_fast = function() {
-    while(zip_lookahead != 0 && zip_qhead == null) {
-	var flush; // set if current block must be flushed
-
-	/* Insert the string window[strstart .. strstart+2] in the
-	 * dictionary, and set hash_head to the head of the hash chain:
-	 */
-	zip_INSERT_STRING();
-
-	/* Find the longest match, discarding those <= prev_length.
-	 * At this point we have always match_length < MIN_MATCH
-	 */
-	if(zip_hash_head != zip_NIL &&
-	   zip_strstart - zip_hash_head <= zip_MAX_DIST) {
-	    /* To simplify the code, we prevent matches with the string
-	     * of window index 0 (in particular we have to avoid a match
-	     * of the string with itself at the start of the input file).
-	     */
-	    zip_match_length = zip_longest_match(zip_hash_head);
-	    /* longest_match() sets match_start */
-	    if(zip_match_length > zip_lookahead)
-		zip_match_length = zip_lookahead;
-	}
-	if(zip_match_length >= zip_MIN_MATCH) {
-//	    check_match(strstart, match_start, match_length);
-
-	    flush = zip_ct_tally(zip_strstart - zip_match_start,
-				 zip_match_length - zip_MIN_MATCH);
-	    zip_lookahead -= zip_match_length;
-
-	    /* Insert new strings in the hash table only if the match length
-	     * is not too large. This saves time but degrades compression.
-	     */
-	    if(zip_match_length <= zip_max_lazy_match) {
-		zip_match_length--; // string at strstart already in hash table
-		do {
-		    zip_strstart++;
-		    zip_INSERT_STRING();
-		    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
-		     * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH
-		     * these bytes are garbage, but it does not matter since
-		     * the next lookahead bytes will be emitted as literals.
-		     */
-		} while(--zip_match_length != 0);
-		zip_strstart++;
-	    } else {
-		zip_strstart += zip_match_length;
-		zip_match_length = 0;
-		zip_ins_h = zip_window[zip_strstart] & 0xff;
-//		UPDATE_HASH(ins_h, window[strstart + 1]);
-		zip_ins_h = ((zip_ins_h<<zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK;
-
-//#if MIN_MATCH != 3
-//		Call UPDATE_HASH() MIN_MATCH-3 more times
-//#endif
-
-	    }
-	} else {
-	    /* No match, output a literal byte */
-	    flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff);
-	    zip_lookahead--;
-	    zip_strstart++;
-	}
-	if(flush) {
-	    zip_flush_block(0);
-	    zip_block_start = zip_strstart;
-	}
-
-	/* Make sure that we always have enough lookahead, except
-	 * at the end of the input file. We need MAX_MATCH bytes
-	 * for the next match, plus MIN_MATCH bytes to insert the
-	 * string following the next match.
-	 */
-	while(zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile)
-	    zip_fill_window();
-    }
-}
-
-var zip_deflate_better = function() {
-    /* Process the input block. */
-    while(zip_lookahead != 0 && zip_qhead == null) {
-	/* Insert the string window[strstart .. strstart+2] in the
-	 * dictionary, and set hash_head to the head of the hash chain:
-	 */
-	zip_INSERT_STRING();
-
-	/* Find the longest match, discarding those <= prev_length.
-	 */
-	zip_prev_length = zip_match_length;
-	zip_prev_match = zip_match_start;
-	zip_match_length = zip_MIN_MATCH - 1;
-
-	if(zip_hash_head != zip_NIL &&
-	   zip_prev_length < zip_max_lazy_match &&
-	   zip_strstart - zip_hash_head <= zip_MAX_DIST) {
-	    /* To simplify the code, we prevent matches with the string
-	     * of window index 0 (in particular we have to avoid a match
-	     * of the string with itself at the start of the input file).
-	     */
-	    zip_match_length = zip_longest_match(zip_hash_head);
-	    /* longest_match() sets match_start */
-	    if(zip_match_length > zip_lookahead)
-		zip_match_length = zip_lookahead;
-
-	    /* Ignore a length 3 match if it is too distant: */
-	    if(zip_match_length == zip_MIN_MATCH &&
-	       zip_strstart - zip_match_start > zip_TOO_FAR) {
-		/* If prev_match is also MIN_MATCH, match_start is garbage
-		 * but we will ignore the current match anyway.
-		 */
-		zip_match_length--;
-	    }
-	}
-	/* If there was a match at the previous step and the current
-	 * match is not better, output the previous match:
-	 */
-	if(zip_prev_length >= zip_MIN_MATCH &&
-	   zip_match_length <= zip_prev_length) {
-	    var flush; // set if current block must be flushed
-
-//	    check_match(strstart - 1, prev_match, prev_length);
-	    flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match,
-				 zip_prev_length - zip_MIN_MATCH);
-
-	    /* Insert in hash table all strings up to the end of the match.
-	     * strstart-1 and strstart are already inserted.
-	     */
-	    zip_lookahead -= zip_prev_length - 1;
-	    zip_prev_length -= 2;
-	    do {
-		zip_strstart++;
-		zip_INSERT_STRING();
-		/* strstart never exceeds WSIZE-MAX_MATCH, so there are
-		 * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH
-		 * these bytes are garbage, but it does not matter since the
-		 * next lookahead bytes will always be emitted as literals.
-		 */
-	    } while(--zip_prev_length != 0);
-	    zip_match_available = 0;
-	    zip_match_length = zip_MIN_MATCH - 1;
-	    zip_strstart++;
-	    if(flush) {
-		zip_flush_block(0);
-		zip_block_start = zip_strstart;
-	    }
-	} else if(zip_match_available != 0) {
-	    /* If there was no match at the previous position, output a
-	     * single literal. If there was a match but the current match
-	     * is longer, truncate the previous match to a single literal.
-	     */
-	    if(zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) {
-		zip_flush_block(0);
-		zip_block_start = zip_strstart;
-	    }
-	    zip_strstart++;
-	    zip_lookahead--;
-	} else {
-	    /* There is no previous match to compare with, wait for
-	     * the next step to decide.
-	     */
-	    zip_match_available = 1;
-	    zip_strstart++;
-	    zip_lookahead--;
-	}
-
-	/* Make sure that we always have enough lookahead, except
-	 * at the end of the input file. We need MAX_MATCH bytes
-	 * for the next match, plus MIN_MATCH bytes to insert the
-	 * string following the next match.
-	 */
-	while(zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile)
-	    zip_fill_window();
-    }
-}
-
-var zip_init_deflate = function() {
-    if(zip_eofile)
-	return;
-    zip_bi_buf = 0;
-    zip_bi_valid = 0;
-    zip_ct_init();
-    zip_lm_init();
-
-    zip_qhead = null;
-    zip_outcnt = 0;
-    zip_outoff = 0;
-
-    if(zip_compr_level <= 3)
-    {
-	zip_prev_length = zip_MIN_MATCH - 1;
-	zip_match_length = 0;
-    }
-    else
-    {
-	zip_match_length = zip_MIN_MATCH - 1;
-	zip_match_available = 0;
-    }
-
-    zip_complete = false;
-}
-
-/* ==========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
-var zip_deflate_internal = function(buff, off, buff_size) {
-    var n;
-
-    if(!zip_initflag)
-    {
-	zip_init_deflate();
-	zip_initflag = true;
-	if(zip_lookahead == 0) { // empty
-	    zip_complete = true;
-	    return 0;
-	}
-    }
-
-    if((n = zip_qcopy(buff, off, buff_size)) == buff_size)
-	return buff_size;
-
-    if(zip_complete)
-	return n;
-
-    if(zip_compr_level <= 3) // optimized for speed
-	zip_deflate_fast();
-    else
-	zip_deflate_better();
-    if(zip_lookahead == 0) {
-	if(zip_match_available != 0)
-	    zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff);
-	zip_flush_block(1);
-	zip_complete = true;
-    }
-    return n + zip_qcopy(buff, n + off, buff_size - n);
-}
-
-var zip_qcopy = function(buff, off, buff_size) {
-    var n, i, j;
-
-    n = 0;
-    while(zip_qhead != null && n < buff_size)
-    {
-	i = buff_size - n;
-	if(i > zip_qhead.len)
-	    i = zip_qhead.len;
-//      System.arraycopy(qhead.ptr, qhead.off, buff, off + n, i);
-	for(j = 0; j < i; j++)
-	    buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j];
-	
-	zip_qhead.off += i;
-	zip_qhead.len -= i;
-	n += i;
-	if(zip_qhead.len == 0) {
-	    var p;
-	    p = zip_qhead;
-	    zip_qhead = zip_qhead.next;
-	    zip_reuse_queue(p);
-	}
-    }
-
-    if(n == buff_size)
-	return n;
-
-    if(zip_outoff < zip_outcnt) {
-	i = buff_size - n;
-	if(i > zip_outcnt - zip_outoff)
-	    i = zip_outcnt - zip_outoff;
-	// System.arraycopy(outbuf, outoff, buff, off + n, i);
-	for(j = 0; j < i; j++)
-	    buff[off + n + j] = zip_outbuf[zip_outoff + j];
-	zip_outoff += i;
-	n += i;
-	if(zip_outcnt == zip_outoff)
-	    zip_outcnt = zip_outoff = 0;
-    }
-    return n;
-}
-
-/* ==========================================================================
- * Allocate the match buffer, initialize the various tables and save the
- * location of the internal file attribute (ascii/binary) and method
- * (DEFLATE/STORE).
- */
-var zip_ct_init = function() {
-    var n;	// iterates over tree elements
-    var bits;	// bit counter
-    var length;	// length value
-    var code;	// code value
-    var dist;	// distance index
-
-    if(zip_static_dtree[0].dl != 0) return; // ct_init already called
-
-    zip_l_desc.dyn_tree		= zip_dyn_ltree;
-    zip_l_desc.static_tree	= zip_static_ltree;
-    zip_l_desc.extra_bits	= zip_extra_lbits;
-    zip_l_desc.extra_base	= zip_LITERALS + 1;
-    zip_l_desc.elems		= zip_L_CODES;
-    zip_l_desc.max_length	= zip_MAX_BITS;
-    zip_l_desc.max_code		= 0;
-
-    zip_d_desc.dyn_tree		= zip_dyn_dtree;
-    zip_d_desc.static_tree	= zip_static_dtree;
-    zip_d_desc.extra_bits	= zip_extra_dbits;
-    zip_d_desc.extra_base	= 0;
-    zip_d_desc.elems		= zip_D_CODES;
-    zip_d_desc.max_length	= zip_MAX_BITS;
-    zip_d_desc.max_code		= 0;
-
-    zip_bl_desc.dyn_tree	= zip_bl_tree;
-    zip_bl_desc.static_tree	= null;
-    zip_bl_desc.extra_bits	= zip_extra_blbits;
-    zip_bl_desc.extra_base	= 0;
-    zip_bl_desc.elems		= zip_BL_CODES;
-    zip_bl_desc.max_length	= zip_MAX_BL_BITS;
-    zip_bl_desc.max_code	= 0;
-
-    // Initialize the mapping length (0..255) -> length code (0..28)
-    length = 0;
-    for(code = 0; code < zip_LENGTH_CODES-1; code++) {
-	zip_base_length[code] = length;
-	for(n = 0; n < (1<<zip_extra_lbits[code]); n++)
-	    zip_length_code[length++] = code;
-    }
-    // Assert (length == 256, "ct_init: length != 256");
-
-    /* Note that the length 255 (match length 258) can be represented
-     * in two different ways: code 284 + 5 bits or code 285, so we
-     * overwrite length_code[255] to use the best encoding:
-     */
-    zip_length_code[length-1] = code;
-
-    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
-    dist = 0;
-    for(code = 0 ; code < 16; code++) {
-	zip_base_dist[code] = dist;
-	for(n = 0; n < (1<<zip_extra_dbits[code]); n++) {
-	    zip_dist_code[dist++] = code;
-	}
-    }
-    // Assert (dist == 256, "ct_init: dist != 256");
-    dist >>= 7; // from now on, all distances are divided by 128
-    for( ; code < zip_D_CODES; code++) {
-	zip_base_dist[code] = dist << 7;
-	for(n = 0; n < (1<<(zip_extra_dbits[code]-7)); n++)
-	    zip_dist_code[256 + dist++] = code;
-    }
-    // Assert (dist == 256, "ct_init: 256+dist != 512");
-
-    // Construct the codes of the static literal tree
-    for(bits = 0; bits <= zip_MAX_BITS; bits++)
-	zip_bl_count[bits] = 0;
-    n = 0;
-    while(n <= 143) { zip_static_ltree[n++].dl = 8; zip_bl_count[8]++; }
-    while(n <= 255) { zip_static_ltree[n++].dl = 9; zip_bl_count[9]++; }
-    while(n <= 279) { zip_static_ltree[n++].dl = 7; zip_bl_count[7]++; }
-    while(n <= 287) { zip_static_ltree[n++].dl = 8; zip_bl_count[8]++; }
-    /* Codes 286 and 287 do not exist, but we must include them in the
-     * tree construction to get a canonical Huffman tree (longest code
-     * all ones)
-     */
-    zip_gen_codes(zip_static_ltree, zip_L_CODES + 1);
-
-    /* The static distance tree is trivial: */
-    for(n = 0; n < zip_D_CODES; n++) {
-	zip_static_dtree[n].dl = 5;
-	zip_static_dtree[n].fc = zip_bi_reverse(n, 5);
-    }
-
-    // Initialize the first block of the first file:
-    zip_init_block();
-}
-
-/* ==========================================================================
- * Initialize a new block.
- */
-var zip_init_block = function() {
-    var n; // iterates over tree elements
-
-    // Initialize the trees.
-    for(n = 0; n < zip_L_CODES;  n++) zip_dyn_ltree[n].fc = 0;
-    for(n = 0; n < zip_D_CODES;  n++) zip_dyn_dtree[n].fc = 0;
-    for(n = 0; n < zip_BL_CODES; n++) zip_bl_tree[n].fc = 0;
-
-    zip_dyn_ltree[zip_END_BLOCK].fc = 1;
-    zip_opt_len = zip_static_len = 0;
-    zip_last_lit = zip_last_dist = zip_last_flags = 0;
-    zip_flags = 0;
-    zip_flag_bit = 1;
-}
-
-/* ==========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
-var zip_pqdownheap = function(
-    tree,	// the tree to restore
-    k) {	// node to move down
-    var v = zip_heap[k];
-    var j = k << 1;	// left son of k
-
-    while(j <= zip_heap_len) {
-	// Set j to the smallest of the two sons:
-	if(j < zip_heap_len &&
-	   zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j]))
-	    j++;
-
-	// Exit if v is smaller than both sons
-	if(zip_SMALLER(tree, v, zip_heap[j]))
-	    break;
-
-	// Exchange v with the smallest son
-	zip_heap[k] = zip_heap[j];
-	k = j;
-
-	// And continue down the tree, setting j to the left son of k
-	j <<= 1;
-    }
-    zip_heap[k] = v;
-}
-
-/* ==========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- *    above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- *     array bl_count contains the frequencies for each bit length.
- *     The length opt_len is updated; static_len is also updated if stree is
- *     not null.
- */
-var zip_gen_bitlen = function(desc) { // the tree descriptor
-    var tree		= desc.dyn_tree;
-    var extra		= desc.extra_bits;
-    var base		= desc.extra_base;
-    var max_code	= desc.max_code;
-    var max_length	= desc.max_length;
-    var stree		= desc.static_tree;
-    var h;		// heap index
-    var n, m;		// iterate over the tree elements
-    var bits;		// bit length
-    var xbits;		// extra bits
-    var f;		// frequency
-    var overflow = 0;	// number of elements with bit length too large
-
-    for(bits = 0; bits <= zip_MAX_BITS; bits++)
-	zip_bl_count[bits] = 0;
-
-    /* In a first pass, compute the optimal bit lengths (which may
-     * overflow in the case of the bit length tree).
-     */
-    tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap
-
-    for(h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) {
-	n = zip_heap[h];
-	bits = tree[tree[n].dl].dl + 1;
-	if(bits > max_length) {
-	    bits = max_length;
-	    overflow++;
-	}
-	tree[n].dl = bits;
-	// We overwrite tree[n].dl which is no longer needed
-
-	if(n > max_code)
-	    continue; // not a leaf node
-
-	zip_bl_count[bits]++;
-	xbits = 0;
-	if(n >= base)
-	    xbits = extra[n - base];
-	f = tree[n].fc;
-	zip_opt_len += f * (bits + xbits);
-	if(stree != null)
-	    zip_static_len += f * (stree[n].dl + xbits);
-    }
-    if(overflow == 0)
-	return;
-
-    // This happens for example on obj2 and pic of the Calgary corpus
-
-    // Find the first bit length which could increase:
-    do {
-	bits = max_length - 1;
-	while(zip_bl_count[bits] == 0)
-	    bits--;
-	zip_bl_count[bits]--;		// move one leaf down the tree
-	zip_bl_count[bits + 1] += 2;	// move one overflow item as its brother
-	zip_bl_count[max_length]--;
-	/* The brother of the overflow item also moves one step up,
-	 * but this does not affect bl_count[max_length]
-	 */
-	overflow -= 2;
-    } while(overflow > 0);
-
-    /* Now recompute all bit lengths, scanning in increasing frequency.
-     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
-     * lengths instead of fixing only the wrong ones. This idea is taken
-     * from 'ar' written by Haruhiko Okumura.)
-     */
-    for(bits = max_length; bits != 0; bits--) {
-	n = zip_bl_count[bits];
-	while(n != 0) {
-	    m = zip_heap[--h];
-	    if(m > max_code)
-		continue;
-	    if(tree[m].dl != bits) {
-		zip_opt_len += (bits - tree[m].dl) * tree[m].fc;
-		tree[m].fc = bits;
-	    }
-	    n--;
-	}
-    }
-}
-
-  /* ==========================================================================
-   * Generate the codes for a given tree and bit counts (which need not be
-   * optimal).
-   * IN assertion: the array bl_count contains the bit length statistics for
-   * the given tree and the field len is set for all tree elements.
-   * OUT assertion: the field code is set for all tree elements of non
-   *     zero code length.
-   */
-var zip_gen_codes = function(tree,	// the tree to decorate
-		   max_code) {	// largest code with non zero frequency
-    var next_code = new Array(zip_MAX_BITS+1); // next code value for each bit length
-    var code = 0;		// running code value
-    var bits;			// bit index
-    var n;			// code index
-
-    /* The distribution counts are first used to generate the code values
-     * without bit reversal.
-     */
-    for(bits = 1; bits <= zip_MAX_BITS; bits++) {
-	code = ((code + zip_bl_count[bits-1]) << 1);
-	next_code[bits] = code;
-    }
-
-    /* Check that the bit counts in bl_count are consistent. The last code
-     * must be all ones.
-     */
-//    Assert (code + encoder->bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
-//	    "inconsistent bit counts");
-//    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
-
-    for(n = 0; n <= max_code; n++) {
-	var len = tree[n].dl;
-	if(len == 0)
-	    continue;
-	// Now reverse the bits
-	tree[n].fc = zip_bi_reverse(next_code[len]++, len);
-
-//      Tracec(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
-//	  n, (isgraph(n) ? n : ' '), len, tree[n].fc, next_code[len]-1));
-    }
-}
-
-/* ==========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- *     and corresponding code. The length opt_len is updated; static_len is
- *     also updated if stree is not null. The field max_code is set.
- */
-var zip_build_tree = function(desc) { // the tree descriptor
-    var tree	= desc.dyn_tree;
-    var stree	= desc.static_tree;
-    var elems	= desc.elems;
-    var n, m;		// iterate over heap elements
-    var max_code = -1;	// largest code with non zero frequency
-    var node = elems;	// next internal node of the tree
-
-    /* Construct the initial heap, with least frequent element in
-     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
-     * heap[0] is not used.
-     */
-    zip_heap_len = 0;
-    zip_heap_max = zip_HEAP_SIZE;
-
-    for(n = 0; n < elems; n++) {
-	if(tree[n].fc != 0) {
-	    zip_heap[++zip_heap_len] = max_code = n;
-	    zip_depth[n] = 0;
-	} else
-	    tree[n].dl = 0;
-    }
-
-    /* The pkzip format requires that at least one distance code exists,
-     * and that at least one bit should be sent even if there is only one
-     * possible code. So to avoid special checks later on we force at least
-     * two codes of non zero frequency.
-     */
-    while(zip_heap_len < 2) {
-	var xnew = zip_heap[++zip_heap_len] = (max_code < 2 ? ++max_code : 0);
-	tree[xnew].fc = 1;
-	zip_depth[xnew] = 0;
-	zip_opt_len--;
-	if(stree != null)
-	    zip_static_len -= stree[xnew].dl;
-	// new is 0 or 1 so it does not have extra bits
-    }
-    desc.max_code = max_code;
-
-    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
-     * establish sub-heaps of increasing lengths:
-     */
-    for(n = zip_heap_len >> 1; n >= 1; n--)
-	zip_pqdownheap(tree, n);
-
-    /* Construct the Huffman tree by repeatedly combining the least two
-     * frequent nodes.
-     */
-    do {
-	n = zip_heap[zip_SMALLEST];
-	zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--];
-	zip_pqdownheap(tree, zip_SMALLEST);
-
-	m = zip_heap[zip_SMALLEST];  // m = node of next least frequency
-
-	// keep the nodes sorted by frequency
-	zip_heap[--zip_heap_max] = n;
-	zip_heap[--zip_heap_max] = m;
-
-	// Create a new node father of n and m
-	tree[node].fc = tree[n].fc + tree[m].fc;
-//	depth[node] = (char)(MAX(depth[n], depth[m]) + 1);
-	if(zip_depth[n] > zip_depth[m] + 1)
-	    zip_depth[node] = zip_depth[n];
-	else
-	    zip_depth[node] = zip_depth[m] + 1;
-	tree[n].dl = tree[m].dl = node;
-
-	// and insert the new node in the heap
-	zip_heap[zip_SMALLEST] = node++;
-	zip_pqdownheap(tree, zip_SMALLEST);
-
-    } while(zip_heap_len >= 2);
-
-    zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST];
-
-    /* At this point, the fields freq and dad are set. We can now
-     * generate the bit lengths.
-     */
-    zip_gen_bitlen(desc);
-
-    // The field len is now set, we can generate the bit codes
-    zip_gen_codes(tree, max_code);
-}
-
-/* ==========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree. Updates opt_len to take into account the repeat
- * counts. (The contribution of the bit length codes will be added later
- * during the construction of bl_tree.)
- */
-var zip_scan_tree = function(tree,// the tree to be scanned
-		       max_code) {  // and its largest code of non zero frequency
-    var n;			// iterates over all tree elements
-    var prevlen = -1;		// last emitted length
-    var curlen;			// length of current code
-    var nextlen = tree[0].dl;	// length of next code
-    var count = 0;		// repeat count of the current code
-    var max_count = 7;		// max repeat count
-    var min_count = 4;		// min repeat count
-
-    if(nextlen == 0) {
-	max_count = 138;
-	min_count = 3;
-    }
-    tree[max_code + 1].dl = 0xffff; // guard
-
-    for(n = 0; n <= max_code; n++) {
-	curlen = nextlen;
-	nextlen = tree[n + 1].dl;
-	if(++count < max_count && curlen == nextlen)
-	    continue;
-	else if(count < min_count)
-	    zip_bl_tree[curlen].fc += count;
-	else if(curlen != 0) {
-	    if(curlen != prevlen)
-		zip_bl_tree[curlen].fc++;
-	    zip_bl_tree[zip_REP_3_6].fc++;
-	} else if(count <= 10)
-	    zip_bl_tree[zip_REPZ_3_10].fc++;
-	else
-	    zip_bl_tree[zip_REPZ_11_138].fc++;
-	count = 0; prevlen = curlen;
-	if(nextlen == 0) {
-	    max_count = 138;
-	    min_count = 3;
-	} else if(curlen == nextlen) {
-	    max_count = 6;
-	    min_count = 3;
-	} else {
-	    max_count = 7;
-	    min_count = 4;
-	}
-    }
-}
-
-  /* ==========================================================================
-   * Send a literal or distance tree in compressed form, using the codes in
-   * bl_tree.
-   */
-var zip_send_tree = function(tree, // the tree to be scanned
-		   max_code) { // and its largest code of non zero frequency
-    var n;			// iterates over all tree elements
-    var prevlen = -1;		// last emitted length
-    var curlen;			// length of current code
-    var nextlen = tree[0].dl;	// length of next code
-    var count = 0;		// repeat count of the current code
-    var max_count = 7;		// max repeat count
-    var min_count = 4;		// min repeat count
-
-    /* tree[max_code+1].dl = -1; */  /* guard already set */
-    if(nextlen == 0) {
-      max_count = 138;
-      min_count = 3;
-    }
-
-    for(n = 0; n <= max_code; n++) {
-	curlen = nextlen;
-	nextlen = tree[n+1].dl;
-	if(++count < max_count && curlen == nextlen) {
-	    continue;
-	} else if(count < min_count) {
-	    do { zip_SEND_CODE(curlen, zip_bl_tree); } while(--count != 0);
-	} else if(curlen != 0) {
-	    if(curlen != prevlen) {
-		zip_SEND_CODE(curlen, zip_bl_tree);
-		count--;
-	    }
-	    // Assert(count >= 3 && count <= 6, " 3_6?");
-	    zip_SEND_CODE(zip_REP_3_6, zip_bl_tree);
-	    zip_send_bits(count - 3, 2);
-	} else if(count <= 10) {
-	    zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree);
-	    zip_send_bits(count-3, 3);
-	} else {
-	    zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree);
-	    zip_send_bits(count-11, 7);
-	}
-	count = 0;
-	prevlen = curlen;
-	if(nextlen == 0) {
-	    max_count = 138;
-	    min_count = 3;
-	} else if(curlen == nextlen) {
-	    max_count = 6;
-	    min_count = 3;
-	} else {
-	    max_count = 7;
-	    min_count = 4;
-	}
-    }
-}
-
-/* ==========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
-var zip_build_bl_tree = function() {
-    var max_blindex;  // index of last bit length code of non zero freq
-
-    // Determine the bit length frequencies for literal and distance trees
-    zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code);
-    zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code);
-
-    // Build the bit length tree:
-    zip_build_tree(zip_bl_desc);
-    /* opt_len now includes the length of the tree representations, except
-     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
-     */
-
-    /* Determine the number of bit length codes to send. The pkzip format
-     * requires that at least 4 bit length codes be sent. (appnote.txt says
-     * 3 but the actual value used is 4.)
-     */
-    for(max_blindex = zip_BL_CODES-1; max_blindex >= 3; max_blindex--) {
-	if(zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break;
-    }
-    /* Update opt_len to include the bit length tree and counts */
-    zip_opt_len += 3*(max_blindex+1) + 5+5+4;
-//    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
-//	    encoder->opt_len, encoder->static_len));
-
-    return max_blindex;
-}
-
-/* ==========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
-var zip_send_all_trees = function(lcodes, dcodes, blcodes) { // number of codes for each tree
-    var rank; // index in bl_order
-
-//    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
-//    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
-//	    "too many codes");
-//    Tracev((stderr, "\nbl counts: "));
-    zip_send_bits(lcodes-257, 5); // not +255 as stated in appnote.txt
-    zip_send_bits(dcodes-1,   5);
-    zip_send_bits(blcodes-4,  4); // not -3 as stated in appnote.txt
-    for(rank = 0; rank < blcodes; rank++) {
-//      Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
-	zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3);
-    }
-
-    // send the literal tree
-    zip_send_tree(zip_dyn_ltree,lcodes-1);
-
-    // send the distance tree
-    zip_send_tree(zip_dyn_dtree,dcodes-1);
-}
-
-/* ==========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
-var zip_flush_block = function(eof) { // true if this is the last block for a file
-    var opt_lenb, static_lenb; // opt_len and static_len in bytes
-    var max_blindex;	// index of last bit length code of non zero freq
-    var stored_len;	// length of input block
-
-    stored_len = zip_strstart - zip_block_start;
-    zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items
-
-    // Construct the literal and distance trees
-    zip_build_tree(zip_l_desc);
-//    Tracev((stderr, "\nlit data: dyn %ld, stat %ld",
-//	    encoder->opt_len, encoder->static_len));
-
-    zip_build_tree(zip_d_desc);
-//    Tracev((stderr, "\ndist data: dyn %ld, stat %ld",
-//	    encoder->opt_len, encoder->static_len));
-    /* At this point, opt_len and static_len are the total bit lengths of
-     * the compressed block data, excluding the tree representations.
-     */
-
-    /* Build the bit length tree for the above two trees, and get the index
-     * in bl_order of the last bit length code to send.
-     */
-    max_blindex = zip_build_bl_tree();
-
-    // Determine the best encoding. Compute first the block length in bytes
-    opt_lenb	= (zip_opt_len   +3+7)>>3;
-    static_lenb = (zip_static_len+3+7)>>3;
-
-//    Trace((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ",
-//	   opt_lenb, encoder->opt_len,
-//	   static_lenb, encoder->static_len, stored_len,
-//	   encoder->last_lit, encoder->last_dist));
-
-    if(static_lenb <= opt_lenb)
-	opt_lenb = static_lenb;
-    if(stored_len + 4 <= opt_lenb // 4: two words for the lengths
-       && zip_block_start >= 0) {
-	var i;
-
-	/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
-	 * Otherwise we can't have processed more than WSIZE input bytes since
-	 * the last block flush, because compression would have been
-	 * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
-	 * transform a block into a stored block.
-	 */
-	zip_send_bits((zip_STORED_BLOCK<<1)+eof, 3);  /* send block type */
-	zip_bi_windup();		 /* align on byte boundary */
-	zip_put_short(stored_len);
-	zip_put_short(~stored_len);
-
-      // copy block
-/*
-      p = &window[block_start];
-      for(i = 0; i < stored_len; i++)
-	put_byte(p[i]);
-*/
-	for(i = 0; i < stored_len; i++)
-	    zip_put_byte(zip_window[zip_block_start + i]);
-
-    } else if(static_lenb == opt_lenb) {
-	zip_send_bits((zip_STATIC_TREES<<1)+eof, 3);
-	zip_compress_block(zip_static_ltree, zip_static_dtree);
-    } else {
-	zip_send_bits((zip_DYN_TREES<<1)+eof, 3);
-	zip_send_all_trees(zip_l_desc.max_code+1,
-			   zip_d_desc.max_code+1,
-			   max_blindex+1);
-	zip_compress_block(zip_dyn_ltree, zip_dyn_dtree);
-    }
-
-    zip_init_block();
-
-    if(eof != 0)
-	zip_bi_windup();
-}
-
-/* ==========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
-var zip_ct_tally = function(
-	dist, // distance of matched string
-	lc) { // match length-MIN_MATCH or unmatched char (if dist==0)
-    zip_l_buf[zip_last_lit++] = lc;
-    if(dist == 0) {
-	// lc is the unmatched char
-	zip_dyn_ltree[lc].fc++;
-    } else {
-	// Here, lc is the match length - MIN_MATCH
-	dist--;		    // dist = match distance - 1
-//      Assert((ush)dist < (ush)MAX_DIST &&
-//	     (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
-//	     (ush)D_CODE(dist) < (ush)D_CODES,  "ct_tally: bad match");
-
-	zip_dyn_ltree[zip_length_code[lc]+zip_LITERALS+1].fc++;
-	zip_dyn_dtree[zip_D_CODE(dist)].fc++;
-
-	zip_d_buf[zip_last_dist++] = dist;
-	zip_flags |= zip_flag_bit;
-    }
-    zip_flag_bit <<= 1;
-
-    // Output the flags if they fill a byte
-    if((zip_last_lit & 7) == 0) {
-	zip_flag_buf[zip_last_flags++] = zip_flags;
-	zip_flags = 0;
-	zip_flag_bit = 1;
-    }
-    // Try to guess if it is profitable to stop the current block here
-    if(zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) {
-	// Compute an upper bound for the compressed length
-	var out_length = zip_last_lit * 8;
-	var in_length = zip_strstart - zip_block_start;
-	var dcode;
-
-	for(dcode = 0; dcode < zip_D_CODES; dcode++) {
-	    out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]);
-	}
-	out_length >>= 3;
-//      Trace((stderr,"\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ",
-//	     encoder->last_lit, encoder->last_dist, in_length, out_length,
-//	     100L - out_length*100L/in_length));
-	if(zip_last_dist < parseInt(zip_last_lit/2) &&
-	   out_length < parseInt(in_length/2))
-	    return true;
-    }
-    return (zip_last_lit == zip_LIT_BUFSIZE-1 ||
-	    zip_last_dist == zip_DIST_BUFSIZE);
-    /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K
-     * on 16 bit machines and because stored blocks are restricted to
-     * 64K-1 bytes.
-     */
-}
-
-  /* ==========================================================================
-   * Send the block data compressed using the given Huffman trees
-   */
-var zip_compress_block = function(
-	ltree,	// literal tree
-	dtree) {	// distance tree
-    var dist;		// distance of matched string
-    var lc;		// match length or unmatched char (if dist == 0)
-    var lx = 0;		// running index in l_buf
-    var dx = 0;		// running index in d_buf
-    var fx = 0;		// running index in flag_buf
-    var flag = 0;	// current flags
-    var code;		// the code to send
-    var extra;		// number of extra bits to send
-
-    if(zip_last_lit != 0) do {
-	if((lx & 7) == 0)
-	    flag = zip_flag_buf[fx++];
-	lc = zip_l_buf[lx++] & 0xff;
-	if((flag & 1) == 0) {
-	    zip_SEND_CODE(lc, ltree); /* send a literal byte */
-//	Tracecv(isgraph(lc), (stderr," '%c' ", lc));
-	} else {
-	    // Here, lc is the match length - MIN_MATCH
-	    code = zip_length_code[lc];
-	    zip_SEND_CODE(code+zip_LITERALS+1, ltree); // send the length code
-	    extra = zip_extra_lbits[code];
-	    if(extra != 0) {
-		lc -= zip_base_length[code];
-		zip_send_bits(lc, extra); // send the extra length bits
-	    }
-	    dist = zip_d_buf[dx++];
-	    // Here, dist is the match distance - 1
-	    code = zip_D_CODE(dist);
-//	Assert (code < D_CODES, "bad d_code");
-
-	    zip_SEND_CODE(code, dtree);	  // send the distance code
-	    extra = zip_extra_dbits[code];
-	    if(extra != 0) {
-		dist -= zip_base_dist[code];
-		zip_send_bits(dist, extra);   // send the extra distance bits
-	    }
-	} // literal or match pair ?
-	flag >>= 1;
-    } while(lx < zip_last_lit);
-
-    zip_SEND_CODE(zip_END_BLOCK, ltree);
-}
-
-/* ==========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
-var zip_Buf_size = 16; // bit size of bi_buf
-var zip_send_bits = function(
-	value,	// value to send
-	length) {	// number of bits
-    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
-     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
-     * unused bits in value.
-     */
-    if(zip_bi_valid > zip_Buf_size - length) {
-	zip_bi_buf |= (value << zip_bi_valid);
-	zip_put_short(zip_bi_buf);
-	zip_bi_buf = (value >> (zip_Buf_size - zip_bi_valid));
-	zip_bi_valid += length - zip_Buf_size;
-    } else {
-	zip_bi_buf |= value << zip_bi_valid;
-	zip_bi_valid += length;
-    }
-}
-
-/* ==========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-var zip_bi_reverse = function(
-	code,	// the value to invert
-	len) {	// its bit length
-    var res = 0;
-    do {
-	res |= code & 1;
-	code >>= 1;
-	res <<= 1;
-    } while(--len > 0);
-    return res >> 1;
-}
-
-/* ==========================================================================
- * Write out any remaining bits in an incomplete byte.
- */
-var zip_bi_windup = function() {
-    if(zip_bi_valid > 8) {
-	zip_put_short(zip_bi_buf);
-    } else if(zip_bi_valid > 0) {
-	zip_put_byte(zip_bi_buf);
-    }
-    zip_bi_buf = 0;
-    zip_bi_valid = 0;
-}
-
-var zip_qoutbuf = function() {
-    if(zip_outcnt != 0) {
-	var q, i;
-	q = zip_new_queue();
-	if(zip_qhead == null)
-	    zip_qhead = zip_qtail = q;
-	else
-	    zip_qtail = zip_qtail.next = q;
-	q.len = zip_outcnt - zip_outoff;
-//      System.arraycopy(zip_outbuf, zip_outoff, q.ptr, 0, q.len);
-	for(i = 0; i < q.len; i++)
-	    q.ptr[i] = zip_outbuf[zip_outoff + i];
-	zip_outcnt = zip_outoff = 0;
-    }
-}
-
-var zip_deflate = function(str, level) {
-    var i, j;
-
-    zip_deflate_data = str;
-    zip_deflate_pos = 0;
-    if(typeof level == "undefined")
-	level = zip_DEFAULT_LEVEL;
-    zip_deflate_start(level);
-
-    var buff = new Array(1024);
-    var aout = [];
-    while((i = zip_deflate_internal(buff, 0, buff.length)) > 0) {
-	var cbuf = new Array(i);
-	for(j = 0; j < i; j++){
-	    cbuf[j] = String.fromCharCode(buff[j]);
-	}
-	aout[aout.length] = cbuf.join("");
-    }
-    zip_deflate_data = null; // G.C.
-    return aout.join("");
-}
-
-if (! window.RawDeflate) RawDeflate = {};
-RawDeflate.deflate = zip_deflate;
-
-})();

+ 0 - 753
editor/js/libs/rawinflate.js

@@ -1,753 +0,0 @@
-/*
- * $Id: rawinflate.js,v 0.2 2009/03/01 18:32:24 dankogai Exp $
- *
- * original:
- * http://www.onicos.com/staff/iz/amuse/javascript/expert/inflate.txt
- */
-
-(function(){
-
-/* Copyright (C) 1999 Masanao Izumo <[email protected]>
- * Version: 1.0.0.1
- * LastModified: Dec 25 1999
- */
-
-/* Interface:
- * data = zip_inflate(src);
- */
-
-/* constant parameters */
-var zip_WSIZE = 32768;		// Sliding Window size
-var zip_STORED_BLOCK = 0;
-var zip_STATIC_TREES = 1;
-var zip_DYN_TREES    = 2;
-
-/* for inflate */
-var zip_lbits = 9; 		// bits in base literal/length lookup table
-var zip_dbits = 6; 		// bits in base distance lookup table
-var zip_INBUFSIZ = 32768;	// Input buffer size
-var zip_INBUF_EXTRA = 64;	// Extra buffer
-
-/* variables (inflate) */
-var zip_slide;
-var zip_wp;			// current position in slide
-var zip_fixed_tl = null;	// inflate static
-var zip_fixed_td;		// inflate static
-var zip_fixed_bl, fixed_bd;	// inflate static
-var zip_bit_buf;		// bit buffer
-var zip_bit_len;		// bits in bit buffer
-var zip_method;
-var zip_eof;
-var zip_copy_leng;
-var zip_copy_dist;
-var zip_tl, zip_td;	// literal/length and distance decoder tables
-var zip_bl, zip_bd;	// number of bits decoded by tl and td
-
-var zip_inflate_data;
-var zip_inflate_pos;
-
-
-/* constant tables (inflate) */
-var zip_MASK_BITS = new Array(
-    0x0000,
-    0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
-    0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff);
-// Tables for deflate from PKZIP's appnote.txt.
-var zip_cplens = new Array( // Copy lengths for literal codes 257..285
-    3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
-    35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0);
-/* note: see note #13 above about the 258 in this list. */
-var zip_cplext = new Array( // Extra bits for literal codes 257..285
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
-    3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99); // 99==invalid
-var zip_cpdist = new Array( // Copy offsets for distance codes 0..29
-    1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
-    257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
-    8193, 12289, 16385, 24577);
-var zip_cpdext = new Array( // Extra bits for distance codes
-    0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
-    7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
-    12, 12, 13, 13);
-var zip_border = new Array(  // Order of the bit length code lengths
-    16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15);
-/* objects (inflate) */
-
-var zip_HuftList = function() {
-    this.next = null;
-    this.list = null;
-}
-
-var zip_HuftNode = function() {
-    this.e = 0; // number of extra bits or operation
-    this.b = 0; // number of bits in this code or subcode
-
-    // union
-    this.n = 0; // literal, length base, or distance base
-    this.t = null; // (zip_HuftNode) pointer to next level of table
-}
-
-var zip_HuftBuild = function(b,	// code lengths in bits (all assumed <= BMAX)
-		       n,	// number of codes (assumed <= N_MAX)
-		       s,	// number of simple-valued codes (0..s-1)
-		       d,	// list of base values for non-simple codes
-		       e,	// list of extra bits for non-simple codes
-		       mm	// maximum lookup bits
-		   ) {
-    this.BMAX = 16;   // maximum bit length of any code
-    this.N_MAX = 288; // maximum number of codes in any set
-    this.status = 0;	// 0: success, 1: incomplete table, 2: bad input
-    this.root = null;	// (zip_HuftList) starting table
-    this.m = 0;		// maximum lookup bits, returns actual
-
-/* Given a list of code lengths and a maximum table size, make a set of
-   tables to decode that set of codes.	Return zero on success, one if
-   the given code set is incomplete (the tables are still built in this
-   case), two if the input is invalid (all zero length codes or an
-   oversubscribed set of lengths), and three if not enough memory.
-   The code with value 256 is special, and the tables are constructed
-   so that no bits beyond that code are fetched when that code is
-   decoded. */
-    {
-	var a;			// counter for codes of length k
-	var c = new Array(this.BMAX+1);	// bit length count table
-	var el;			// length of EOB code (value 256)
-	var f;			// i repeats in table every f entries
-	var g;			// maximum code length
-	var h;			// table level
-	var i;			// counter, current code
-	var j;			// counter
-	var k;			// number of bits in current code
-	var lx = new Array(this.BMAX+1);	// stack of bits per table
-	var p;			// pointer into c[], b[], or v[]
-	var pidx;		// index of p
-	var q;			// (zip_HuftNode) points to current table
-	var r = new zip_HuftNode(); // table entry for structure assignment
-	var u = new Array(this.BMAX); // zip_HuftNode[BMAX][]  table stack
-	var v = new Array(this.N_MAX); // values in order of bit length
-	var w;
-	var x = new Array(this.BMAX+1);// bit offsets, then code stack
-	var xp;			// pointer into x or c
-	var y;			// number of dummy codes added
-	var z;			// number of entries in current table
-	var o;
-	var tail;		// (zip_HuftList)
-
-	tail = this.root = null;
-	for(i = 0; i < c.length; i++)
-	    c[i] = 0;
-	for(i = 0; i < lx.length; i++)
-	    lx[i] = 0;
-	for(i = 0; i < u.length; i++)
-	    u[i] = null;
-	for(i = 0; i < v.length; i++)
-	    v[i] = 0;
-	for(i = 0; i < x.length; i++)
-	    x[i] = 0;
-
-	// Generate counts for each bit length
-	el = n > 256 ? b[256] : this.BMAX; // set length of EOB code, if any
-	p = b; pidx = 0;
-	i = n;
-	do {
-	    c[p[pidx]]++;	// assume all entries <= BMAX
-	    pidx++;
-	} while(--i > 0);
-	if(c[0] == n) {	// null input--all zero length codes
-	    this.root = null;
-	    this.m = 0;
-	    this.status = 0;
-	    return;
-	}
-
-	// Find minimum and maximum length, bound *m by those
-	for(j = 1; j <= this.BMAX; j++)
-	    if(c[j] != 0)
-		break;
-	k = j;			// minimum code length
-	if(mm < j)
-	    mm = j;
-	for(i = this.BMAX; i != 0; i--)
-	    if(c[i] != 0)
-		break;
-	g = i;			// maximum code length
-	if(mm > i)
-	    mm = i;
-
-	// Adjust last length count to fill out codes, if needed
-	for(y = 1 << j; j < i; j++, y <<= 1)
-	    if((y -= c[j]) < 0) {
-		this.status = 2;	// bad input: more codes than bits
-		this.m = mm;
-		return;
-	    }
-	if((y -= c[i]) < 0) {
-	    this.status = 2;
-	    this.m = mm;
-	    return;
-	}
-	c[i] += y;
-
-	// Generate starting offsets into the value table for each length
-	x[1] = j = 0;
-	p = c;
-	pidx = 1;
-	xp = 2;
-	while(--i > 0)		// note that i == g from above
-	    x[xp++] = (j += p[pidx++]);
-
-	// Make a table of values in order of bit lengths
-	p = b; pidx = 0;
-	i = 0;
-	do {
-	    if((j = p[pidx++]) != 0)
-		v[x[j]++] = i;
-	} while(++i < n);
-	n = x[g];			// set n to length of v
-
-	// Generate the Huffman codes and for each, make the table entries
-	x[0] = i = 0;		// first Huffman code is zero
-	p = v; pidx = 0;		// grab values in bit order
-	h = -1;			// no tables yet--level -1
-	w = lx[0] = 0;		// no bits decoded yet
-	q = null;			// ditto
-	z = 0;			// ditto
-
-	// go through the bit lengths (k already is bits in shortest code)
-	for(; k <= g; k++) {
-	    a = c[k];
-	    while(a-- > 0) {
-		// here i is the Huffman code of length k bits for value p[pidx]
-		// make tables up to required level
-		while(k > w + lx[1 + h]) {
-		    w += lx[1 + h]; // add bits already decoded
-		    h++;
-
-		    // compute minimum size table less than or equal to *m bits
-		    z = (z = g - w) > mm ? mm : z; // upper limit
-		    if((f = 1 << (j = k - w)) > a + 1) { // try a k-w bit table
-			// too few codes for k-w bit table
-			f -= a + 1;	// deduct codes from patterns left
-			xp = k;
-			while(++j < z) { // try smaller tables up to z bits
-			    if((f <<= 1) <= c[++xp])
-				break;	// enough codes to use up j bits
-			    f -= c[xp];	// else deduct codes from patterns
-			}
-		    }
-		    if(w + j > el && w < el)
-			j = el - w;	// make EOB code end at table
-		    z = 1 << j;	// table entries for j-bit table
-		    lx[1 + h] = j; // set table size in stack
-
-		    // allocate and link in new table
-		    q = new Array(z);
-		    for(o = 0; o < z; o++) {
-			q[o] = new zip_HuftNode();
-		    }
-
-		    if(tail == null)
-			tail = this.root = new zip_HuftList();
-		    else
-			tail = tail.next = new zip_HuftList();
-		    tail.next = null;
-		    tail.list = q;
-		    u[h] = q;	// table starts after link
-
-		    /* connect to last table, if there is one */
-		    if(h > 0) {
-			x[h] = i;		// save pattern for backing up
-			r.b = lx[h];	// bits to dump before this table
-			r.e = 16 + j;	// bits in this table
-			r.t = q;		// pointer to this table
-			j = (i & ((1 << w) - 1)) >> (w - lx[h]);
-			u[h-1][j].e = r.e;
-			u[h-1][j].b = r.b;
-			u[h-1][j].n = r.n;
-			u[h-1][j].t = r.t;
-		    }
-		}
-
-		// set up table entry in r
-		r.b = k - w;
-		if(pidx >= n)
-		    r.e = 99;		// out of values--invalid code
-		else if(p[pidx] < s) {
-		    r.e = (p[pidx] < 256 ? 16 : 15); // 256 is end-of-block code
-		    r.n = p[pidx++];	// simple code is just the value
-		} else {
-		    r.e = e[p[pidx] - s];	// non-simple--look up in lists
-		    r.n = d[p[pidx++] - s];
-		}
-
-		// fill code-like entries with r //
-		f = 1 << (k - w);
-		for(j = i >> w; j < z; j += f) {
-		    q[j].e = r.e;
-		    q[j].b = r.b;
-		    q[j].n = r.n;
-		    q[j].t = r.t;
-		}
-
-		// backwards increment the k-bit code i
-		for(j = 1 << (k - 1); (i & j) != 0; j >>= 1)
-		    i ^= j;
-		i ^= j;
-
-		// backup over finished tables
-		while((i & ((1 << w) - 1)) != x[h]) {
-		    w -= lx[h];		// don't need to update q
-		    h--;
-		}
-	    }
-	}
-
-	/* return actual size of base table */
-	this.m = lx[1];
-
-	/* Return true (1) if we were given an incomplete table */
-	this.status = ((y != 0 && g != 1) ? 1 : 0);
-    } /* end of constructor */
-}
-
-
-/* routines (inflate) */
-
-var zip_GET_BYTE = function() {
-    if(zip_inflate_data.length == zip_inflate_pos)
-	return -1;
-    return zip_inflate_data.charCodeAt(zip_inflate_pos++) & 0xff;
-}
-
-var zip_NEEDBITS = function(n) {
-    while(zip_bit_len < n) {
-	zip_bit_buf |= zip_GET_BYTE() << zip_bit_len;
-	zip_bit_len += 8;
-    }
-}
-
-var zip_GETBITS = function(n) {
-    return zip_bit_buf & zip_MASK_BITS[n];
-}
-
-var zip_DUMPBITS = function(n) {
-    zip_bit_buf >>= n;
-    zip_bit_len -= n;
-}
-
-var zip_inflate_codes = function(buff, off, size) {
-    /* inflate (decompress) the codes in a deflated (compressed) block.
-       Return an error code or zero if it all goes ok. */
-    var e;		// table entry flag/number of extra bits
-    var t;		// (zip_HuftNode) pointer to table entry
-    var n;
-
-    if(size == 0)
-      return 0;
-
-    // inflate the coded data
-    n = 0;
-    for(;;) {			// do until end of block
-	zip_NEEDBITS(zip_bl);
-	t = zip_tl.list[zip_GETBITS(zip_bl)];
-	e = t.e;
-	while(e > 16) {
-	    if(e == 99)
-		return -1;
-	    zip_DUMPBITS(t.b);
-	    e -= 16;
-	    zip_NEEDBITS(e);
-	    t = t.t[zip_GETBITS(e)];
-	    e = t.e;
-	}
-	zip_DUMPBITS(t.b);
-
-	if(e == 16) {		// then it's a literal
-	    zip_wp &= zip_WSIZE - 1;
-	    buff[off + n++] = zip_slide[zip_wp++] = t.n;
-	    if(n == size)
-		return size;
-	    continue;
-	}
-
-	// exit if end of block
-	if(e == 15)
-	    break;
-
-	// it's an EOB or a length
-
-	// get length of block to copy
-	zip_NEEDBITS(e);
-	zip_copy_leng = t.n + zip_GETBITS(e);
-	zip_DUMPBITS(e);
-
-	// decode distance of block to copy
-	zip_NEEDBITS(zip_bd);
-	t = zip_td.list[zip_GETBITS(zip_bd)];
-	e = t.e;
-
-	while(e > 16) {
-	    if(e == 99)
-		return -1;
-	    zip_DUMPBITS(t.b);
-	    e -= 16;
-	    zip_NEEDBITS(e);
-	    t = t.t[zip_GETBITS(e)];
-	    e = t.e;
-	}
-	zip_DUMPBITS(t.b);
-	zip_NEEDBITS(e);
-	zip_copy_dist = zip_wp - t.n - zip_GETBITS(e);
-	zip_DUMPBITS(e);
-
-	// do the copy
-	while(zip_copy_leng > 0 && n < size) {
-	    zip_copy_leng--;
-	    zip_copy_dist &= zip_WSIZE - 1;
-	    zip_wp &= zip_WSIZE - 1;
-	    buff[off + n++] = zip_slide[zip_wp++]
-		= zip_slide[zip_copy_dist++];
-	}
-
-	if(n == size)
-	    return size;
-    }
-
-    zip_method = -1; // done
-    return n;
-}
-
-var zip_inflate_stored = function(buff, off, size) {
-    /* "decompress" an inflated type 0 (stored) block. */
-    var n;
-
-    // go to byte boundary
-    n = zip_bit_len & 7;
-    zip_DUMPBITS(n);
-
-    // get the length and its complement
-    zip_NEEDBITS(16);
-    n = zip_GETBITS(16);
-    zip_DUMPBITS(16);
-    zip_NEEDBITS(16);
-    if(n != ((~zip_bit_buf) & 0xffff))
-	return -1;			// error in compressed data
-    zip_DUMPBITS(16);
-
-    // read and output the compressed data
-    zip_copy_leng = n;
-
-    n = 0;
-    while(zip_copy_leng > 0 && n < size) {
-	zip_copy_leng--;
-	zip_wp &= zip_WSIZE - 1;
-	zip_NEEDBITS(8);
-	buff[off + n++] = zip_slide[zip_wp++] =
-	    zip_GETBITS(8);
-	zip_DUMPBITS(8);
-    }
-
-    if(zip_copy_leng == 0)
-      zip_method = -1; // done
-    return n;
-}
-
-var zip_inflate_fixed = function(buff, off, size) {
-    /* decompress an inflated type 1 (fixed Huffman codes) block.  We should
-       either replace this with a custom decoder, or at least precompute the
-       Huffman tables. */
-
-    // if first time, set up tables for fixed blocks
-    if(zip_fixed_tl == null) {
-	var i;			// temporary variable
-	var l = new Array(288);	// length list for huft_build
-	var h;	// zip_HuftBuild
-
-	// literal table
-	for(i = 0; i < 144; i++)
-	    l[i] = 8;
-	for(; i < 256; i++)
-	    l[i] = 9;
-	for(; i < 280; i++)
-	    l[i] = 7;
-	for(; i < 288; i++)	// make a complete, but wrong code set
-	    l[i] = 8;
-	zip_fixed_bl = 7;
-
-	h = new zip_HuftBuild(l, 288, 257, zip_cplens, zip_cplext,
-			      zip_fixed_bl);
-	if(h.status != 0) {
-	    alert("HufBuild error: "+h.status);
-	    return -1;
-	}
-	zip_fixed_tl = h.root;
-	zip_fixed_bl = h.m;
-
-	// distance table
-	for(i = 0; i < 30; i++)	// make an incomplete code set
-	    l[i] = 5;
-	zip_fixed_bd = 5;
-
-	h = new zip_HuftBuild(l, 30, 0, zip_cpdist, zip_cpdext, zip_fixed_bd);
-	if(h.status > 1) {
-	    zip_fixed_tl = null;
-	    alert("HufBuild error: "+h.status);
-	    return -1;
-	}
-	zip_fixed_td = h.root;
-	zip_fixed_bd = h.m;
-    }
-
-    zip_tl = zip_fixed_tl;
-    zip_td = zip_fixed_td;
-    zip_bl = zip_fixed_bl;
-    zip_bd = zip_fixed_bd;
-    return zip_inflate_codes(buff, off, size);
-}
-
-var zip_inflate_dynamic = function(buff, off, size) {
-    // decompress an inflated type 2 (dynamic Huffman codes) block.
-    var i;		// temporary variables
-    var j;
-    var l;		// last length
-    var n;		// number of lengths to get
-    var t;		// (zip_HuftNode) literal/length code table
-    var nb;		// number of bit length codes
-    var nl;		// number of literal/length codes
-    var nd;		// number of distance codes
-    var ll = new Array(286+30); // literal/length and distance code lengths
-    var h;		// (zip_HuftBuild)
-
-    for(i = 0; i < ll.length; i++)
-	ll[i] = 0;
-
-    // read in table lengths
-    zip_NEEDBITS(5);
-    nl = 257 + zip_GETBITS(5);	// number of literal/length codes
-    zip_DUMPBITS(5);
-    zip_NEEDBITS(5);
-    nd = 1 + zip_GETBITS(5);	// number of distance codes
-    zip_DUMPBITS(5);
-    zip_NEEDBITS(4);
-    nb = 4 + zip_GETBITS(4);	// number of bit length codes
-    zip_DUMPBITS(4);
-    if(nl > 286 || nd > 30)
-      return -1;		// bad lengths
-
-    // read in bit-length-code lengths
-    for(j = 0; j < nb; j++)
-    {
-	zip_NEEDBITS(3);
-	ll[zip_border[j]] = zip_GETBITS(3);
-	zip_DUMPBITS(3);
-    }
-    for(; j < 19; j++)
-	ll[zip_border[j]] = 0;
-
-    // build decoding table for trees--single level, 7 bit lookup
-    zip_bl = 7;
-    h = new zip_HuftBuild(ll, 19, 19, null, null, zip_bl);
-    if(h.status != 0)
-	return -1;	// incomplete code set
-
-    zip_tl = h.root;
-    zip_bl = h.m;
-
-    // read in literal and distance code lengths
-    n = nl + nd;
-    i = l = 0;
-    while(i < n) {
-	zip_NEEDBITS(zip_bl);
-	t = zip_tl.list[zip_GETBITS(zip_bl)];
-	j = t.b;
-	zip_DUMPBITS(j);
-	j = t.n;
-	if(j < 16)		// length of code in bits (0..15)
-	    ll[i++] = l = j;	// save last length in l
-	else if(j == 16) {	// repeat last length 3 to 6 times
-	    zip_NEEDBITS(2);
-	    j = 3 + zip_GETBITS(2);
-	    zip_DUMPBITS(2);
-	    if(i + j > n)
-		return -1;
-	    while(j-- > 0)
-		ll[i++] = l;
-	} else if(j == 17) {	// 3 to 10 zero length codes
-	    zip_NEEDBITS(3);
-	    j = 3 + zip_GETBITS(3);
-	    zip_DUMPBITS(3);
-	    if(i + j > n)
-		return -1;
-	    while(j-- > 0)
-		ll[i++] = 0;
-	    l = 0;
-	} else {		// j == 18: 11 to 138 zero length codes
-	    zip_NEEDBITS(7);
-	    j = 11 + zip_GETBITS(7);
-	    zip_DUMPBITS(7);
-	    if(i + j > n)
-		return -1;
-	    while(j-- > 0)
-		ll[i++] = 0;
-	    l = 0;
-	}
-    }
-
-    // build the decoding tables for literal/length and distance codes
-    zip_bl = zip_lbits;
-    h = new zip_HuftBuild(ll, nl, 257, zip_cplens, zip_cplext, zip_bl);
-    if(zip_bl == 0)	// no literals or lengths
-	h.status = 1;
-    if(h.status != 0) {
-	if(h.status == 1)
-	    ;// **incomplete literal tree**
-	return -1;		// incomplete code set
-    }
-    zip_tl = h.root;
-    zip_bl = h.m;
-
-    for(i = 0; i < nd; i++)
-	ll[i] = ll[i + nl];
-    zip_bd = zip_dbits;
-    h = new zip_HuftBuild(ll, nd, 0, zip_cpdist, zip_cpdext, zip_bd);
-    zip_td = h.root;
-    zip_bd = h.m;
-
-    if(zip_bd == 0 && nl > 257) {   // lengths but no distances
-	// **incomplete distance tree**
-	return -1;
-    }
-
-    if(h.status == 1) {
-	;// **incomplete distance tree**
-    }
-    if(h.status != 0)
-	return -1;
-
-    // decompress until an end-of-block code
-    return zip_inflate_codes(buff, off, size);
-}
-
-var zip_inflate_start = function() {
-    var i;
-
-    if(zip_slide == null)
-	zip_slide = new Array(2 * zip_WSIZE);
-    zip_wp = 0;
-    zip_bit_buf = 0;
-    zip_bit_len = 0;
-    zip_method = -1;
-    zip_eof = false;
-    zip_copy_leng = zip_copy_dist = 0;
-    zip_tl = null;
-}
-
-var zip_inflate_internal = function(buff, off, size) {
-    // decompress an inflated entry
-    var n, i;
-
-    n = 0;
-    while(n < size) {
-	if(zip_eof && zip_method == -1)
-	    return n;
-
-	if(zip_copy_leng > 0) {
-	    if(zip_method != zip_STORED_BLOCK) {
-		// STATIC_TREES or DYN_TREES
-		while(zip_copy_leng > 0 && n < size) {
-		    zip_copy_leng--;
-		    zip_copy_dist &= zip_WSIZE - 1;
-		    zip_wp &= zip_WSIZE - 1;
-		    buff[off + n++] = zip_slide[zip_wp++] =
-			zip_slide[zip_copy_dist++];
-		}
-	    } else {
-		while(zip_copy_leng > 0 && n < size) {
-		    zip_copy_leng--;
-		    zip_wp &= zip_WSIZE - 1;
-		    zip_NEEDBITS(8);
-		    buff[off + n++] = zip_slide[zip_wp++] = zip_GETBITS(8);
-		    zip_DUMPBITS(8);
-		}
-		if(zip_copy_leng == 0)
-		    zip_method = -1; // done
-	    }
-	    if(n == size)
-		return n;
-	}
-
-	if(zip_method == -1) {
-	    if(zip_eof)
-		break;
-
-	    // read in last block bit
-	    zip_NEEDBITS(1);
-	    if(zip_GETBITS(1) != 0)
-		zip_eof = true;
-	    zip_DUMPBITS(1);
-
-	    // read in block type
-	    zip_NEEDBITS(2);
-	    zip_method = zip_GETBITS(2);
-	    zip_DUMPBITS(2);
-	    zip_tl = null;
-	    zip_copy_leng = 0;
-	}
-
-	switch(zip_method) {
-	  case 0: // zip_STORED_BLOCK
-	    i = zip_inflate_stored(buff, off + n, size - n);
-	    break;
-
-	  case 1: // zip_STATIC_TREES
-	    if(zip_tl != null)
-		i = zip_inflate_codes(buff, off + n, size - n);
-	    else
-		i = zip_inflate_fixed(buff, off + n, size - n);
-	    break;
-
-	  case 2: // zip_DYN_TREES
-	    if(zip_tl != null)
-		i = zip_inflate_codes(buff, off + n, size - n);
-	    else
-		i = zip_inflate_dynamic(buff, off + n, size - n);
-	    break;
-
-	  default: // error
-	    i = -1;
-	    break;
-	}
-
-	if(i == -1) {
-	    if(zip_eof)
-		return 0;
-	    return -1;
-	}
-	n += i;
-    }
-    return n;
-}
-
-var zip_inflate = function(str) {
-    var i, j;
-
-    zip_inflate_start();
-    zip_inflate_data = str;
-    zip_inflate_pos = 0;
-
-    var buff = new Array(1024);
-    var aout = [];
-    while((i = zip_inflate_internal(buff, 0, buff.length)) > 0) {
-	var cbuf = new Array(i);
-	for(j = 0; j < i; j++){
-	    cbuf[j] = String.fromCharCode(buff[j]);
-	}
-	aout[aout.length] = cbuf.join("");
-    }
-    zip_inflate_data = null; // G.C.
-    return aout.join("");
-}
-
-if (! window.RawDeflate) RawDeflate = {};
-RawDeflate.inflate = zip_inflate;
-
-})();

+ 37 - 13
editor/js/libs/ui.js

@@ -77,7 +77,8 @@ events.forEach( function ( event ) {
 
 
 	UI.Element.prototype[ method ] = function ( callback ) {
 	UI.Element.prototype[ method ] = function ( callback ) {
 
 
-		this.dom.addEventListener( event.toLowerCase(), callback, false );
+		this.dom.addEventListener( event.toLowerCase(), callback.bind( this ), false );
+
 		return this;
 		return this;
 
 
 	};
 	};
@@ -126,6 +127,16 @@ UI.Panel.prototype.remove = function () {
 
 
 };
 };
 
 
+UI.Panel.prototype.clear = function () {
+
+	while ( this.dom.children.length ) {
+
+		this.dom.removeChild( this.dom.lastChild );
+
+	}
+
+};
+
 // Text
 // Text
 
 
 UI.Text = function ( text ) {
 UI.Text = function ( text ) {
@@ -522,7 +533,12 @@ UI.Color = function () {
 	dom.style.padding = '0px';
 	dom.style.padding = '0px';
 	dom.style.backgroundColor = 'transparent';
 	dom.style.backgroundColor = 'transparent';
 
 
-	try { dom.type = 'color'; } catch ( exception ) {}
+	try {
+
+		dom.type = 'color';
+		dom.value = '#ffffff';
+
+	} catch ( exception ) {}
 
 
 	this.dom = dom;
 	this.dom = dom;
 
 
@@ -596,6 +612,9 @@ UI.Number = function ( number ) {
 	var distance = 0;
 	var distance = 0;
 	var onMouseDownValue = 0;
 	var onMouseDownValue = 0;
 
 
+	var pointer = new THREE.Vector2();
+	var prevPointer = new THREE.Vector2();
+
 	var onMouseDown = function ( event ) {
 	var onMouseDown = function ( event ) {
 
 
 		event.preventDefault();
 		event.preventDefault();
@@ -604,6 +623,8 @@ UI.Number = function ( number ) {
 
 
 		onMouseDownValue = parseFloat( dom.value );
 		onMouseDownValue = parseFloat( dom.value );
 
 
+		prevPointer.set( event.clientX, event.clientY );
+
 		document.addEventListener( 'mousemove', onMouseMove, false );
 		document.addEventListener( 'mousemove', onMouseMove, false );
 		document.addEventListener( 'mouseup', onMouseUp, false );
 		document.addEventListener( 'mouseup', onMouseUp, false );
 
 
@@ -613,10 +634,9 @@ UI.Number = function ( number ) {
 
 
 		var currentValue = dom.value;
 		var currentValue = dom.value;
 
 
-		var movementX = event.movementX || event.webkitMovementX || event.mozMovementX || 0;
-		var movementY = event.movementY || event.webkitMovementY || event.mozMovementY || 0;
+		pointer.set( event.clientX, event.clientY );
 
 
-		distance += movementX - movementY;
+		distance += ( pointer.x - prevPointer.x ) - ( pointer.y - prevPointer.y );
 
 
 		var number = onMouseDownValue + ( distance / ( event.shiftKey ? 5 : 50 ) ) * scope.step;
 		var number = onMouseDownValue + ( distance / ( event.shiftKey ? 5 : 50 ) ) * scope.step;
 
 
@@ -624,6 +644,8 @@ UI.Number = function ( number ) {
 
 
 		if ( currentValue !== dom.value ) dom.dispatchEvent( changeEvent );
 		if ( currentValue !== dom.value ) dom.dispatchEvent( changeEvent );
 
 
+		prevPointer.set( event.clientX, event.clientY );
+
 	};
 	};
 
 
 	var onMouseUp = function ( event ) {
 	var onMouseUp = function ( event ) {
@@ -644,11 +666,7 @@ UI.Number = function ( number ) {
 
 
 		var number = parseFloat( dom.value );
 		var number = parseFloat( dom.value );
 
 
-		if ( isNaN( number ) === false ) {
-
-			dom.value = number;
-
-		}
+		dom.value = isNaN( number ) === false ? number : 0;
 
 
 	};
 	};
 
 
@@ -747,6 +765,9 @@ UI.Integer = function ( number ) {
 	var distance = 0;
 	var distance = 0;
 	var onMouseDownValue = 0;
 	var onMouseDownValue = 0;
 
 
+	var pointer = new THREE.Vector2();
+	var prevPointer = new THREE.Vector2();
+
 	var onMouseDown = function ( event ) {
 	var onMouseDown = function ( event ) {
 
 
 		event.preventDefault();
 		event.preventDefault();
@@ -755,6 +776,8 @@ UI.Integer = function ( number ) {
 
 
 		onMouseDownValue = parseFloat( dom.value );
 		onMouseDownValue = parseFloat( dom.value );
 
 
+		prevPointer.set( event.clientX, event.clientY );
+
 		document.addEventListener( 'mousemove', onMouseMove, false );
 		document.addEventListener( 'mousemove', onMouseMove, false );
 		document.addEventListener( 'mouseup', onMouseUp, false );
 		document.addEventListener( 'mouseup', onMouseUp, false );
 
 
@@ -764,10 +787,9 @@ UI.Integer = function ( number ) {
 
 
 		var currentValue = dom.value;
 		var currentValue = dom.value;
 
 
-		var movementX = event.movementX || event.webkitMovementX || event.mozMovementX || 0;
-		var movementY = event.movementY || event.webkitMovementY || event.mozMovementY || 0;
+		pointer.set( event.clientX, event.clientY );
 
 
-		distance += movementX - movementY;
+		distance += ( pointer.x - prevPointer.x ) - ( pointer.y - prevPointer.y );
 
 
 		var number = onMouseDownValue + ( distance / ( event.shiftKey ? 5 : 50 ) ) * scope.step;
 		var number = onMouseDownValue + ( distance / ( event.shiftKey ? 5 : 50 ) ) * scope.step;
 
 
@@ -775,6 +797,8 @@ UI.Integer = function ( number ) {
 
 
 		if ( currentValue !== dom.value ) dom.dispatchEvent( changeEvent );
 		if ( currentValue !== dom.value ) dom.dispatchEvent( changeEvent );
 
 
+		prevPointer.set( event.clientX, event.clientY );
+
 	};
 	};
 
 
 	var onMouseUp = function ( event ) {
 	var onMouseUp = function ( event ) {

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