Browse Source

Updated builds.

Mr.doob 9 years ago
parent
commit
7a304219c3
2 changed files with 619 additions and 426 deletions
  1. 338 147
      build/three.js
  2. 281 279
      build/three.min.js

+ 338 - 147
build/three.js

@@ -10524,7 +10524,8 @@
 
 
 		this.userData = {};
 		this.userData = {};
 
 
-		this.onBeforeRender = null;
+		this.onBeforeRender = function(){}; 
+		this.onAfterRender = function(){};
 
 
 	}
 	}
 
 
@@ -20431,8 +20432,6 @@
 
 
 			}
 			}
 
 
-			var fog = scene.fog;
-
 			// reset caching for this frame
 			// reset caching for this frame
 
 
 			_currentGeometryProgram = '';
 			_currentGeometryProgram = '';
@@ -20553,19 +20552,19 @@
 
 
 				var overrideMaterial = scene.overrideMaterial;
 				var overrideMaterial = scene.overrideMaterial;
 
 
-				renderObjects( opaqueObjects, camera, fog, overrideMaterial );
-				renderObjects( transparentObjects, camera, fog, overrideMaterial );
+				renderObjects( opaqueObjects, scene, camera, overrideMaterial );
+				renderObjects( transparentObjects, scene, camera, overrideMaterial );
 
 
 			} else {
 			} else {
 
 
 				// opaque pass (front-to-back order)
 				// opaque pass (front-to-back order)
 
 
 				state.setBlending( NoBlending );
 				state.setBlending( NoBlending );
-				renderObjects( opaqueObjects, camera, fog );
+				renderObjects( opaqueObjects, scene, camera );
 
 
 				// transparent pass (back-to-front order)
 				// transparent pass (back-to-front order)
 
 
-				renderObjects( transparentObjects, camera, fog );
+				renderObjects( transparentObjects, scene, camera );
 
 
 			}
 			}
 
 
@@ -20792,7 +20791,7 @@
 
 
 		}
 		}
 
 
-		function renderObjects( renderList, camera, fog, overrideMaterial ) {
+		function renderObjects( renderList, scene, camera, overrideMaterial ) {
 
 
 			for ( var i = 0, l = renderList.length; i < l; i ++ ) {
 			for ( var i = 0, l = renderList.length; i < l; i ++ ) {
 
 
@@ -20806,11 +20805,13 @@
 				object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
 				object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
 				object.normalMatrix.getNormalMatrix( object.modelViewMatrix );
 				object.normalMatrix.getNormalMatrix( object.modelViewMatrix );
 
 
+				object.onBeforeRender( _this, scene, camera, geometry, material, group );
+
 				if ( object.isImmediateRenderObject ) {
 				if ( object.isImmediateRenderObject ) {
 
 
 					setMaterial( material );
 					setMaterial( material );
 
 
-					var program = setProgram( camera, fog, material, object );
+					var program = setProgram( camera, scene.fog, material, object );
 
 
 					_currentGeometryProgram = '';
 					_currentGeometryProgram = '';
 
 
@@ -20822,12 +20823,13 @@
 
 
 				} else {
 				} else {
 
 
-					if ( object.onBeforeRender !== null ) object.onBeforeRender();
-
-					_this.renderBufferDirect( camera, fog, geometry, material, object, group );
+					_this.renderBufferDirect( camera, scene.fog, geometry, material, object, group );
 
 
 				}
 				}
 
 
+				object.onAfterRender( _this, scene, camera, geometry, material, group );
+
+
 			}
 			}
 
 
 		}
 		}
@@ -21388,7 +21390,7 @@
 			uniforms.diffuse.value = material.color;
 			uniforms.diffuse.value = material.color;
 			uniforms.opacity.value = material.opacity;
 			uniforms.opacity.value = material.opacity;
 			uniforms.size.value = material.size * _pixelRatio;
 			uniforms.size.value = material.size * _pixelRatio;
-			uniforms.scale.value = _canvas.clientHeight * 0.5;
+			uniforms.scale.value = _height * 0.5;
 
 
 			uniforms.map.value = material.map;
 			uniforms.map.value = material.map;
 
 
@@ -23892,16 +23894,14 @@
 	ParametricGeometry.prototype.constructor = ParametricGeometry;
 	ParametricGeometry.prototype.constructor = ParametricGeometry;
 
 
 	/**
 	/**
-	 * @author clockworkgeek / https://github.com/clockworkgeek
-	 * @author timothypratley / https://github.com/timothypratley
-	 * @author WestLangley / http://github.com/WestLangley
-	*/
+	 * @author Mugen87 / https://github.com/Mugen87
+	 */
 
 
-	function PolyhedronGeometry( vertices, indices, radius, detail ) {
+	function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
 
 
-		Geometry.call( this );
+		BufferGeometry.call( this );
 
 
-		this.type = 'PolyhedronGeometry';
+		this.type = 'PolyhedronBufferGeometry';
 
 
 		this.parameters = {
 		this.parameters = {
 			vertices: vertices,
 			vertices: vertices,
@@ -23913,187 +23913,261 @@
 		radius = radius || 1;
 		radius = radius || 1;
 		detail = detail || 0;
 		detail = detail || 0;
 
 
-		var that = this;
+		// default buffer data
 
 
-		for ( var i = 0, l = vertices.length; i < l; i += 3 ) {
+		var vertexBuffer = [];
+		var uvBuffer = [];
 
 
-			prepare( new Vector3( vertices[ i ], vertices[ i + 1 ], vertices[ i + 2 ] ) );
+		// the subdivision creates the vertex buffer data
 
 
-		}
+		subdivide( detail );
 
 
-		var p = this.vertices;
+		// all vertices should lie on a conceptual sphere with a given radius
 
 
-		var faces = [];
+		appplyRadius( radius );
 
 
-		for ( var i = 0, j = 0, l = indices.length; i < l; i += 3, j ++ ) {
+		// finally, create the uv data
 
 
-			var v1 = p[ indices[ i ] ];
-			var v2 = p[ indices[ i + 1 ] ];
-			var v3 = p[ indices[ i + 2 ] ];
+		generateUVs();
 
 
-			faces[ j ] = new Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] );
+		// build non-indexed geometry
 
 
-		}
+		this.addAttribute( 'position', Float32Attribute( vertexBuffer, 3 ) );
+		this.addAttribute( 'normal', Float32Attribute( vertexBuffer.slice(), 3 ) );
+		this.addAttribute( 'uv', Float32Attribute( uvBuffer, 2 ) );
+		this.normalizeNormals();
 
 
-		var centroid = new Vector3();
+		this.boundingSphere = new Sphere( new Vector3(), radius );
 
 
-		for ( var i = 0, l = faces.length; i < l; i ++ ) {
+		// helper functions
+
+		function subdivide( detail ) {
+
+			var a = new Vector3();
+			var b = new Vector3();
+			var c = new Vector3();
+
+			// iterate over all faces and apply a subdivison with the given detail value
+
+			for ( var i = 0; i < indices.length; i += 3 ) {
+
+				// get the vertices of the face
+
+				getVertexByIndex( indices[ i + 0 ], a );
+				getVertexByIndex( indices[ i + 1 ], b );
+				getVertexByIndex( indices[ i + 2 ], c );
+
+				// perform subdivision
 
 
-			subdivide( faces[ i ], detail );
+				subdivideFace( a, b, c, detail );
+
+			}
 
 
 		}
 		}
 
 
+		function subdivideFace( a, b, c, detail ) {
 
 
-		// Handle case when face straddles the seam
+			var cols = Math.pow( 2, detail );
 
 
-		for ( var i = 0, l = this.faceVertexUvs[ 0 ].length; i < l; i ++ ) {
+			// we use this multidimensional array as a data structure for creating the subdivision
 
 
-			var uvs = this.faceVertexUvs[ 0 ][ i ];
+			var v = [];
 
 
-			var x0 = uvs[ 0 ].x;
-			var x1 = uvs[ 1 ].x;
-			var x2 = uvs[ 2 ].x;
+			var i, j;
 
 
-			var max = Math.max( x0, x1, x2 );
-			var min = Math.min( x0, x1, x2 );
+			// construct all of the vertices for this subdivision
 
 
-			if ( max > 0.9 && min < 0.1 ) {
+			for ( i = 0 ; i <= cols; i ++ ) {
 
 
-				// 0.9 is somewhat arbitrary
+				v[ i ] = [];
 
 
-				if ( x0 < 0.2 ) uvs[ 0 ].x += 1;
-				if ( x1 < 0.2 ) uvs[ 1 ].x += 1;
-				if ( x2 < 0.2 ) uvs[ 2 ].x += 1;
+				var aj = a.clone().lerp( c, i / cols );
+				var bj = b.clone().lerp( c, i / cols );
 
 
-			}
+				var rows = cols - i;
 
 
-		}
+				for ( j = 0; j <= rows; j ++ ) {
 
 
+					if ( j === 0 && i === cols ) {
 
 
-		// Apply radius
+						v[ i ][ j ] = aj;
 
 
-		for ( var i = 0, l = this.vertices.length; i < l; i ++ ) {
+					} else {
 
 
-			this.vertices[ i ].multiplyScalar( radius );
+						v[ i ][ j ] = aj.clone().lerp( bj, j / rows );
 
 
-		}
+					}
 
 
+				}
 
 
-		// Merge vertices
+			}
 
 
-		this.mergeVertices();
+			// construct all of the faces
 
 
-		this.computeFaceNormals();
+			for ( i = 0; i < cols ; i ++ ) {
 
 
-		this.boundingSphere = new Sphere( new Vector3(), radius );
+				for ( j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {
+
+					var k = Math.floor( j / 2 );
 
 
+					if ( j % 2 === 0 ) {
 
 
-		// Project vector onto sphere's surface
+						pushVertex( v[ i ][ k + 1 ] );
+						pushVertex( v[ i + 1 ][ k ] );
+						pushVertex( v[ i ][ k ] );
 
 
-		function prepare( vector ) {
+					} else {
 
 
-			var vertex = vector.normalize().clone();
-			vertex.index = that.vertices.push( vertex ) - 1;
+						pushVertex( v[ i ][ k + 1 ] );
+						pushVertex( v[ i + 1 ][ k + 1 ] );
+						pushVertex( v[ i + 1 ][ k ] );
 
 
-			// Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle.
+					}
 
 
-			var u = azimuth( vector ) / 2 / Math.PI + 0.5;
-			var v = inclination( vector ) / Math.PI + 0.5;
-			vertex.uv = new Vector2( u, 1 - v );
+				}
 
 
-			return vertex;
+			}
 
 
 		}
 		}
 
 
+		function appplyRadius( radius ) {
 
 
-		// Approximate a curved face with recursively sub-divided triangles.
+			var vertex = new Vector3();
 
 
-		function make( v1, v2, v3 ) {
+			// iterate over the entire buffer and apply the radius to each vertex
 
 
-			var face = new Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] );
-			that.faces.push( face );
+			for ( var i = 0; i < vertexBuffer.length; i += 3 ) {
 
 
-			centroid.copy( v1 ).add( v2 ).add( v3 ).divideScalar( 3 );
+				vertex.x = vertexBuffer[ i + 0 ];
+				vertex.y = vertexBuffer[ i + 1 ];
+				vertex.z = vertexBuffer[ i + 2 ];
 
 
-			var azi = azimuth( centroid );
+				vertex.normalize().multiplyScalar( radius );
 
 
-			that.faceVertexUvs[ 0 ].push( [
-				correctUV( v1.uv, v1, azi ),
-				correctUV( v2.uv, v2, azi ),
-				correctUV( v3.uv, v3, azi )
-			] );
+				vertexBuffer[ i + 0 ] = vertex.x;
+				vertexBuffer[ i + 1 ] = vertex.y;
+				vertexBuffer[ i + 2 ] = vertex.z;
+
+			}
 
 
 		}
 		}
 
 
+		function generateUVs() {
 
 
-		// Analytically subdivide a face to the required detail level.
+			var vertex = new Vector3();
 
 
-		function subdivide( face, detail ) {
+			for ( var i = 0; i < vertexBuffer.length; i += 3 ) {
 
 
-			var cols = Math.pow( 2, detail );
-			var a = prepare( that.vertices[ face.a ] );
-			var b = prepare( that.vertices[ face.b ] );
-			var c = prepare( that.vertices[ face.c ] );
-			var v = [];
+				vertex.x = vertexBuffer[ i + 0 ];
+				vertex.y = vertexBuffer[ i + 1 ];
+				vertex.z = vertexBuffer[ i + 2 ];
 
 
-			// Construct all of the vertices for this subdivision.
+				var u = azimuth( vertex ) / 2 / Math.PI + 0.5;
+				var v = inclination( vertex ) / Math.PI + 0.5;
+				uvBuffer.push( u, 1 - v );
 
 
-			for ( var i = 0 ; i <= cols; i ++ ) {
+			}
 
 
-				v[ i ] = [];
+			correctUVs();
 
 
-				var aj = prepare( a.clone().lerp( c, i / cols ) );
-				var bj = prepare( b.clone().lerp( c, i / cols ) );
-				var rows = cols - i;
+			correctSeam();
 
 
-				for ( var j = 0; j <= rows; j ++ ) {
+		}
 
 
-					if ( j === 0 && i === cols ) {
+		function correctSeam() {
 
 
-						v[ i ][ j ] = aj;
+			// handle case when face straddles the seam, see #3269
 
 
-					} else {
+			for ( var i = 0; i < uvBuffer.length; i += 6 ) {
 
 
-						v[ i ][ j ] = prepare( aj.clone().lerp( bj, j / rows ) );
+				// uv data of a single face
 
 
-					}
+				var x0 = uvBuffer[ i + 0 ];
+				var x1 = uvBuffer[ i + 2 ];
+				var x2 = uvBuffer[ i + 4 ];
+
+				var max = Math.max( x0, x1, x2 );
+				var min = Math.min( x0, x1, x2 );
+
+				// 0.9 is somewhat arbitrary
+
+				if ( max > 0.9 && min < 0.1 ) {
+
+					if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1;
+					if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1;
+					if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1;
 
 
 				}
 				}
 
 
 			}
 			}
 
 
-			// Construct all of the faces.
+		}
 
 
-			for ( var i = 0; i < cols ; i ++ ) {
+		function pushVertex( vertex ) {
 
 
-				for ( var j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {
+			vertexBuffer.push( vertex.x, vertex.y, vertex.z );
 
 
-					var k = Math.floor( j / 2 );
+		}
 
 
-					if ( j % 2 === 0 ) {
+		function getVertexByIndex( index, vertex ) {
 
 
-						make(
-							v[ i ][ k + 1 ],
-							v[ i + 1 ][ k ],
-							v[ i ][ k ]
-						);
+			var stride = index * 3;
 
 
-					} else {
+			vertex.x = vertices[ stride + 0 ];
+			vertex.y = vertices[ stride + 1 ];
+			vertex.z = vertices[ stride + 2 ];
 
 
-						make(
-							v[ i ][ k + 1 ],
-							v[ i + 1 ][ k + 1 ],
-							v[ i + 1 ][ k ]
-						);
+		}
 
 
-					}
+		function correctUVs() {
 
 
-				}
+			var a = new Vector3();
+			var b = new Vector3();
+			var c = new Vector3();
+
+			var centroid = new Vector3();
+
+			var uvA = new Vector2();
+			var uvB = new Vector2();
+			var uvC = new Vector2();
+
+			for ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) {
+
+				a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );
+				b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );
+				c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );
+
+				uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );
+				uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );
+				uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );
+
+				centroid.copy( a ).add( b ).add( c ).divideScalar( 3 );
+
+				var azi = azimuth( centroid );
+
+				correctUV( uvA, j + 0, a, azi );
+				correctUV( uvB, j + 2, b, azi );
+				correctUV( uvC, j + 4, c, azi );
 
 
 			}
 			}
 
 
 		}
 		}
 
 
+		function correctUV( uv, stride, vector, azimuth  ) {
+
+			if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) {
+
+				uvBuffer[ stride ] =  uv.x - 1;
+
+			}
+
+			if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) {
+
+				uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;
+
+			}
+
+		}
 
 
 		// Angle around the Y axis, counter-clockwise when looking from above.
 		// Angle around the Y axis, counter-clockwise when looking from above.
 
 
@@ -24112,21 +24186,38 @@
 
 
 		}
 		}
 
 
+	}
 
 
-		// Texture fixing helper. Spheres have some odd behaviours.
+	PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
+	PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry;
 
 
-		function correctUV( uv, vector, azimuth ) {
+	/**
+	 * @author Mugen87 / https://github.com/Mugen87
+	 */
 
 
-			if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new Vector2( uv.x - 1, uv.y );
-			if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );
-			return uv.clone();
+	function TetrahedronBufferGeometry( radius, detail ) {
 
 
-		}
+		var vertices = [
+			1,  1,  1,   - 1, - 1,  1,   - 1,  1, - 1,    1, - 1, - 1
+		];
+
+		var indices = [
+			2,  1,  0,    0,  3,  2,    1,  3,  0,    2,  3,  1
+		];
+
+		PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );
+
+		this.type = 'TetrahedronBufferGeometry';
+
+		this.parameters = {
+			radius: radius,
+			detail: detail
+		};
 
 
 	}
 	}
 
 
-	PolyhedronGeometry.prototype = Object.create( Geometry.prototype );
-	PolyhedronGeometry.prototype.constructor = PolyhedronGeometry;
+	TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );
+	TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry;
 
 
 	/**
 	/**
 	 * @author timothypratley / https://github.com/timothypratley
 	 * @author timothypratley / https://github.com/timothypratley
@@ -24134,15 +24225,7 @@
 
 
 	function TetrahedronGeometry( radius, detail ) {
 	function TetrahedronGeometry( radius, detail ) {
 
 
-		var vertices = [
-			 1,  1,  1,   - 1, - 1,  1,   - 1,  1, - 1,    1, - 1, - 1
-		];
-
-		var indices = [
-			 2,  1,  0,    0,  3,  2,    1,  3,  0,    2,  3,  1
-		];
-
-		PolyhedronGeometry.call( this, vertices, indices, radius, detail );
+		Geometry.call( this );
 
 
 		this.type = 'TetrahedronGeometry';
 		this.type = 'TetrahedronGeometry';
 
 
@@ -24151,16 +24234,19 @@
 			detail: detail
 			detail: detail
 		};
 		};
 
 
+		this.fromBufferGeometry( new THREE.TetrahedronBufferGeometry( radius, detail ) );
+		this.mergeVertices();
+
 	}
 	}
 
 
-	TetrahedronGeometry.prototype = Object.create( PolyhedronGeometry.prototype );
+	TetrahedronGeometry.prototype = Object.create( Geometry.prototype );
 	TetrahedronGeometry.prototype.constructor = TetrahedronGeometry;
 	TetrahedronGeometry.prototype.constructor = TetrahedronGeometry;
 
 
 	/**
 	/**
-	 * @author timothypratley / https://github.com/timothypratley
+	 * @author Mugen87 / https://github.com/Mugen87
 	 */
 	 */
 
 
-	function OctahedronGeometry( radius, detail ) {
+	function OctahedronBufferGeometry( radius,detail ) {
 
 
 		var vertices = [
 		var vertices = [
 			1, 0, 0,   - 1, 0, 0,    0, 1, 0,    0, - 1, 0,    0, 0, 1,    0, 0, - 1
 			1, 0, 0,   - 1, 0, 0,    0, 1, 0,    0, - 1, 0,    0, 0, 1,    0, 0, - 1
@@ -24170,7 +24256,27 @@
 			0, 2, 4,    0, 4, 3,    0, 3, 5,    0, 5, 2,    1, 2, 5,    1, 5, 3,    1, 3, 4,    1, 4, 2
 			0, 2, 4,    0, 4, 3,    0, 3, 5,    0, 5, 2,    1, 2, 5,    1, 5, 3,    1, 3, 4,    1, 4, 2
 		];
 		];
 
 
-		PolyhedronGeometry.call( this, vertices, indices, radius, detail );
+		PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );
+
+		this.type = 'OctahedronBufferGeometry';
+
+		this.parameters = {
+			radius: radius,
+			detail: detail
+		};
+
+	}
+
+	OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );
+	OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry;
+
+	/**
+	 * @author timothypratley / https://github.com/timothypratley
+	 */
+
+	function OctahedronGeometry( radius, detail ) {
+
+		Geometry.call( this );
 
 
 		this.type = 'OctahedronGeometry';
 		this.type = 'OctahedronGeometry';
 
 
@@ -24179,16 +24285,19 @@
 			detail: detail
 			detail: detail
 		};
 		};
 
 
+		this.fromBufferGeometry( new THREE.OctahedronBufferGeometry( radius, detail ) );
+		this.mergeVertices();
+
 	}
 	}
 
 
-	OctahedronGeometry.prototype = Object.create( PolyhedronGeometry.prototype );
+	OctahedronGeometry.prototype = Object.create( Geometry.prototype );
 	OctahedronGeometry.prototype.constructor = OctahedronGeometry;
 	OctahedronGeometry.prototype.constructor = OctahedronGeometry;
 
 
 	/**
 	/**
-	 * @author timothypratley / https://github.com/timothypratley
+	 * @author Mugen87 / https://github.com/Mugen87
 	 */
 	 */
 
 
-	function IcosahedronGeometry( radius, detail ) {
+	function IcosahedronBufferGeometry( radius, detail ) {
 
 
 		var t = ( 1 + Math.sqrt( 5 ) ) / 2;
 		var t = ( 1 + Math.sqrt( 5 ) ) / 2;
 
 
@@ -24205,7 +24314,27 @@
 			 4,  9,  5,    2,  4, 11,    6,  2, 10,    8,  6,  7,    9,  8,  1
 			 4,  9,  5,    2,  4, 11,    6,  2, 10,    8,  6,  7,    9,  8,  1
 		];
 		];
 
 
-		PolyhedronGeometry.call( this, vertices, indices, radius, detail );
+		PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );
+
+		this.type = 'IcosahedronBufferGeometry';
+
+		this.parameters = {
+			radius: radius,
+			detail: detail
+		};
+
+	}
+
+	IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );
+	IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry;
+
+	/**
+	 * @author timothypratley / https://github.com/timothypratley
+	 */
+
+	function IcosahedronGeometry( radius, detail ) {
+
+	 	Geometry.call( this );
 
 
 		this.type = 'IcosahedronGeometry';
 		this.type = 'IcosahedronGeometry';
 
 
@@ -24214,16 +24343,19 @@
 			detail: detail
 			detail: detail
 		};
 		};
 
 
+		this.fromBufferGeometry( new THREE.IcosahedronBufferGeometry( radius, detail ) );
+		this.mergeVertices();
+
 	}
 	}
 
 
-	IcosahedronGeometry.prototype = Object.create( PolyhedronGeometry.prototype );
+	IcosahedronGeometry.prototype = Object.create( Geometry.prototype );
 	IcosahedronGeometry.prototype.constructor = IcosahedronGeometry;
 	IcosahedronGeometry.prototype.constructor = IcosahedronGeometry;
 
 
 	/**
 	/**
-	 * @author Abe Pazos / https://hamoid.com
+	 * @author Mugen87 / https://github.com/Mugen87
 	 */
 	 */
 
 
-	function DodecahedronGeometry( radius, detail ) {
+	function DodecahedronBufferGeometry( radius, detail ) {
 
 
 		var t = ( 1 + Math.sqrt( 5 ) ) / 2;
 		var t = ( 1 + Math.sqrt( 5 ) ) / 2;
 		var r = 1 / t;
 		var r = 1 / t;
@@ -24264,7 +24396,27 @@
 			 1, 12, 14,      1, 14,  5,      1,  5,  9
 			 1, 12, 14,      1, 14,  5,      1,  5,  9
 		];
 		];
 
 
-		PolyhedronGeometry.call( this, vertices, indices, radius, detail );
+		PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );
+
+		this.type = 'DodecahedronBufferGeometry';
+
+		this.parameters = {
+			radius: radius,
+			detail: detail
+		};
+
+	}
+
+	DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );
+	DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry;
+
+	/**
+	 * @author Abe Pazos / https://hamoid.com
+	 */
+
+	function DodecahedronGeometry( radius, detail ) {
+
+		Geometry.call( this );
 
 
 		this.type = 'DodecahedronGeometry';
 		this.type = 'DodecahedronGeometry';
 
 
@@ -24273,11 +24425,41 @@
 			detail: detail
 			detail: detail
 		};
 		};
 
 
+		this.fromBufferGeometry( new THREE.DodecahedronBufferGeometry( radius, detail ) );
+		this.mergeVertices();
+
 	}
 	}
 
 
-	DodecahedronGeometry.prototype = Object.create( PolyhedronGeometry.prototype );
+	DodecahedronGeometry.prototype = Object.create( Geometry.prototype );
 	DodecahedronGeometry.prototype.constructor = DodecahedronGeometry;
 	DodecahedronGeometry.prototype.constructor = DodecahedronGeometry;
 
 
+	/**
+	 * @author clockworkgeek / https://github.com/clockworkgeek
+	 * @author timothypratley / https://github.com/timothypratley
+	 * @author WestLangley / http://github.com/WestLangley
+	*/
+
+	function PolyhedronGeometry( vertices, indices, radius, detail ) {
+
+		Geometry.call( this );
+
+		this.type = 'PolyhedronGeometry';
+
+		this.parameters = {
+			vertices: vertices,
+			indices: indices,
+			radius: radius,
+			detail: detail
+		};
+
+		this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) );
+		this.mergeVertices();
+
+	}
+
+	PolyhedronGeometry.prototype = Object.create( Geometry.prototype );
+	PolyhedronGeometry.prototype.constructor = PolyhedronGeometry;
+
 	/**
 	/**
 	 * @author WestLangley / https://github.com/WestLangley
 	 * @author WestLangley / https://github.com/WestLangley
 	 * @author zz85 / https://github.com/zz85
 	 * @author zz85 / https://github.com/zz85
@@ -27704,12 +27886,16 @@
 	var Geometries = Object.freeze({
 	var Geometries = Object.freeze({
 		WireframeGeometry: WireframeGeometry,
 		WireframeGeometry: WireframeGeometry,
 		ParametricGeometry: ParametricGeometry,
 		ParametricGeometry: ParametricGeometry,
-		ParametricBufferGeometry: ParametricBufferGeometry,
 		TetrahedronGeometry: TetrahedronGeometry,
 		TetrahedronGeometry: TetrahedronGeometry,
+		TetrahedronBufferGeometry: TetrahedronBufferGeometry,
 		OctahedronGeometry: OctahedronGeometry,
 		OctahedronGeometry: OctahedronGeometry,
+		OctahedronBufferGeometry: OctahedronBufferGeometry,
 		IcosahedronGeometry: IcosahedronGeometry,
 		IcosahedronGeometry: IcosahedronGeometry,
+		IcosahedronBufferGeometry: IcosahedronBufferGeometry,
 		DodecahedronGeometry: DodecahedronGeometry,
 		DodecahedronGeometry: DodecahedronGeometry,
+		DodecahedronBufferGeometry: DodecahedronBufferGeometry,
 		PolyhedronGeometry: PolyhedronGeometry,
 		PolyhedronGeometry: PolyhedronGeometry,
+		PolyhedronBufferGeometry: PolyhedronBufferGeometry,
 		TubeGeometry: TubeGeometry,
 		TubeGeometry: TubeGeometry,
 		TorusKnotGeometry: TorusKnotGeometry,
 		TorusKnotGeometry: TorusKnotGeometry,
 		TorusKnotBufferGeometry: TorusKnotBufferGeometry,
 		TorusKnotBufferGeometry: TorusKnotBufferGeometry,
@@ -38417,6 +38603,7 @@
 			this.startTime = ( performance || Date ).now();
 			this.startTime = ( performance || Date ).now();
 
 
 			this.oldTime = this.startTime;
 			this.oldTime = this.startTime;
+			this.elapsedTime = 0;
 			this.running = true;
 			this.running = true;
 
 
 		},
 		},
@@ -41559,12 +41746,16 @@
 	exports.Curve = Curve;
 	exports.Curve = Curve;
 	exports.WireframeGeometry = WireframeGeometry;
 	exports.WireframeGeometry = WireframeGeometry;
 	exports.ParametricGeometry = ParametricGeometry;
 	exports.ParametricGeometry = ParametricGeometry;
-	exports.ParametricBufferGeometry = ParametricBufferGeometry;
 	exports.TetrahedronGeometry = TetrahedronGeometry;
 	exports.TetrahedronGeometry = TetrahedronGeometry;
+	exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry;
 	exports.OctahedronGeometry = OctahedronGeometry;
 	exports.OctahedronGeometry = OctahedronGeometry;
+	exports.OctahedronBufferGeometry = OctahedronBufferGeometry;
 	exports.IcosahedronGeometry = IcosahedronGeometry;
 	exports.IcosahedronGeometry = IcosahedronGeometry;
+	exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry;
 	exports.DodecahedronGeometry = DodecahedronGeometry;
 	exports.DodecahedronGeometry = DodecahedronGeometry;
+	exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry;
 	exports.PolyhedronGeometry = PolyhedronGeometry;
 	exports.PolyhedronGeometry = PolyhedronGeometry;
+	exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry;
 	exports.TubeGeometry = TubeGeometry;
 	exports.TubeGeometry = TubeGeometry;
 	exports.TorusKnotGeometry = TorusKnotGeometry;
 	exports.TorusKnotGeometry = TorusKnotGeometry;
 	exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry;
 	exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry;

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


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