소스 검색

Merge branch 'dev' into vec3-applyMatrix4-applyProjection

Franklin Ta 8 년 전
부모
커밋
e6182d73d5

+ 84 - 79
build/three.js

@@ -96,7 +96,7 @@
 
 	function EventDispatcher() {}
 
-	Object.assign( EventDispatcher.prototype, {
+	EventDispatcher.prototype = {
 
 		addEventListener: function ( type, listener ) {
 
@@ -179,7 +179,7 @@
 
 		}
 
-	} );
+	};
 
 	var REVISION = '84dev';
 	var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
@@ -1909,7 +1909,9 @@
 
 	}
 
-	Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
+	WebGLRenderTarget.prototype = {
+
+		constructor: WebGLRenderTarget,
 
 		isWebGLRenderTarget: true,
 
@@ -1958,7 +1960,9 @@
 
 		}
 
-	} );
+	};
+
+	Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype );
 
 	/**
 	 * @author alteredq / http://alteredqualia.com
@@ -4173,7 +4177,13 @@
 
 		}(),
 
-		makeFrustum: function ( left, right, bottom, top, near, far ) {
+		makePerspective: function ( left, right, top, bottom, near, far ) {
+
+			if ( far === undefined ) {
+
+				console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );
+
+			}
 
 			var te = this.elements;
 			var x = 2 * near / ( right - left );
@@ -4193,17 +4203,6 @@
 
 		},
 
-		makePerspective: function ( fov, aspect, near, far ) {
-
-			var ymax = near * Math.tan( _Math.DEG2RAD * fov * 0.5 );
-			var ymin = - ymax;
-			var xmin = ymin * aspect;
-			var xmax = ymax * aspect;
-
-			return this.makeFrustum( xmin, xmax, ymin, ymax, near, far );
-
-		},
-
 		makeOrthographic: function ( left, right, top, bottom, near, far ) {
 
 			var te = this.elements;
@@ -7259,7 +7258,7 @@
 
 					currentValue.set( newValue );
 
-				} else if ( (currentValue && currentValue.isVector3) && (newValue && newValue.isVector3) ) {
+				} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {
 
 					currentValue.copy( newValue );
 
@@ -10519,7 +10518,9 @@
 	Object3D.DefaultUp = new Vector3( 0, 1, 0 );
 	Object3D.DefaultMatrixAutoUpdate = true;
 
-	Object.assign( Object3D.prototype, EventDispatcher.prototype, {
+	Object3D.prototype = {
+
+		constructor: Object3D,
 
 		isObject3D: true,
 
@@ -11146,7 +11147,9 @@
 
 		}
 
-	} );
+	};
+
+	Object.assign( Object3D.prototype, EventDispatcher.prototype );
 
 	/**
 	 * @author bhouston / http://clara.io
@@ -12398,6 +12401,9 @@
 	 * @author bhouston / http://clara.io
 	 */
 
+	var count = 0;
+	function GeometryIdCount() { return count++; }
+
 	function Geometry() {
 
 		Object.defineProperty( this, 'id', { value: GeometryIdCount() } );
@@ -12410,7 +12416,7 @@
 		this.vertices = [];
 		this.colors = [];
 		this.faces = [];
-		this.faceVertexUvs = [ [] ];
+		this.faceVertexUvs = [[]];
 
 		this.morphTargets = [];
 		this.morphNormals = [];
@@ -12435,7 +12441,9 @@
 
 	}
 
-	Object.assign( Geometry.prototype, EventDispatcher.prototype, {
+	Geometry.prototype = {
+
+		constructor: Geometry,
 
 		isGeometry: true,
 
@@ -12687,7 +12695,7 @@
 
 						for ( var j = start, jl = start + count; j < jl; j += 3 ) {
 
-							addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex  );
+							addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex );
 
 						}
 
@@ -13080,7 +13088,7 @@
 
 		merge: function ( geometry, matrix, materialIndexOffset ) {
 
-			if ( (geometry && geometry.isGeometry) === false ) {
+			if ( ( geometry && geometry.isGeometry ) === false ) {
 
 				console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );
 				return;
@@ -13200,7 +13208,7 @@
 
 		mergeMesh: function ( mesh ) {
 
-			if ( (mesh && mesh.isMesh) === false ) {
+			if ( ( mesh && mesh.isMesh ) === false ) {
 
 				console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );
 				return;
@@ -13265,15 +13273,12 @@
 
 				indices = [ face.a, face.b, face.c ];
 
-				var dupIndex = - 1;
-
 				// if any duplicate vertices are found in a Face3
 				// we have to remove the face as nothing can be saved
 				for ( var n = 0; n < 3; n ++ ) {
 
 					if ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) {
 
-						dupIndex = n;
 						faceIndicesToRemove.push( i );
 						break;
 
@@ -13644,10 +13649,9 @@
 
 		}
 
-	} );
+	};
 
-	var count = 0;
-	function GeometryIdCount() { return count++; }
+	Object.assign( Geometry.prototype, EventDispatcher.prototype );
 
 	/**
 	 * @author alteredq / http://alteredqualia.com/
@@ -13677,7 +13681,9 @@
 
 	}
 
-	Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
+	BufferGeometry.prototype = {
+
+		constructor: BufferGeometry,
 
 		isBufferGeometry: true,
 
@@ -14672,10 +14678,12 @@
 
 		}
 
-	} );
+	};
 
 	BufferGeometry.MaxIndex = 65535;
 
+	Object.assign( BufferGeometry.prototype, EventDispatcher.prototype );
+
 	/**
 	 * @author mrdoob / http://mrdoob.com/
 	 * @author alteredq / http://alteredqualia.com/
@@ -15572,8 +15580,7 @@
 			var skew = this.filmOffset;
 			if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
 
-			this.projectionMatrix.makeFrustum(
-					left, left + width, top - height, top, near, this.far );
+			this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
 
 		},
 
@@ -29487,6 +29494,13 @@
 				loader.setPath( this.path );
 				loader.setResponseType( 'blob' );
 				loader.setWithCredentials( this.withCredentials );
+
+				// By default the FileLoader requests files to be loaded with a MIME
+				// type of `text/plain`. Using `URL.createObjectURL()` with SVGs that
+				// have a MIME type of `text/plain` results in an error, so explicitly
+				// set the SVG MIME type.
+				if ( /\.svg$/.test( url ) ) loader.setMimeType( 'image/svg+xml' );
+
 				loader.load( url, function ( blob ) {
 
 					image.src = URL.createObjectURL( blob );
@@ -37980,12 +37994,14 @@
 
 	}
 
-	Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
+	AnimationMixer.prototype = {
+
+		constructor: AnimationMixer,
 
 		// return an action for a clip optionally using a custom root target
 		// object (this method allocates a lot of dynamic memory in case a
 		// previously unknown clip/root combination is specified)
-		clipAction: function( clip, optionalRoot ) {
+		clipAction: function ( clip, optionalRoot ) {
 
 			var root = optionalRoot || this._root,
 				rootUuid = root.uuid,
@@ -38035,7 +38051,7 @@
 		},
 
 		// get an existing action
-		existingAction: function( clip, optionalRoot ) {
+		existingAction: function ( clip, optionalRoot ) {
 
 			var root = optionalRoot || this._root,
 				rootUuid = root.uuid,
@@ -38058,7 +38074,7 @@
 		},
 
 		// deactivates all previously scheduled actions
-		stopAllAction: function() {
+		stopAllAction: function () {
 
 			var actions = this._actions,
 				nActions = this._nActiveActions,
@@ -38085,7 +38101,7 @@
 		},
 
 		// advance the time and update apply the animation
-		update: function( deltaTime ) {
+		update: function ( deltaTime ) {
 
 			deltaTime *= this.timeScale;
 
@@ -38127,14 +38143,14 @@
 		},
 
 		// return this mixer's root target object
-		getRoot: function() {
+		getRoot: function () {
 
 			return this._root;
 
 		},
 
 		// free all resources specific to a particular clip
-		uncacheClip: function( clip ) {
+		uncacheClip: function ( clip ) {
 
 			var actions = this._actions,
 				clipUuid = clip.uuid,
@@ -38176,7 +38192,7 @@
 		},
 
 		// free all resources specific to a particular root target object
-		uncacheRoot: function( root ) {
+		uncacheRoot: function ( root ) {
 
 			var rootUuid = root.uuid,
 				actionsByClip = this._actionsByClip;
@@ -38213,7 +38229,7 @@
 		},
 
 		// remove a targeted clip from the cache
-		uncacheAction: function( clip, optionalRoot ) {
+		uncacheAction: function ( clip, optionalRoot ) {
 
 			var action = this.existingAction( clip, optionalRoot );
 
@@ -38226,13 +38242,13 @@
 
 		}
 
-	} );
+	};
 
 	// Implementation details:
 
 	Object.assign( AnimationMixer.prototype, {
 
-		_bindAction: function( action, prototypeAction ) {
+		_bindAction: function ( action, prototypeAction ) {
 
 			var root = action._localRoot || this._root,
 				tracks = action._clip.tracks,
@@ -38299,7 +38315,7 @@
 
 		},
 
-		_activateAction: function( action ) {
+		_activateAction: function ( action ) {
 
 			if ( ! this._isActiveAction( action ) ) {
 
@@ -38341,7 +38357,7 @@
 
 		},
 
-		_deactivateAction: function( action ) {
+		_deactivateAction: function ( action ) {
 
 			if ( this._isActiveAction( action ) ) {
 
@@ -38369,7 +38385,7 @@
 
 		// Memory manager
 
-		_initMemoryManager: function() {
+		_initMemoryManager: function () {
 
 			this._actions = []; // 'nActiveActions' followed by inactive ones
 			this._nActiveActions = 0;
@@ -38414,14 +38430,14 @@
 
 		// Memory management for AnimationAction objects
 
-		_isActiveAction: function( action ) {
+		_isActiveAction: function ( action ) {
 
 			var index = action._cacheIndex;
 			return index !== null && index < this._nActiveActions;
 
 		},
 
-		_addInactiveAction: function( action, clipUuid, rootUuid ) {
+		_addInactiveAction: function ( action, clipUuid, rootUuid ) {
 
 			var actions = this._actions,
 				actionsByClip = this._actionsByClip,
@@ -38456,7 +38472,7 @@
 
 		},
 
-		_removeInactiveAction: function( action ) {
+		_removeInactiveAction: function ( action ) {
 
 			var actions = this._actions,
 				lastInactiveAction = actions[ actions.length - 1 ],
@@ -38501,7 +38517,7 @@
 
 		},
 
-		_removeInactiveBindingsForAction: function( action ) {
+		_removeInactiveBindingsForAction: function ( action ) {
 
 			var bindings = action._propertyBindings;
 			for ( var i = 0, n = bindings.length; i !== n; ++ i ) {
@@ -38518,7 +38534,7 @@
 
 		},
 
-		_lendAction: function( action ) {
+		_lendAction: function ( action ) {
 
 			// [ active actions |  inactive actions  ]
 			// [  active actions >| inactive actions ]
@@ -38541,7 +38557,7 @@
 
 		},
 
-		_takeBackAction: function( action ) {
+		_takeBackAction: function ( action ) {
 
 			// [  active actions  | inactive actions ]
 			// [ active actions |< inactive actions  ]
@@ -38566,7 +38582,7 @@
 
 		// Memory management for PropertyMixer objects
 
-		_addInactiveBinding: function( binding, rootUuid, trackName ) {
+		_addInactiveBinding: function ( binding, rootUuid, trackName ) {
 
 			var bindingsByRoot = this._bindingsByRootAndName,
 				bindingByName = bindingsByRoot[ rootUuid ],
@@ -38587,7 +38603,7 @@
 
 		},
 
-		_removeInactiveBinding: function( binding ) {
+		_removeInactiveBinding: function ( binding ) {
 
 			var bindings = this._bindings,
 				propBinding = binding.binding,
@@ -38615,7 +38631,7 @@
 
 		},
 
-		_lendBinding: function( binding ) {
+		_lendBinding: function ( binding ) {
 
 			var bindings = this._bindings,
 				prevIndex = binding._cacheIndex,
@@ -38632,7 +38648,7 @@
 
 		},
 
-		_takeBackBinding: function( binding ) {
+		_takeBackBinding: function ( binding ) {
 
 			var bindings = this._bindings,
 				prevIndex = binding._cacheIndex,
@@ -38652,7 +38668,7 @@
 
 		// Memory management of Interpolants for weight and time scale
 
-		_lendControlInterpolant: function() {
+		_lendControlInterpolant: function () {
 
 			var interpolants = this._controlInterpolants,
 				lastActiveIndex = this._nActiveControlInterpolants ++,
@@ -38673,7 +38689,7 @@
 
 		},
 
-		_takeBackControlInterpolant: function( interpolant ) {
+		_takeBackControlInterpolant: function ( interpolant ) {
 
 			var interpolants = this._controlInterpolants,
 				prevIndex = interpolant.__cacheIndex,
@@ -38694,6 +38710,8 @@
 
 	} );
 
+	Object.assign( AnimationMixer.prototype, EventDispatcher.prototype );
+
 	/**
 	 * @author mrdoob / http://mrdoob.com/
 	 */
@@ -42029,6 +42047,12 @@
 
 			console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );
 
+		},
+		makeFrustum: function( left, right, bottom, top, near, far ) {
+
+			console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );
+			return this.makePerspective( left, right, top, bottom, near, far );
+
 		}
 
 	} );
@@ -42474,25 +42498,6 @@
 
 	//
 
-	EventDispatcher.prototype = Object.assign( Object.create( {
-
-		// Note: Extra base ensures these properties are not 'assign'ed.
-
-		constructor: EventDispatcher,
-
-		apply: function ( target ) {
-
-			console.warn( "THREE.EventDispatcher: .apply is deprecated, " +
-					"just inherit or Object.assign the prototype to mix-in." );
-
-			Object.assign( target, this );
-
-		}
-
-	} ), EventDispatcher.prototype );
-
-	//
-
 	Object.assign( WebGLRenderer.prototype, {
 
 		supportsFloatTextures: function () {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 459 - 460
build/three.min.js


+ 84 - 79
build/three.module.js

@@ -90,7 +90,7 @@ if ( Object.assign === undefined ) {
 
 function EventDispatcher() {}
 
-Object.assign( EventDispatcher.prototype, {
+EventDispatcher.prototype = {
 
 	addEventListener: function ( type, listener ) {
 
@@ -173,7 +173,7 @@ Object.assign( EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 var REVISION = '84dev';
 var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
@@ -1903,7 +1903,9 @@ function WebGLRenderTarget( width, height, options ) {
 
 }
 
-Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
+WebGLRenderTarget.prototype = {
+
+	constructor: WebGLRenderTarget,
 
 	isWebGLRenderTarget: true,
 
@@ -1952,7 +1954,9 @@ Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
+
+Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype );
 
 /**
  * @author alteredq / http://alteredqualia.com
@@ -4167,7 +4171,13 @@ Matrix4.prototype = {
 
 	}(),
 
-	makeFrustum: function ( left, right, bottom, top, near, far ) {
+	makePerspective: function ( left, right, top, bottom, near, far ) {
+
+		if ( far === undefined ) {
+
+			console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );
+
+		}
 
 		var te = this.elements;
 		var x = 2 * near / ( right - left );
@@ -4187,17 +4197,6 @@ Matrix4.prototype = {
 
 	},
 
-	makePerspective: function ( fov, aspect, near, far ) {
-
-		var ymax = near * Math.tan( _Math.DEG2RAD * fov * 0.5 );
-		var ymin = - ymax;
-		var xmin = ymin * aspect;
-		var xmax = ymax * aspect;
-
-		return this.makeFrustum( xmin, xmax, ymin, ymax, near, far );
-
-	},
-
 	makeOrthographic: function ( left, right, top, bottom, near, far ) {
 
 		var te = this.elements;
@@ -7253,7 +7252,7 @@ Material.prototype = {
 
 				currentValue.set( newValue );
 
-			} else if ( (currentValue && currentValue.isVector3) && (newValue && newValue.isVector3) ) {
+			} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {
 
 				currentValue.copy( newValue );
 
@@ -10513,7 +10512,9 @@ function Object3D() {
 Object3D.DefaultUp = new Vector3( 0, 1, 0 );
 Object3D.DefaultMatrixAutoUpdate = true;
 
-Object.assign( Object3D.prototype, EventDispatcher.prototype, {
+Object3D.prototype = {
+
+	constructor: Object3D,
 
 	isObject3D: true,
 
@@ -11140,7 +11141,9 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
+
+Object.assign( Object3D.prototype, EventDispatcher.prototype );
 
 /**
  * @author bhouston / http://clara.io
@@ -12392,6 +12395,9 @@ Object.assign( DirectGeometry.prototype, {
  * @author bhouston / http://clara.io
  */
 
+var count = 0;
+function GeometryIdCount() { return count++; }
+
 function Geometry() {
 
 	Object.defineProperty( this, 'id', { value: GeometryIdCount() } );
@@ -12404,7 +12410,7 @@ function Geometry() {
 	this.vertices = [];
 	this.colors = [];
 	this.faces = [];
-	this.faceVertexUvs = [ [] ];
+	this.faceVertexUvs = [[]];
 
 	this.morphTargets = [];
 	this.morphNormals = [];
@@ -12429,7 +12435,9 @@ function Geometry() {
 
 }
 
-Object.assign( Geometry.prototype, EventDispatcher.prototype, {
+Geometry.prototype = {
+
+	constructor: Geometry,
 
 	isGeometry: true,
 
@@ -12681,7 +12689,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 					for ( var j = start, jl = start + count; j < jl; j += 3 ) {
 
-						addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex  );
+						addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex );
 
 					}
 
@@ -13074,7 +13082,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 	merge: function ( geometry, matrix, materialIndexOffset ) {
 
-		if ( (geometry && geometry.isGeometry) === false ) {
+		if ( ( geometry && geometry.isGeometry ) === false ) {
 
 			console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );
 			return;
@@ -13194,7 +13202,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 	mergeMesh: function ( mesh ) {
 
-		if ( (mesh && mesh.isMesh) === false ) {
+		if ( ( mesh && mesh.isMesh ) === false ) {
 
 			console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );
 			return;
@@ -13259,15 +13267,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 			indices = [ face.a, face.b, face.c ];
 
-			var dupIndex = - 1;
-
 			// if any duplicate vertices are found in a Face3
 			// we have to remove the face as nothing can be saved
 			for ( var n = 0; n < 3; n ++ ) {
 
 				if ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) {
 
-					dupIndex = n;
 					faceIndicesToRemove.push( i );
 					break;
 
@@ -13638,10 +13643,9 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
-var count = 0;
-function GeometryIdCount() { return count++; }
+Object.assign( Geometry.prototype, EventDispatcher.prototype );
 
 /**
  * @author alteredq / http://alteredqualia.com/
@@ -13671,7 +13675,9 @@ function BufferGeometry() {
 
 }
 
-Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
+BufferGeometry.prototype = {
+
+	constructor: BufferGeometry,
 
 	isBufferGeometry: true,
 
@@ -14666,10 +14672,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 BufferGeometry.MaxIndex = 65535;
 
+Object.assign( BufferGeometry.prototype, EventDispatcher.prototype );
+
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author alteredq / http://alteredqualia.com/
@@ -15566,8 +15574,7 @@ PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ),
 		var skew = this.filmOffset;
 		if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
 
-		this.projectionMatrix.makeFrustum(
-				left, left + width, top - height, top, near, this.far );
+		this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
 
 	},
 
@@ -29481,6 +29488,13 @@ Object.assign( ImageLoader.prototype, {
 			loader.setPath( this.path );
 			loader.setResponseType( 'blob' );
 			loader.setWithCredentials( this.withCredentials );
+
+			// By default the FileLoader requests files to be loaded with a MIME
+			// type of `text/plain`. Using `URL.createObjectURL()` with SVGs that
+			// have a MIME type of `text/plain` results in an error, so explicitly
+			// set the SVG MIME type.
+			if ( /\.svg$/.test( url ) ) loader.setMimeType( 'image/svg+xml' );
+
 			loader.load( url, function ( blob ) {
 
 				image.src = URL.createObjectURL( blob );
@@ -37974,12 +37988,14 @@ function AnimationMixer( root ) {
 
 }
 
-Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
+AnimationMixer.prototype = {
+
+	constructor: AnimationMixer,
 
 	// return an action for a clip optionally using a custom root target
 	// object (this method allocates a lot of dynamic memory in case a
 	// previously unknown clip/root combination is specified)
-	clipAction: function( clip, optionalRoot ) {
+	clipAction: function ( clip, optionalRoot ) {
 
 		var root = optionalRoot || this._root,
 			rootUuid = root.uuid,
@@ -38029,7 +38045,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// get an existing action
-	existingAction: function( clip, optionalRoot ) {
+	existingAction: function ( clip, optionalRoot ) {
 
 		var root = optionalRoot || this._root,
 			rootUuid = root.uuid,
@@ -38052,7 +38068,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// deactivates all previously scheduled actions
-	stopAllAction: function() {
+	stopAllAction: function () {
 
 		var actions = this._actions,
 			nActions = this._nActiveActions,
@@ -38079,7 +38095,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// advance the time and update apply the animation
-	update: function( deltaTime ) {
+	update: function ( deltaTime ) {
 
 		deltaTime *= this.timeScale;
 
@@ -38121,14 +38137,14 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// return this mixer's root target object
-	getRoot: function() {
+	getRoot: function () {
 
 		return this._root;
 
 	},
 
 	// free all resources specific to a particular clip
-	uncacheClip: function( clip ) {
+	uncacheClip: function ( clip ) {
 
 		var actions = this._actions,
 			clipUuid = clip.uuid,
@@ -38170,7 +38186,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// free all resources specific to a particular root target object
-	uncacheRoot: function( root ) {
+	uncacheRoot: function ( root ) {
 
 		var rootUuid = root.uuid,
 			actionsByClip = this._actionsByClip;
@@ -38207,7 +38223,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// remove a targeted clip from the cache
-	uncacheAction: function( clip, optionalRoot ) {
+	uncacheAction: function ( clip, optionalRoot ) {
 
 		var action = this.existingAction( clip, optionalRoot );
 
@@ -38220,13 +38236,13 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 // Implementation details:
 
 Object.assign( AnimationMixer.prototype, {
 
-	_bindAction: function( action, prototypeAction ) {
+	_bindAction: function ( action, prototypeAction ) {
 
 		var root = action._localRoot || this._root,
 			tracks = action._clip.tracks,
@@ -38293,7 +38309,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_activateAction: function( action ) {
+	_activateAction: function ( action ) {
 
 		if ( ! this._isActiveAction( action ) ) {
 
@@ -38335,7 +38351,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_deactivateAction: function( action ) {
+	_deactivateAction: function ( action ) {
 
 		if ( this._isActiveAction( action ) ) {
 
@@ -38363,7 +38379,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory manager
 
-	_initMemoryManager: function() {
+	_initMemoryManager: function () {
 
 		this._actions = []; // 'nActiveActions' followed by inactive ones
 		this._nActiveActions = 0;
@@ -38408,14 +38424,14 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory management for AnimationAction objects
 
-	_isActiveAction: function( action ) {
+	_isActiveAction: function ( action ) {
 
 		var index = action._cacheIndex;
 		return index !== null && index < this._nActiveActions;
 
 	},
 
-	_addInactiveAction: function( action, clipUuid, rootUuid ) {
+	_addInactiveAction: function ( action, clipUuid, rootUuid ) {
 
 		var actions = this._actions,
 			actionsByClip = this._actionsByClip,
@@ -38450,7 +38466,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_removeInactiveAction: function( action ) {
+	_removeInactiveAction: function ( action ) {
 
 		var actions = this._actions,
 			lastInactiveAction = actions[ actions.length - 1 ],
@@ -38495,7 +38511,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_removeInactiveBindingsForAction: function( action ) {
+	_removeInactiveBindingsForAction: function ( action ) {
 
 		var bindings = action._propertyBindings;
 		for ( var i = 0, n = bindings.length; i !== n; ++ i ) {
@@ -38512,7 +38528,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_lendAction: function( action ) {
+	_lendAction: function ( action ) {
 
 		// [ active actions |  inactive actions  ]
 		// [  active actions >| inactive actions ]
@@ -38535,7 +38551,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_takeBackAction: function( action ) {
+	_takeBackAction: function ( action ) {
 
 		// [  active actions  | inactive actions ]
 		// [ active actions |< inactive actions  ]
@@ -38560,7 +38576,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory management for PropertyMixer objects
 
-	_addInactiveBinding: function( binding, rootUuid, trackName ) {
+	_addInactiveBinding: function ( binding, rootUuid, trackName ) {
 
 		var bindingsByRoot = this._bindingsByRootAndName,
 			bindingByName = bindingsByRoot[ rootUuid ],
@@ -38581,7 +38597,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_removeInactiveBinding: function( binding ) {
+	_removeInactiveBinding: function ( binding ) {
 
 		var bindings = this._bindings,
 			propBinding = binding.binding,
@@ -38609,7 +38625,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_lendBinding: function( binding ) {
+	_lendBinding: function ( binding ) {
 
 		var bindings = this._bindings,
 			prevIndex = binding._cacheIndex,
@@ -38626,7 +38642,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_takeBackBinding: function( binding ) {
+	_takeBackBinding: function ( binding ) {
 
 		var bindings = this._bindings,
 			prevIndex = binding._cacheIndex,
@@ -38646,7 +38662,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory management of Interpolants for weight and time scale
 
-	_lendControlInterpolant: function() {
+	_lendControlInterpolant: function () {
 
 		var interpolants = this._controlInterpolants,
 			lastActiveIndex = this._nActiveControlInterpolants ++,
@@ -38667,7 +38683,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_takeBackControlInterpolant: function( interpolant ) {
+	_takeBackControlInterpolant: function ( interpolant ) {
 
 		var interpolants = this._controlInterpolants,
 			prevIndex = interpolant.__cacheIndex,
@@ -38688,6 +38704,8 @@ Object.assign( AnimationMixer.prototype, {
 
 } );
 
+Object.assign( AnimationMixer.prototype, EventDispatcher.prototype );
+
 /**
  * @author mrdoob / http://mrdoob.com/
  */
@@ -42023,6 +42041,12 @@ Object.assign( Matrix4.prototype, {
 
 		console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );
 
+	},
+	makeFrustum: function( left, right, bottom, top, near, far ) {
+
+		console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );
+		return this.makePerspective( left, right, top, bottom, near, far );
+
 	}
 
 } );
@@ -42468,25 +42492,6 @@ Object.defineProperties( ShaderMaterial.prototype, {
 
 //
 
-EventDispatcher.prototype = Object.assign( Object.create( {
-
-	// Note: Extra base ensures these properties are not 'assign'ed.
-
-	constructor: EventDispatcher,
-
-	apply: function ( target ) {
-
-		console.warn( "THREE.EventDispatcher: .apply is deprecated, " +
-				"just inherit or Object.assign the prototype to mix-in." );
-
-		Object.assign( target, this );
-
-	}
-
-} ), EventDispatcher.prototype );
-
-//
-
 Object.assign( WebGLRenderer.prototype, {
 
 	supportsFloatTextures: function () {

+ 12 - 2
docs/api/cameras/OrthographicCamera.html

@@ -64,7 +64,12 @@ scene.add( camera );</code>
 		<div>Camera frustum bottom plane.</div>
 
 		<h3>[property:Float far]</h3>
-		<div>Camera frustum far plane. Default is *2000*.</div>
+		<div>
+		Camera frustum far plane. Default is *2000*.<br /><br />
+
+		Note that Three does not currently give warnings for incorrect values here, however the expected
+		range is between the current value of the [page:.far far] plane and infinity.
+		</div>
 
 		<h3>[property:Boolean isOrthographicCamera]</h3>
 		<div>
@@ -77,7 +82,12 @@ scene.add( camera );</code>
 		<div>Camera frustum left plane.</div>
 
 		<h3>[property:Float near]</h3>
-		<div>Camera frustum near plane. Default is *0.1*.</div>
+		<div>
+			Camera fustum near plane. Default is *0.1*.<br /><br />
+
+			Note that Three does not currently give warnings for incorrect values here, however the expected
+			range is between 0 and the current value of the [page:.far far] plane.
+		</div>
 
 		<h3>[property:Float right]</h3>
 		<div>Camera frustum right plane.</div>

+ 12 - 2
docs/api/cameras/PerspectiveCamera.html

@@ -54,7 +54,12 @@ scene.add( camera );</code>
 		<div>Camera frustum aspect ratio, usually the canvas width / canvas height. Default is *1* (square canvas).</div>
 
 		<h3>[property:Float far]</h3>
-		<div>Camera frustum far plane. Default is *2000*.</div>
+		<div>
+			Camera frustum far plane. Default is *2000*.<br /><br />
+
+			Note that Three does not currently give warnings for incorrect values here, however the expected
+			range is between the current value of the [page:.far far] plane and infinity.
+		</div>
 
 		<h3>[property:Float filmGauge]</h3>
 		<div>Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.</div>
@@ -80,7 +85,12 @@ scene.add( camera );</code>
 
 
 		<h3>[property:Float near]</h3>
-		<div>Camera frustum near plane. Default is *0.1*.</div>
+		<div>
+			Camera fustum near plane. Default is *0.1*.<br /><br />
+
+			Note that Three does not currently give warnings for incorrect values here, however the expected
+			range is between 0 and the current value of the [page:.far far] plane.
+		</div>
 
 		<h3>[property:Object view]</h3>
 		<div>

+ 16 - 12
docs/api/deprecated/DeprecatedList.html

@@ -140,6 +140,8 @@
 		<h3>[page:ClosedSplineCurve3]</h3>
 		<div>ClosedSplineCurve3 has been deprecated. Use [page:CatmullRomCurve3] instead.</div>
 
+		<h3>[page:SplineCurve3]</h3>
+		<div>SplineCurve3 has been deprecated. Use [page:CatmullRomCurve3] instead.</div>
 
 
 
@@ -306,7 +308,7 @@
 
 		<h3>[page:Matrix4]</h3>
 		<div>
-			Matrix4.flattenToArrayOffset is deprecated. Use [page:Matrix4.toArray]() instead.<br /><br />
+			Matrix4.flattenToArrayOffset() is deprecated. Use [page:Matrix4.toArray]() instead.<br /><br />
 
 			Matrix4.extractPosition() has been renamed to [page:Matrix4.copyPosition]( matrix ).<br /><br />
 
@@ -314,27 +316,29 @@
 
 			Matrix4.setRotationFromQuaternion() has been renamed to [page:Matrix4.makeRotationFromQuaternion]( quaternion ).<br /><br />
 
-			Matrix4.multiplyVector3 has been has been removed. Use vector.applyMatrix4( matrix ) instead.<br /><br />
+			Matrix4.multiplyVector3() has been has been removed. Use vector.applyMatrix4( matrix ) instead.<br /><br />
 
-			Matrix4.multiplyVector4 has been removed. Use vector.applyMatrix4( matrix ) instead.<br /><br />
+			Matrix4.multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.<br /><br />
 
-			Matrix4.multiplyVector3Array has been renamed to [page:Matrix4.applyToVector3Array] (array ).<br /><br />
+			Matrix4.multiplyVector3Array() has been renamed to [page:Matrix4.applyToVector3Array] ( array ).<br /><br />
 
-			Matrix4.rotateAxis has been removed. Use [page:Matrix4.transformDirection]( matrix ) instead.<br /><br />
+			Matrix4.rotateAxis() has been removed. Use [page:Matrix4.transformDirection]( matrix ) instead.<br /><br />
 
-			Matrix4.crossVector has been removed. Use vector.applyMatrix4( matrix ) instead.<br /><br />
+			Matrix4.crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.<br /><br />
 
-			Matrix4.rotateX has been removed.<br /><br />
+			Matrix4.rotateX() has been removed.<br /><br />
 
-			Matrix4.rotateY has been removed.<br /><br />
+			Matrix4.rotateY() has been removed.<br /><br />
 
-			Matrix4.rotateZ has been removed.<br /><br />
+			Matrix4.rotateZ() has been removed.<br /><br />
 
-			Matrix4.rotateByAxis has been removed.<br /><br />
+			Matrix4.rotateByAxis() has been removed.<br /><br />
 
-			Matrix4.applyToBuffer has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.<br /><br />
+			Matrix4.applyToBuffer() has been removed. Use matrix.applyToBufferAttribute() instead.<br /><br />
 
-			Matrix4.applyToVector3Array has been removed.
+			Matrix4.applyToVector3Array() has been removed.<br /><br />
+
+			Matrix4.makeFrustum() has been removed. Use [page:Matrix4.makePerspective]( left, right, top, bottom, near, far ) instead.
 		</div>
 
 

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

@@ -25,7 +25,7 @@
 		t -- interpolation weight. <br />
 		p0, p1, p2, p4 -- the points defining the spline curve.<br /><br />
 
-		Used internally by [page:SplineCurve SplineCurve] and [page:SplineCurve3 SplineCurve3].
+		Used internally by [page:SplineCurve SplineCurve].
 		</div>
 
 		<h3>[method:Number tangentQuadraticBezier]( t, p0, p1, p2 )</h3>

+ 0 - 66
docs/api/extras/curves/SplineCurve3.html

@@ -1,66 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<base href="../../../" />
-		<script src="list.js"></script>
-		<script src="page.js"></script>
-		<link type="text/css" rel="stylesheet" href="page.css" />
-	</head>
-	<body>
-		[page:Curve] &rarr;
-
-		<h1>[name]</h1>
-
-		<div class="desc">
-			Create a smooth 3d spline curve from a series of points. Internally this uses
-		[page:CurveUtils.interpolate] to create the curve.<br /><br />
-
-		Note that this will be deprecated. Please use a [page:CatmullRomCurve3] instead.
-
-	</div>
-
-		<h2>Example</h2>
-
-		<div>[example:webgl_geometry_extrude_splines geometry / extrude / splines ] (choose PipeSpline)</div>
-
-		<code>
-//Create a closed bent a sine-like wave
-var curve = new THREE.SplineCurve3( [
-	new THREE.Vector3( -10, 0, 10 ),
-	new THREE.Vector3( -5, 5, 5 ),
-	new THREE.Vector3( 0, 0, 0 ),
-	new THREE.Vector3( 5, -5, 5 ),
-	new THREE.Vector3( 10, 0, 10 )
-] );
-
-var geometry = new THREE.Geometry();
-geometry.vertices = curve.getPoints( 50 );
-
-var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
-
-//Create the final object to add to the scene
-var splineObject = new THREE.Line( geometry, material );
-	</code>
-
-
-
-
-		<h2>Constructor</h2>
-
-
-		<h3>[name]( [page:Array points] )</h3>
-		<div>points – An array of [page:Vector3] points that define the curve.</div>
-
-
-		<h2>Properties</h2>
-
-		<h3>[property:Array points]</h3>
-
-		<h2>Methods</h2>
-
-		<h3>See [page:Curve] for inherited methods</h3>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-	</body>
-</html>

+ 3 - 12
docs/api/math/Matrix4.html

@@ -116,7 +116,7 @@ m.elements = [ 11, 21, 31, 41,
 
 		Multiplies (applies) this matrix to every 3D vector in the [page:BufferAttribute attribute].
 		</div>
-		
+
 
 		<h3>[method:Matrix4 clone]()</h3>
 		<div>Creates a new Matrix4 with identical [page:.elements elements] to this one.</div>
@@ -236,9 +236,9 @@ xAxis.z, yAxis.z, zAxis.z, 0,
 		</code>
 		</div>
 
-		<h3>[method:Matrix4 makeFrustum]( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] )</h3>
+		<h3>[method:Matrix4 makePerspective]( [page:Float left], [page:Float right], [page:Float top], [page:Float bottom], [page:Float near], [page:Float far] )</h3>
 		<div>
-			Creates a matrix representing a [link:https://en.wikipedia.org/wiki/Frustum frustum].
+			Creates a [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection perspective projection] matrix.
 			This is used internally by [page:PerspectiveCamera.updateProjectionMatrix]()
 		</div>
 
@@ -248,15 +248,6 @@ xAxis.z, yAxis.z, zAxis.z, 0,
 		This is used internally by [page:OrthographicCamera.updateProjectionMatrix]().
 		</div>
 
-		<h3>[method:Matrix4 makePerspective]( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] )</h3>
-		<div>
-		Creates a [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection perspective projection] matrix.
-
-		Internally this calculates the values of [page:Float left], [page:Float right], [page:Float bottom] and [page:Float top],
-		and calls [page:.makeFrustum makeFrustum].
-
-		</div>
-
 		<h3>[method:Matrix4 makeRotationFromEuler]( [page:Euler euler] )</h3>
 		<div>
 		Sets the rotation component (the upper left 3x3 matrix) of this matrix to the rotation specified by the given [page:Euler Euler Angle].

+ 1 - 2
docs/list.js

@@ -107,8 +107,7 @@ var list = {
 			[ "LineCurve3", "api/extras/curves/LineCurve3" ],
 			[ "QuadraticBezierCurve", "api/extras/curves/QuadraticBezierCurve" ],
 			[ "QuadraticBezierCurve3", "api/extras/curves/QuadraticBezierCurve3" ],
-			[ "SplineCurve", "api/extras/curves/SplineCurve" ],
-			[ "SplineCurve3", "api/extras/curves/SplineCurve3" ]
+			[ "SplineCurve", "api/extras/curves/SplineCurve" ]
 		],
 
 		"Extras / Helpers": [

+ 2 - 24
editor/js/libs/tern-threejs/threejs.js

@@ -1431,15 +1431,6 @@
       },
       "!doc": "Alias for [page:EllipseCurve]"
     },
-    "ClosedSplineCurve3": {
-      "!url": "http://threejs.org/docs/#Reference/extras/curves/ClosedSplineCurve3",
-      "prototype": {
-        "!proto": "THREE.Curve.prototype",
-        "points": "[]"
-      },
-      "!doc": "Create a smooth 3d spline curve from a series of points that loops back onto itself",
-      "!type": "fn(points: [])"
-    },
     "CubicBezierCurve": {
       "!url": "http://threejs.org/docs/#Reference/extras/curves/CubicBezierCurve",
       "prototype": {
@@ -1529,15 +1520,6 @@
       "!doc": "Create a smooth 2d spline curve from a series of points",
       "!type": "fn(points: [])"
     },
-    "SplineCurve3": {
-      "!url": "http://threejs.org/docs/#Reference/extras/curves/SplineCurve3",
-      "prototype": {
-        "!proto": "THREE.Curve.prototype",
-        "points": "[]"
-      },
-      "!doc": "Create a smooth 3d spline curve from a series of points",
-      "!type": "fn(points: [])"
-    },
     "BoxGeometry": {
       "!url": "http://threejs.org/docs/#Reference/geometries/BoxGeometry",
       "prototype": {
@@ -3921,16 +3903,12 @@
           "!type": "fn(x: number, y: number, z: number) -> +THREE.Matrix4",
           "!doc": "Sets this matrix as scale transform."
         },
-        "makeFrustum": {
-          "!type": "fn(left: number, right: number, bottom: number, top: number, near: number, far: number) -> +THREE.Matrix4",
-          "!doc": "Creates a [page:Frustum frustum] matrix."
-        },
         "makePerspective": {
-          "!type": "fn(fov: number, aspect: number, near: number, far: number) -> +THREE.Matrix4",
+          "!type": "fn(left: number, right: number, top: number, bottom: number, near: number, far: number) -> +THREE.Matrix4",
           "!doc": "Creates a perspective projection matrix."
         },
         "makeOrthographic": {
-          "!type": "fn(left: number, right: number, bottom: number, top: number, near: number, far: number) -> +THREE.Matrix4",
+          "!type": "fn(left: number, right: number, top: number, bottom: number, near: number, far: number) -> +THREE.Matrix4",
           "!doc": "Creates an orthographic projection matrix."
         },
         "clone": {

+ 4 - 4
examples/js/loaders/MD2Loader.js

@@ -218,8 +218,8 @@ THREE.MD2Loader.prototype = {
 				for ( var j = 0; j < 16; j ++ ) {
 
 					var character = data.getUint8( offset + j, true );
-					if( character === 0 ) break;
-					
+					if ( character === 0 ) break;
+
 					string[ j ] = character;
 
 				}
@@ -298,13 +298,13 @@ THREE.MD2Loader.prototype = {
 
 			}
 
-			geometry.animations = THREE.AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 )
+			geometry.animations = THREE.AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 );
 
 			console.timeEnd( 'MD2Loader' );
 
 			return geometry;
 
-		}
+		};
 
 	} )()
 

+ 41 - 34
examples/js/loaders/MTLLoader.js

@@ -4,13 +4,15 @@
  * @author angelxuanchang
  */
 
-THREE.MTLLoader = function( manager ) {
+THREE.MTLLoader = function ( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
 
 };
 
-Object.assign( THREE.MTLLoader.prototype, THREE.EventDispatcher.prototype, {
+THREE.MTLLoader.prototype = {
+
+	constructor: THREE.MTLLoader,
 
 	/**
 	 * Loads and parses a MTL asset from a URL.
@@ -69,13 +71,13 @@ Object.assign( THREE.MTLLoader.prototype, THREE.EventDispatcher.prototype, {
 	 *     mtlLoader.setTexturePath( 'assets/textures/' );
 	 *     mtlLoader.load( 'my.mtl', ... );
 	 */
-	setTexturePath: function( path ) {
+	setTexturePath: function ( path ) {
 
 		this.texturePath = path;
 
 	},
 
-	setBaseUrl: function( path ) {
+	setBaseUrl: function ( path ) {
 
 		console.warn( 'THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead.' );
 
@@ -165,7 +167,7 @@ Object.assign( THREE.MTLLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 /**
  * Create a new THREE-MTLLoader.MaterialCreator
@@ -182,7 +184,7 @@ Object.assign( THREE.MTLLoader.prototype, THREE.EventDispatcher.prototype, {
  * @constructor
  */
 
-THREE.MTLLoader.MaterialCreator = function( baseUrl, options ) {
+THREE.MTLLoader.MaterialCreator = function ( baseUrl, options ) {
 
 	this.baseUrl = baseUrl || '';
 	this.options = options;
@@ -212,7 +214,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 	},
 
-	setMaterials: function( materialsInfo ) {
+	setMaterials: function ( materialsInfo ) {
 
 		this.materialsInfo = this.convert( materialsInfo );
 		this.materials = {};
@@ -221,7 +223,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 	},
 
-	convert: function( materialsInfo ) {
+	convert: function ( materialsInfo ) {
 
 		if ( ! this.options ) return materialsInfo;
 
@@ -274,6 +276,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 					default:
 
 						break;
+
 				}
 
 				if ( save ) {
@@ -300,13 +303,13 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 	},
 
-	getIndex: function( materialName ) {
+	getIndex: function ( materialName ) {
 
 		return this.nameLookup[ materialName ];
 
 	},
 
-	getAsArray: function() {
+	getAsArray: function () {
 
 		var index = 0;
 
@@ -347,33 +350,33 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 		};
 
-		var resolveURL = function ( baseUrl, url ) {
+		function resolveURL( baseUrl, url ) {
 
 			if ( typeof url !== 'string' || url === '' )
 				return '';
 
 			// Absolute URL
-			if ( /^https?:\/\//i.test( url ) ) {
-				return url;
-			}
+			if ( /^https?:\/\//i.test( url ) ) return url;
 
 			return baseUrl + url;
-		};
-		
-		function setMapForType ( mapType, value ) {
+
+		}
+
+		function setMapForType( mapType, value ) {
 
 			if ( params[ mapType ] ) return; // Keep the first encountered texture
 
 			var texParams = scope.getTextureParams( value, params );
 			var map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );
-			
+
 			map.repeat.copy( texParams.scale );
 			map.offset.copy( texParams.offset );
 
 			map.wrapS = scope.wrap;
 			map.wrapT = scope.wrap;
-			
+
 			params[ mapType ] = map;
+
 		}
 
 		for ( var prop in mat ) {
@@ -412,7 +415,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 				case 'map_ks':
 
 					// Specular map
-					
+
 					setMapForType( "specularMap", value );
 
 					break;
@@ -420,8 +423,8 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 				case 'map_bump':
 				case 'bump':
 
-					// Bump texture map				
-					
+					// Bump texture map
+
 					setMapForType( "bumpMap", value );
 
 					break;
@@ -466,9 +469,10 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 		this.materials[ materialName ] = new THREE.MeshPhongMaterial( params );
 		return this.materials[ materialName ];
+
 	},
 
-	getTextureParams: function( value, matParams ) {
+	getTextureParams: function ( value, matParams ) {
 
 		var texParams = {
 
@@ -477,34 +481,37 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 
 		 };
 
-		var items = value.split(/\s+/);
+		var items = value.split( /\s+/ );
 		var pos;
 
-		pos = items.indexOf('-bm');
-		if (pos >= 0) {
+		pos = items.indexOf( '-bm' );
+
+		if ( pos >= 0 ) {
 
-			matParams.bumpScale = parseFloat( items[pos+1] );
+			matParams.bumpScale = parseFloat( items[ pos + 1 ] );
 			items.splice( pos, 2 );
 
 		}
 
-		pos = items.indexOf('-s');
-		if (pos >= 0) {
+		pos = items.indexOf( '-s' );
 
-			texParams.scale.set( parseFloat( items[pos+1] ), parseFloat( items[pos+2] ) );
+		if ( pos >= 0 ) {
+
+			texParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );
 			items.splice( pos, 4 ); // we expect 3 parameters here!
 
 		}
 
-		pos = items.indexOf('-o');
-		if (pos >= 0) {
+		pos = items.indexOf( '-o' );
+
+		if ( pos >= 0 ) {
 
-			texParams.offset.set( parseFloat( items[pos+1] ), parseFloat( items[pos+2] ) );
+			texParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );
 			items.splice( pos, 4 ); // we expect 3 parameters here!
 
 		}
 
-		texParams.url = items.join(' ').trim();
+		texParams.url = items.join( ' ' ).trim();
 		return texParams;
 
 	},

+ 44 - 44
examples/js/loaders/NRRDLoader.js

@@ -1,19 +1,21 @@
-THREE.NRRDLoader = function( manager ) {
+THREE.NRRDLoader = function ( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
 
 
 };
 
-Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
+THREE.NRRDLoader.prototype = {
 
-	load: function( url, onLoad, onProgress, onError ) {
+	constructor: THREE.NRRDLoader,
+
+	load: function ( url, onLoad, onProgress, onError ) {
 
 		var scope = this;
 
 		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
-		loader.load( url, function( data ) {
+		loader.load( url, function ( data ) {
 
 			onLoad( scope.parse( data ) );
 
@@ -21,9 +23,9 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	},
 
-	//this parser is largely inspired from the XTK NRRD parser : https://github.com/xtk/X
-	parse: function( data ) {
+	parse: function ( data ) {
 
+		// this parser is largely inspired from the XTK NRRD parser : https://github.com/xtk/X
 
 		var _data = data;
 
@@ -33,10 +35,6 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 		var _littleEndian = true;
 
-		var _lastMin = - Infinity;
-
-		var _lastMax = Infinity;
-
 		var headerObject = {};
 
 		function scan( type, chunks ) {
@@ -206,10 +204,9 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 			var number = '';
 			start = start || 0;
 			end = end || data.length;
-			var lastSpace = start;
 			var value;
 			//length of the result is the product of the sizes
-			var lengthOfTheResult = headerObject.sizes.reduce( function( previous, current ) {
+			var lengthOfTheResult = headerObject.sizes.reduce( function ( previous, current ) {
 
 				return previous * current;
 
@@ -238,8 +235,7 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 					number += String.fromCharCode( value );
 
-				}
-				else {
+				} else {
 
 					if ( number !== '' ) {
 
@@ -292,20 +288,23 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 			var inflate = new Zlib.Gunzip( new Uint8Array( _data ) );
 			_data = inflate.decompress();
 
-		}
-		else if ( headerObject.encoding === 'ascii' || headerObject.encoding === 'text' || headerObject.encoding === 'txt' || headerObject.encoding === 'hex' ) {
+		} else if ( headerObject.encoding === 'ascii' || headerObject.encoding === 'text' || headerObject.encoding === 'txt' || headerObject.encoding === 'hex' ) {
 
 			_data = parseDataAsText( _data );
 
-		}
-		else if (headerObject.encoding === 'raw')
-		{
+		} else if ( headerObject.encoding === 'raw' ) {
+
 			//we need to copy the array to create a new array buffer, else we retrieve the original arraybuffer with the header
-			var _copy = new Uint8Array(_data.length);
-			for (var i = 0; i < _data.length; i++) {
-				_copy[i] = _data[i];
+			var _copy = new Uint8Array( _data.length );
+
+			for ( var i = 0; i < _data.length; i ++ ) {
+
+				_copy[ i ] = _data[ i ];
+
 			}
+
 			_data = _copy;
+
 		}
 		// .. let's use the underlying array buffer
 		_data = _data.buffer;
@@ -351,10 +350,9 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 			_spaceX = - 1;
 			_spaceY = - 1;
 
-		}
-		else if ( headerObject.space === 'left-anterior-superior' ) {
+		} else if ( headerObject.space === 'left-anterior-superior' ) {
 
-			_spaceX = - 1
+			_spaceX = - 1;
 
 		}
 
@@ -366,8 +364,7 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 			0, 0, _spaceZ, 0,
 			0, 0, 0, 1 );
 
-		}
-		else {
+		} else {
 
 			var v = headerObject.vectors;
 			var origin = headerObject.space_origin;
@@ -406,7 +403,7 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	},
 
-	parseChars: function( array, start, end ) {
+	parseChars: function ( array, start, end ) {
 
 		// without borders, use the whole array
 		if ( start === undefined ) {
@@ -435,9 +432,10 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	fieldFunctions: {
 
-		type: function( data ) {
+		type: function ( data ) {
 
 			switch ( data ) {
+
 				case 'uchar':
 				case 'unsigned char':
 				case 'uint8':
@@ -484,33 +482,35 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 					break;
 				default:
 					throw new Error( 'Unsupported NRRD data type: ' + data );
+
 			}
+
 			return this.type = data;
 
 		},
 
-		endian: function( data ) {
+		endian: function ( data ) {
 
 			return this.endian = data;
 
 		},
 
-		encoding: function( data ) {
+		encoding: function ( data ) {
 
 			return this.encoding = data;
 
 		},
 
-		dimension: function( data ) {
+		dimension: function ( data ) {
 
 			return this.dim = parseInt( data, 10 );
 
 		},
 
-		sizes: function( data ) {
+		sizes: function ( data ) {
 
 			var i;
-			return this.sizes = ( function() {
+			return this.sizes = ( function () {
 
 				var _i, _len, _ref, _results;
 				_ref = data.split( /\s+/ );
@@ -527,30 +527,30 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 		},
 
-		space: function( data ) {
+		space: function ( data ) {
 
 			return this.space = data;
 
 		},
 
-		'space origin' : function( data ) {
+		'space origin': function ( data ) {
 
 			return this.space_origin = data.split( "(" )[ 1 ].split( ")" )[ 0 ].split( "," );
 
 		},
 
-		'space directions' : function( data ) {
+		'space directions': function ( data ) {
 
 			var f, parts, v;
 			parts = data.match( /\(.*?\)/g );
-			return this.vectors = ( function() {
+			return this.vectors = ( function () {
 
 				var _i, _len, _results;
 				_results = [];
 				for ( _i = 0, _len = parts.length; _i < _len; _i ++ ) {
 
 					v = parts[ _i ];
-					_results.push( ( function() {
+					_results.push( ( function () {
 
 						var _j, _len2, _ref, _results2;
 						_ref = v.slice( 1, - 1 ).split( /,/ );
@@ -572,14 +572,14 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 		},
 
-		spacings: function( data ) {
+		spacings: function ( data ) {
 
 			var f, parts;
 			parts = data.split( /\s+/ );
-			return this.spacings = ( function() {
+			return this.spacings = ( function () {
+
+				var _i, _len, _results = [];
 
-				var _i, _len, _results;
-				_results = [];
 				for ( _i = 0, _len = parts.length; _i < _len; _i ++ ) {
 
 					f = parts[ _i ];
@@ -593,4 +593,4 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 		}
 	}
 
-} );
+};

+ 37 - 36
examples/js/loaders/PCDLoader.js

@@ -7,7 +7,7 @@
  *
  */
 
-THREE.PCDLoader = function( manager ) {
+THREE.PCDLoader = function ( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
 	this.littleEndian = true;
@@ -15,15 +15,17 @@ THREE.PCDLoader = function( manager ) {
 };
 
 
-Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
+THREE.PCDLoader.prototype = {
 
-	load: function( url, onLoad, onProgress, onError ) {
+	constructor: THREE.PCDLoader,
+
+	load: function ( url, onLoad, onProgress, onError ) {
 
 		var scope = this;
 
 		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
-		loader.load( url, function( data ) {
+		loader.load( url, function ( data ) {
 
 			onLoad( scope.parse( data, url ) );
 
@@ -31,7 +33,7 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	},
 
-	binarryToStr: function( data ) {
+	binarryToStr: function ( data ) {
 
 		var text = "";
 		var charArray = new Uint8Array( data );
@@ -44,7 +46,7 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	},
 
-	parseHeader: function( data ) {
+	parseHeader: function ( data ) {
 
 		var PCDheader = {};
 		var result1 = data.search( /[\r\n]DATA\s(\S*)\s/i );
@@ -56,47 +58,47 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 		PCDheader.str = PCDheader.str.replace( /\#.*/gi, "" );
 		PCDheader.version = /VERSION (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.version != null )
-		PCDheader.version = parseFloat( PCDheader.version[ 1 ] );
+			PCDheader.version = parseFloat( PCDheader.version[ 1 ] );
 		PCDheader.fields = /FIELDS (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.fields != null )
-		PCDheader.fields = PCDheader.fields[ 1 ].split( " " );
+			PCDheader.fields = PCDheader.fields[ 1 ].split( " " );
 		PCDheader.size = /SIZE (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.size != null )
-			PCDheader.size = PCDheader.size[ 1 ].split( " " ).map( function( x ) {
+			PCDheader.size = PCDheader.size[ 1 ].split( " " ).map( function ( x ) {
 
 				return parseInt( x, 10 );
 
 			} );
 		PCDheader.type = /TYPE (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.type != null )
-		PCDheader.type = PCDheader.type[ 1 ].split( " " );
+			PCDheader.type = PCDheader.type[ 1 ].split( " " );
 		PCDheader.count = /COUNT (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.count != null )
-			PCDheader.count = PCDheader.count[ 1 ].split( " " ).map( function( x ) {
+			PCDheader.count = PCDheader.count[ 1 ].split( " " ).map( function ( x ) {
 
 				return parseInt( x, 10 );
 
 			} );
 		PCDheader.width = /WIDTH (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.width != null )
-		PCDheader.width = parseInt( PCDheader.width[ 1 ] );
+			PCDheader.width = parseInt( PCDheader.width[ 1 ] );
 		PCDheader.height = /HEIGHT (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.height != null )
-		PCDheader.height = parseInt( PCDheader.height[ 1 ] );
+			PCDheader.height = parseInt( PCDheader.height[ 1 ] );
 		PCDheader.viewpoint = /VIEWPOINT (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.viewpoint != null )
-		PCDheader.viewpoint = PCDheader.viewpoint[ 1 ];
+			PCDheader.viewpoint = PCDheader.viewpoint[ 1 ];
 		PCDheader.points = /POINTS (.*)/i.exec( PCDheader.str );
 		if ( PCDheader.points != null )
-		PCDheader.points = parseInt( PCDheader.points[ 1 ], 10 );
+			PCDheader.points = parseInt( PCDheader.points[ 1 ], 10 );
 		if ( PCDheader.points == null )
-		PCDheader.points = PCDheader.width * PCDheader.height;
+			PCDheader.points = PCDheader.width * PCDheader.height;
 
 		if ( PCDheader.count == null ) {
 
 			PCDheader.count = [];
 			for ( var i = 0; i < PCDheader.fields; i ++ )
-			PCDheader.count.push( 1 );
+				PCDheader.count.push( 1 );
 
 		}
 
@@ -106,11 +108,11 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 			if ( PCDheader.data == "ascii" ) {
 
-				PCDheader.offset[ PCDheader.fields[ i ]] = i;
+				PCDheader.offset[ PCDheader.fields[ i ] ] = i;
 
 			} else {
 
-				PCDheader.offset[ PCDheader.fields[ i ]] = sizeSum;
+				PCDheader.offset[ PCDheader.fields[ i ] ] = sizeSum;
 				sizeSum += PCDheader.size[ i ];
 
 			}
@@ -123,7 +125,7 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 	},
 
-	parse: function( data, url ) {
+	parse: function ( data, url ) {
 
 		var textData = this.binarryToStr( data );
 
@@ -134,13 +136,13 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 		// Parse the data
 		var position = false;
 		if ( PCDheader.offset.x != undefined )
-		position = new Float32Array( PCDheader.points * 3 );
+			position = new Float32Array( PCDheader.points * 3 );
 		var color = false;
-		if ( PCDheader.offset.rgb != undefined)
-		color = new Float32Array( PCDheader.points * 3 );
+		if ( PCDheader.offset.rgb != undefined )
+			color = new Float32Array( PCDheader.points * 3 );
 		var normal = false;
 		if ( PCDheader.offset.normal_x != undefined )
-		normal = new Float32Array( PCDheader.points * 3 );
+			normal = new Float32Array( PCDheader.points * 3 );
 
 		if ( PCDheader.data == "ascii" ) {
 
@@ -160,11 +162,11 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 				}
 				if ( offset.rgb != undefined ) {
 
-					var c = new Float32Array([parseFloat( line[ offset.rgb ] )]);
+					var c = new Float32Array( [ parseFloat( line[ offset.rgb ] ) ] );
 					var dataview = new DataView( c.buffer, 0 );
-					color[ i3 + 0 ] = dataview.getUint8(0)/255.0;
-					color[ i3 + 1 ] = dataview.getUint8(1)/255.0;
-					color[ i3 + 2 ] = dataview.getUint8(2)/255.0;
+					color[ i3 + 0 ] = dataview.getUint8( 0 ) / 255.0;
+					color[ i3 + 1 ] = dataview.getUint8( 1 ) / 255.0;
+					color[ i3 + 2 ] = dataview.getUint8( 2 ) / 255.0;
 
 				}
 				if ( offset.normal_x != undefined ) {
@@ -222,19 +224,18 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 		var geometry = new THREE.BufferGeometry();
 		if ( position != false )
-		geometry.addAttribute( 'position', new THREE.BufferAttribute( position, 3 ) );
+			geometry.addAttribute( 'position', new THREE.BufferAttribute( position, 3 ) );
 		if ( color != false )
-		geometry.addAttribute( 'color', new THREE.BufferAttribute( color, 3 ) );
+			geometry.addAttribute( 'color', new THREE.BufferAttribute( color, 3 ) );
 		if ( normal != false )
-		geometry.addAttribute( 'normal', new THREE.BufferAttribute( normal, 3 ) );
+			geometry.addAttribute( 'normal', new THREE.BufferAttribute( normal, 3 ) );
 
 		geometry.computeBoundingSphere();
 
-		var material = new THREE.PointsMaterial( { size: 0.005,
-		vertexColors: !(color == false) } );
+		var material = new THREE.PointsMaterial( { size: 0.005, vertexColors: ! ( color == false ) } );
 		if ( color == false )
 			material.color.setHex( Math.random() * 0xffffff );
-		
+
 		var mesh = new THREE.Points( geometry, material );
 		var name = url.split( '' ).reverse().join( '' );
 		name = /([^\/]*)/.exec( name );
@@ -244,6 +245,6 @@ Object.assign( THREE.PCDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 		return mesh;
 
-	},
+	}
 
-} );
+};

+ 106 - 142
examples/webgl_buffergeometry_constructed_from_geometry.html

@@ -1,58 +1,50 @@
 <!DOCTYPE html>
 <html lang="en">
 	<head>
-	<title>three.js - BufferGeometry constructed from Geometry Example</title>
-	<meta charset="utf-8">
-	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-	<style>
-		body {
-			background-color: #000;
-			font-family: Monospace;
-			margin: 0;
-			color: #000;
-			overflow: hidden;
-		}
-		#title {
-			position: absolute;
-			width: 100%;
-			top: 0;
-			padding: 0;
-			text-align: center;
-			font-size: 1.1em;
-			background-color: rgba(64,96,64,0.7);
-			color: #fff;
-		}
-		#title a {color:#ff0;}
-	</style>
-	<script type="text/javascript" src="../build/three.js"></script>
-	<script type="text/javascript" src="js/Detector.js"></script>
-	<script type="text/javascript" src="js/libs/stats.min.js"></script>
-	<script type="text/javascript" src="js/controls/TrackballControls.js"></script>
+		<title>three.js webgl - buffer geometry constructed from geometry</title>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+		<style>
+			body {
+				color: #ffffff;
+				background-color: #000000;
+				margin: 0px;
+				overflow: hidden;
+			}
+			#info {
+				position: absolute;
+				top: 0px;
+				width: 100%;
+				padding: 5px;
+				font-family: Monospace;
+				font-size: 13px;
+				text-align: center;
+			}
+			a {
+				color: #0080ff;
+			}
+		</style>
+		<script type="text/javascript" src="../build/three.js"></script>
+		<script type="text/javascript" src="js/Detector.js"></script>
+		<script type="text/javascript" src="js/libs/stats.min.js"></script>
+		<script type="text/javascript" src="js/controls/TrackballControls.js"></script>
 	</head>
-	<body onload="app()">
-		<div id="title"></div>
+	<body>
+		<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> webgl - buffer geometry constructed from geometry - (<a target="_blank" href="http://callum.com">author</a>)</div>
 		<script>
-		var camera, scene, renderer, controls, stats;
-
-		function app() {
 
-			if ( ! Detector.webgl ) {
+		if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 
-				Detector.addGetWebGLMessage();
-
-			}
-
-			init();
-			animate();
+		var camera, scene, renderer, controls, stats;
 
-		}
+		init();
+		animate();
 
 		function init() {
 
 			renderer = new THREE.WebGLRenderer( {
 				antialias: true
 			} );
-			renderer.setClearColor( 0x000000, 0.0 );
 			renderer.setPixelRatio( window.devicePixelRatio );
 			renderer.setSize( window.innerWidth, window.innerHeight );
 
@@ -89,16 +81,17 @@
 
 		function createGeometry() {
 
-			var heart_shape = new THREE.Shape(); // From http://blog.burlock.org/html5/130-paths
-			var x = 0,
-				y = 0;
-			heart_shape.moveTo( x + 25, y + 25 );
-			heart_shape.bezierCurveTo( x + 25, y + 25, x + 20, y, x, y );
-			heart_shape.bezierCurveTo( x - 30, y, x - 30, y + 35, x - 30, y + 35 );
-			heart_shape.bezierCurveTo( x - 30, y + 55, x - 10, y + 77, x + 25, y + 95 );
-			heart_shape.bezierCurveTo( x + 60, y + 77, x + 80, y + 55, x + 80, y + 35 );
-			heart_shape.bezierCurveTo( x + 80, y + 35, x + 80, y, x + 50, y );
-			heart_shape.bezierCurveTo( x + 35, y, x + 25, y + 25, x + 25, y + 25 );
+			var heartShape = new THREE.Shape(); // From http://blog.burlock.org/html5/130-paths
+			var x = 0, y = 0;
+
+			heartShape.moveTo( x + 25, y + 25 );
+			heartShape.bezierCurveTo( x + 25, y + 25, x + 20, y, x, y );
+			heartShape.bezierCurveTo( x - 30, y, x - 30, y + 35, x - 30, y + 35 );
+			heartShape.bezierCurveTo( x - 30, y + 55, x - 10, y + 77, x + 25, y + 95 );
+			heartShape.bezierCurveTo( x + 60, y + 77, x + 80, y + 55, x + 80, y + 35 );
+			heartShape.bezierCurveTo( x + 80, y + 35, x + 80, y, x + 50, y );
+			heartShape.bezierCurveTo( x + 35, y, x + 25, y + 25, x + 25, y + 25 );
+
 			var extrudeSettings = {
 				amount: 16,
 				bevelEnabled: true,
@@ -107,122 +100,92 @@
 				bevelSize: 1,
 				bevelThickness: 1
 			};
-			var geom = new THREE.ExtrudeGeometry( heart_shape, extrudeSettings );
-			geom.rotateX( - Math.PI / 2 );
-			geom.scale( 0.4, 0.4, 0.4 );
-			return geom;
-
-		}
-
-		function createScene() {
-
-			var buffer_geometry = new THREE.BufferGeometry();
-			var radius = 100.0;
-			var positions = 0;
-			var normals = 0;
-			var colors = 0;
-			var shape_density = 14;
 
-			for ( var num_lat = 0; num_lat < shape_density / 2; ++ num_lat ) {
+			var geometry = new THREE.ExtrudeGeometry( heartShape, extrudeSettings );
+			geometry.rotateX( Math.PI );
+			geometry.scale( 0.4, 0.4, 0.4 );
 
-				var lat_lhs = ( num_lat + 0 ) * 180 / ( shape_density / 2 );
-				var lat_rhs = ( num_lat + 1 ) * 180 / ( shape_density / 2 );
-				var lat = ( lat_lhs + lat_rhs ) / 2.0;
+			return geometry;
 
-				for ( var num_lng = 0; num_lng < shape_density; ++ num_lng ) {
-
-					var lng_lhs = ( num_lng + 0 ) * 360 / shape_density;
-					var lng_rhs = ( num_lng + 1 ) * 360 / shape_density;
-					var lng = ( lng_lhs + lng_rhs ) / 2.0;
-
-					var height = 30.0;
+		}
 
-					var phi = lat * Math.PI / 180.0;
-					var theta = lng * Math.PI / 180.0;
-					var x = radius * Math.sin( phi ) * Math.cos( theta );
-					var y = radius * Math.cos( phi );
-					var z = radius * Math.sin( phi ) * Math.sin( theta );
+		function createScene() {
 
-					var geometry = createGeometry();
+			var bufferGeometry = new THREE.BufferGeometry();
 
-					geometry.translate( 0, height / 2, 0 );
-					geometry.rotateX( - Math.PI / 2 );
-					geometry.lookAt( new THREE.Vector3( - x, - y, - z ) );
-					geometry.translate( x, y, z );
+			var radius = 125;
+			var count = 80;
 
-					var color = new THREE.Color( 0xffffff );
-					color.setHSL( lat / 180.0, 1.0, 0.7 );
+			var positions = [];
+			var normals = [];
+			var colors = [];
 
-					if ( positions === 0 ) {
+			var spherical = new THREE.Spherical();
+			var vector = new THREE.Vector3();
 
-						var num_stacks = shape_density * shape_density / 2;
+			for ( var i = 1, l = count; i <= l; i ++ ) {
 
-						var str = 'BufferGeometry constructed from Geometry Example - ' + parseInt( num_stacks * geometry.faces.length, 10 ) + ' triangles (<a target="_blank" href="http://callum.com">author</a>)';
-						document.getElementById( 'title' ).innerHTML = str.replace( /\B(?=(\d{3})+(?!\d))/g, "," );
+				var phi = Math.acos( -1 + ( 2 * i ) / l );
+				var theta = Math.sqrt( l * Math.PI ) * phi;
 
-						positions = new Float32Array( num_stacks * geometry.faces.length * 3 * 3 );
-						normals = new Float32Array( num_stacks * geometry.faces.length * 3 * 3 );
-						colors = new Float32Array( num_stacks * geometry.faces.length * 3 * 3 );
+				spherical.set( radius, phi, theta );
+				vector.setFromSpherical( spherical );
 
-					}
+				var geometry = createGeometry();
 
-					geometry.faces.forEach( function ( face, index ) {
+				geometry.lookAt( vector );
+				geometry.translate( vector.x, vector.y, vector.z );
 
-						var cur_element = ( ( num_lng + num_lat * shape_density ) * geometry.faces.length + index );
+				var color = new THREE.Color( 0xffffff );
+				color.setHSL( ( i / l ), 1.0, 0.7 );
 
-						positions[ cur_element * 9 + 0 ] = geometry.vertices[ face.a ].x;
-						positions[ cur_element * 9 + 1 ] = geometry.vertices[ face.a ].y;
-						positions[ cur_element * 9 + 2 ] = geometry.vertices[ face.a ].z;
-						positions[ cur_element * 9 + 3 ] = geometry.vertices[ face.b ].x;
-						positions[ cur_element * 9 + 4 ] = geometry.vertices[ face.b ].y;
-						positions[ cur_element * 9 + 5 ] = geometry.vertices[ face.b ].z;
-						positions[ cur_element * 9 + 6 ] = geometry.vertices[ face.c ].x;
-						positions[ cur_element * 9 + 7 ] = geometry.vertices[ face.c ].y;
-						positions[ cur_element * 9 + 8 ] = geometry.vertices[ face.c ].z;
+				geometry.faces.forEach( function ( face, index ) {
 
-						normals[ cur_element * 9 + 0 ] = face.normal.x;
-						normals[ cur_element * 9 + 1 ] = face.normal.y;
-						normals[ cur_element * 9 + 2 ] = face.normal.z;
-						normals[ cur_element * 9 + 3 ] = face.normal.x;
-						normals[ cur_element * 9 + 4 ] = face.normal.y;
-						normals[ cur_element * 9 + 5 ] = face.normal.z;
-						normals[ cur_element * 9 + 6 ] = face.normal.x;
-						normals[ cur_element * 9 + 7 ] = face.normal.y;
-						normals[ cur_element * 9 + 8 ] = face.normal.z;
+					positions.push( geometry.vertices[ face.a ].x );
+					positions.push( geometry.vertices[ face.a ].y );
+					positions.push( geometry.vertices[ face.a ].z );
+					positions.push( geometry.vertices[ face.b ].x );
+					positions.push( geometry.vertices[ face.b ].y );
+					positions.push( geometry.vertices[ face.b ].z );
+					positions.push( geometry.vertices[ face.c ].x );
+					positions.push( geometry.vertices[ face.c ].y );
+					positions.push( geometry.vertices[ face.c ].z );
 
-						colors[ cur_element * 9 + 0 ] = color.r;
-						colors[ cur_element * 9 + 1 ] = color.g;
-						colors[ cur_element * 9 + 2 ] = color.b;
-						colors[ cur_element * 9 + 3 ] = color.r;
-						colors[ cur_element * 9 + 4 ] = color.g;
-						colors[ cur_element * 9 + 5 ] = color.b;
-						colors[ cur_element * 9 + 6 ] = color.r;
-						colors[ cur_element * 9 + 7 ] = color.g;
-						colors[ cur_element * 9 + 8 ] = color.b;
+					normals.push( face.normal.x );
+					normals.push( face.normal.y );
+					normals.push( face.normal.z );
+					normals.push( face.normal.x );
+					normals.push( face.normal.y );
+					normals.push( face.normal.z );
+					normals.push( face.normal.x );
+					normals.push( face.normal.y );
+					normals.push( face.normal.z );
 
-					} );
+					colors.push( color.r );
+					colors.push( color.g );
+					colors.push( color.b );
+					colors.push( color.r );
+					colors.push( color.g );
+					colors.push( color.b );
+					colors.push( color.r );
+					colors.push( color.g );
+					colors.push( color.b );
 
-				}
+				} );
 
 			}
 
-			buffer_geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
-			buffer_geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
-			buffer_geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) );
-
-			buffer_geometry.computeBoundingSphere();
+			bufferGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
+			bufferGeometry.addAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) );
+			bufferGeometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
 
-			var buffer_material = new THREE.MeshPhongMaterial( {
-				color: 0x999999,
-				specular: 0x333333,
-				shininess: 50,
-				side: THREE.DoubleSide,
-				vertexColors: THREE.VertexColors,
-				shading: THREE.SmoothShading
+			var material = new THREE.MeshPhongMaterial( {
+				shininess: 80,
+				vertexColors: THREE.VertexColors
 			} );
 
-			var buffer_mesh = new THREE.Mesh( buffer_geometry, buffer_material );
-			scene.add( buffer_mesh );
+			var mesh = new THREE.Mesh( bufferGeometry, material );
+			scene.add( mesh );
 
 		}
 
@@ -237,6 +200,7 @@
 		function animate( time ) {
 
 			requestAnimationFrame( animate );
+
 			controls.update();
 			stats.update();
 			renderer.render( scene, camera );

+ 18 - 20
src/Three.Legacy.js

@@ -19,7 +19,6 @@ import {
 	BufferAttribute
 } from './core/BufferAttribute.js';
 import { BufferGeometry } from './core/BufferGeometry.js';
-import { EventDispatcher } from './core/EventDispatcher.js';
 import { Face3 } from './core/Face3.js';
 import { Geometry } from './core/Geometry';
 import { Object3D } from './core/Object3D.js';
@@ -218,6 +217,18 @@ export function ClosedSplineCurve3( points ) {
 
 ClosedSplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype );
 
+//
+
+export function SplineCurve3( points ) {
+
+	console.warn( 'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' );
+
+	CatmullRomCurve3.call( this, points );
+	this.type = 'catmullrom';
+
+}
+
+SplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype );
 
 //
 export function BoundingBoxHelper( object, color ) {
@@ -466,6 +477,12 @@ Object.assign( Matrix4.prototype, {
 
 		console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' );
 
+	},
+	makeFrustum: function( left, right, bottom, top, near, far ) {
+
+		console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' );
+		return this.makePerspective( left, right, top, bottom, near, far );
+
 	}
 
 } );
@@ -911,25 +928,6 @@ Object.defineProperties( ShaderMaterial.prototype, {
 
 //
 
-EventDispatcher.prototype = Object.assign( Object.create( {
-
-	// Note: Extra base ensures these properties are not 'assign'ed.
-
-	constructor: EventDispatcher,
-
-	apply: function ( target ) {
-
-		console.warn( "THREE.EventDispatcher: .apply is deprecated, " +
-				"just inherit or Object.assign the prototype to mix-in." );
-
-		Object.assign( target, this );
-
-	}
-
-} ), EventDispatcher.prototype );
-
-//
-
 Object.assign( WebGLRenderer.prototype, {
 
 	supportsFloatTextures: function () {

+ 0 - 1
src/Three.js

@@ -136,7 +136,6 @@ export { BoxHelper } from './extras/helpers/BoxHelper.js';
 export { ArrowHelper } from './extras/helpers/ArrowHelper.js';
 export { AxisHelper } from './extras/helpers/AxisHelper.js';
 export { CatmullRomCurve3 } from './extras/curves/CatmullRomCurve3.js';
-export { SplineCurve3 } from './extras/curves/SplineCurve3.js';
 export { CubicBezierCurve3 } from './extras/curves/CubicBezierCurve3.js';
 export { QuadraticBezierCurve3 } from './extras/curves/QuadraticBezierCurve3.js';
 export { LineCurve3 } from './extras/curves/LineCurve3.js';

+ 29 - 26
src/animation/AnimationMixer.js

@@ -27,12 +27,14 @@ function AnimationMixer( root ) {
 
 }
 
-Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
+AnimationMixer.prototype = {
+
+	constructor: AnimationMixer,
 
 	// return an action for a clip optionally using a custom root target
 	// object (this method allocates a lot of dynamic memory in case a
 	// previously unknown clip/root combination is specified)
-	clipAction: function( clip, optionalRoot ) {
+	clipAction: function ( clip, optionalRoot ) {
 
 		var root = optionalRoot || this._root,
 			rootUuid = root.uuid,
@@ -82,7 +84,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// get an existing action
-	existingAction: function( clip, optionalRoot ) {
+	existingAction: function ( clip, optionalRoot ) {
 
 		var root = optionalRoot || this._root,
 			rootUuid = root.uuid,
@@ -105,7 +107,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// deactivates all previously scheduled actions
-	stopAllAction: function() {
+	stopAllAction: function () {
 
 		var actions = this._actions,
 			nActions = this._nActiveActions,
@@ -132,7 +134,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// advance the time and update apply the animation
-	update: function( deltaTime ) {
+	update: function ( deltaTime ) {
 
 		deltaTime *= this.timeScale;
 
@@ -174,14 +176,14 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// return this mixer's root target object
-	getRoot: function() {
+	getRoot: function () {
 
 		return this._root;
 
 	},
 
 	// free all resources specific to a particular clip
-	uncacheClip: function( clip ) {
+	uncacheClip: function ( clip ) {
 
 		var actions = this._actions,
 			clipUuid = clip.uuid,
@@ -223,7 +225,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// free all resources specific to a particular root target object
-	uncacheRoot: function( root ) {
+	uncacheRoot: function ( root ) {
 
 		var rootUuid = root.uuid,
 			actionsByClip = this._actionsByClip;
@@ -260,7 +262,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 	},
 
 	// remove a targeted clip from the cache
-	uncacheAction: function( clip, optionalRoot ) {
+	uncacheAction: function ( clip, optionalRoot ) {
 
 		var action = this.existingAction( clip, optionalRoot );
 
@@ -273,13 +275,13 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 // Implementation details:
 
 Object.assign( AnimationMixer.prototype, {
 
-	_bindAction: function( action, prototypeAction ) {
+	_bindAction: function ( action, prototypeAction ) {
 
 		var root = action._localRoot || this._root,
 			tracks = action._clip.tracks,
@@ -346,7 +348,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_activateAction: function( action ) {
+	_activateAction: function ( action ) {
 
 		if ( ! this._isActiveAction( action ) ) {
 
@@ -388,7 +390,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_deactivateAction: function( action ) {
+	_deactivateAction: function ( action ) {
 
 		if ( this._isActiveAction( action ) ) {
 
@@ -416,7 +418,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory manager
 
-	_initMemoryManager: function() {
+	_initMemoryManager: function () {
 
 		this._actions = []; // 'nActiveActions' followed by inactive ones
 		this._nActiveActions = 0;
@@ -461,14 +463,14 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory management for AnimationAction objects
 
-	_isActiveAction: function( action ) {
+	_isActiveAction: function ( action ) {
 
 		var index = action._cacheIndex;
 		return index !== null && index < this._nActiveActions;
 
 	},
 
-	_addInactiveAction: function( action, clipUuid, rootUuid ) {
+	_addInactiveAction: function ( action, clipUuid, rootUuid ) {
 
 		var actions = this._actions,
 			actionsByClip = this._actionsByClip,
@@ -503,7 +505,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_removeInactiveAction: function( action ) {
+	_removeInactiveAction: function ( action ) {
 
 		var actions = this._actions,
 			lastInactiveAction = actions[ actions.length - 1 ],
@@ -548,7 +550,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_removeInactiveBindingsForAction: function( action ) {
+	_removeInactiveBindingsForAction: function ( action ) {
 
 		var bindings = action._propertyBindings;
 		for ( var i = 0, n = bindings.length; i !== n; ++ i ) {
@@ -565,7 +567,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_lendAction: function( action ) {
+	_lendAction: function ( action ) {
 
 		// [ active actions |  inactive actions  ]
 		// [  active actions >| inactive actions ]
@@ -588,7 +590,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_takeBackAction: function( action ) {
+	_takeBackAction: function ( action ) {
 
 		// [  active actions  | inactive actions ]
 		// [ active actions |< inactive actions  ]
@@ -613,7 +615,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory management for PropertyMixer objects
 
-	_addInactiveBinding: function( binding, rootUuid, trackName ) {
+	_addInactiveBinding: function ( binding, rootUuid, trackName ) {
 
 		var bindingsByRoot = this._bindingsByRootAndName,
 			bindingByName = bindingsByRoot[ rootUuid ],
@@ -634,7 +636,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_removeInactiveBinding: function( binding ) {
+	_removeInactiveBinding: function ( binding ) {
 
 		var bindings = this._bindings,
 			propBinding = binding.binding,
@@ -662,7 +664,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_lendBinding: function( binding ) {
+	_lendBinding: function ( binding ) {
 
 		var bindings = this._bindings,
 			prevIndex = binding._cacheIndex,
@@ -679,7 +681,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_takeBackBinding: function( binding ) {
+	_takeBackBinding: function ( binding ) {
 
 		var bindings = this._bindings,
 			prevIndex = binding._cacheIndex,
@@ -699,7 +701,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	// Memory management of Interpolants for weight and time scale
 
-	_lendControlInterpolant: function() {
+	_lendControlInterpolant: function () {
 
 		var interpolants = this._controlInterpolants,
 			lastActiveIndex = this._nActiveControlInterpolants ++,
@@ -720,7 +722,7 @@ Object.assign( AnimationMixer.prototype, {
 
 	},
 
-	_takeBackControlInterpolant: function( interpolant ) {
+	_takeBackControlInterpolant: function ( interpolant ) {
 
 		var interpolants = this._controlInterpolants,
 			prevIndex = interpolant.__cacheIndex,
@@ -741,5 +743,6 @@ Object.assign( AnimationMixer.prototype, {
 
 } );
 
+Object.assign( AnimationMixer.prototype, EventDispatcher.prototype );
 
 export { AnimationMixer };

+ 1 - 2
src/cameras/PerspectiveCamera.js

@@ -193,8 +193,7 @@ PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ),
 		var skew = this.filmOffset;
 		if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
 
-		this.projectionMatrix.makeFrustum(
-				left, left + width, top - height, top, near, this.far );
+		this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
 
 	},
 

+ 5 - 2
src/core/BufferGeometry.js

@@ -38,7 +38,9 @@ function BufferGeometry() {
 
 }
 
-Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
+BufferGeometry.prototype = {
+
+	constructor: BufferGeometry,
 
 	isBufferGeometry: true,
 
@@ -1033,9 +1035,10 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 BufferGeometry.MaxIndex = 65535;
 
+Object.assign( BufferGeometry.prototype, EventDispatcher.prototype );
 
 export { BufferGeometry };

+ 2 - 2
src/core/EventDispatcher.js

@@ -4,7 +4,7 @@
 
 function EventDispatcher() {}
 
-Object.assign( EventDispatcher.prototype, {
+EventDispatcher.prototype = {
 
 	addEventListener: function ( type, listener ) {
 
@@ -87,7 +87,7 @@ Object.assign( EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
 
 export { EventDispatcher };

+ 12 - 12
src/core/Geometry.js

@@ -19,6 +19,9 @@ import { _Math } from '../math/Math';
  * @author bhouston / http://clara.io
  */
 
+var count = 0;
+function GeometryIdCount() { return count++; };
+
 function Geometry() {
 
 	Object.defineProperty( this, 'id', { value: GeometryIdCount() } );
@@ -31,7 +34,7 @@ function Geometry() {
 	this.vertices = [];
 	this.colors = [];
 	this.faces = [];
-	this.faceVertexUvs = [ [] ];
+	this.faceVertexUvs = [[]];
 
 	this.morphTargets = [];
 	this.morphNormals = [];
@@ -56,7 +59,9 @@ function Geometry() {
 
 }
 
-Object.assign( Geometry.prototype, EventDispatcher.prototype, {
+Geometry.prototype = {
+
+	constructor: Geometry,
 
 	isGeometry: true,
 
@@ -308,7 +313,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 					for ( var j = start, jl = start + count; j < jl; j += 3 ) {
 
-						addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex  );
+						addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex );
 
 					}
 
@@ -701,7 +706,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 	merge: function ( geometry, matrix, materialIndexOffset ) {
 
-		if ( (geometry && geometry.isGeometry) === false ) {
+		if ( ( geometry && geometry.isGeometry ) === false ) {
 
 			console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );
 			return;
@@ -821,7 +826,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 	mergeMesh: function ( mesh ) {
 
-		if ( (mesh && mesh.isMesh) === false ) {
+		if ( ( mesh && mesh.isMesh ) === false ) {
 
 			console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );
 			return;
@@ -886,15 +891,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 			indices = [ face.a, face.b, face.c ];
 
-			var dupIndex = - 1;
-
 			// if any duplicate vertices are found in a Face3
 			// we have to remove the face as nothing can be saved
 			for ( var n = 0; n < 3; n ++ ) {
 
 				if ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) {
 
-					dupIndex = n;
 					faceIndicesToRemove.push( i );
 					break;
 
@@ -1265,10 +1267,8 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
-
-var count = 0;
-function GeometryIdCount() { return count++; };
+};
 
+Object.assign( Geometry.prototype, EventDispatcher.prototype );
 
 export { GeometryIdCount, Geometry };

+ 6 - 2
src/core/Object3D.js

@@ -101,7 +101,9 @@ function Object3D() {
 Object3D.DefaultUp = new Vector3( 0, 1, 0 );
 Object3D.DefaultMatrixAutoUpdate = true;
 
-Object.assign( Object3D.prototype, EventDispatcher.prototype, {
+Object3D.prototype = {
+
+	constructor: Object3D,
 
 	isObject3D: true,
 
@@ -728,6 +730,8 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
+
+Object.assign( Object3D.prototype, EventDispatcher.prototype );
 
 export { Object3D };

+ 1 - 1
src/extras/core/Curve.js

@@ -27,7 +27,7 @@ import { Matrix4 } from '../../math/Matrix4';
  * THREE.LineCurve3
  * THREE.QuadraticBezierCurve3
  * THREE.CubicBezierCurve3
- * THREE.SplineCurve3
+ * THREE.CatmullRomCurve3
  *
  * A series of curves can be represented as a THREE.CurvePath
  *

+ 0 - 45
src/extras/curves/SplineCurve3.js

@@ -1,45 +0,0 @@
-import { Vector3 } from '../../math/Vector3';
-import { CurveUtils } from '../CurveUtils';
-import { Curve } from '../core/Curve';
-
-/**************************************************************
- *	Spline 3D curve
- **************************************************************/
-
-
-var SplineCurve3 = Curve.create(
-
-	function ( points /* array of Vector3 */ ) {
-
-		console.warn( 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3' );
-		this.points = ( points === undefined ) ? [] : points;
-
-	},
-
-	function ( t ) {
-
-		var points = this.points;
-		var point = ( points.length - 1 ) * t;
-
-		var intPoint = Math.floor( point );
-		var weight = point - intPoint;
-
-		var point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ];
-		var point1 = points[ intPoint ];
-		var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];
-		var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];
-
-		var interpolate = CurveUtils.interpolate;
-
-		return new Vector3(
-			interpolate( point0.x, point1.x, point2.x, point3.x, weight ),
-			interpolate( point0.y, point1.y, point2.y, point3.y, weight ),
-			interpolate( point0.z, point1.z, point2.z, point3.z, weight )
-		);
-
-	}
-
-);
-
-
-export { SplineCurve3 };

+ 7 - 0
src/loaders/ImageLoader.js

@@ -48,6 +48,13 @@ Object.assign( ImageLoader.prototype, {
 			loader.setPath( this.path );
 			loader.setResponseType( 'blob' );
 			loader.setWithCredentials( this.withCredentials );
+
+			// By default the FileLoader requests files to be loaded with a MIME
+			// type of `text/plain`. Using `URL.createObjectURL()` with SVGs that
+			// have a MIME type of `text/plain` results in an error, so explicitly
+			// set the SVG MIME type.
+			if ( /\.svg$/.test( url ) ) loader.setMimeType( 'image/svg+xml' );
+
 			loader.load( url, function ( blob ) {
 
 				image.src = URL.createObjectURL( blob );

+ 1 - 1
src/materials/Material.js

@@ -110,7 +110,7 @@ Material.prototype = {
 
 				currentValue.set( newValue );
 
-			} else if ( (currentValue && currentValue.isVector3) && (newValue && newValue.isVector3) ) {
+			} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {
 
 				currentValue.copy( newValue );
 

+ 7 - 12
src/math/Matrix4.js

@@ -833,7 +833,13 @@ Matrix4.prototype = {
 
 	}(),
 
-	makeFrustum: function ( left, right, bottom, top, near, far ) {
+	makePerspective: function ( left, right, top, bottom, near, far ) {
+
+		if ( far === undefined ) {
+
+			console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );
+
+		}
 
 		var te = this.elements;
 		var x = 2 * near / ( right - left );
@@ -853,17 +859,6 @@ Matrix4.prototype = {
 
 	},
 
-	makePerspective: function ( fov, aspect, near, far ) {
-
-		var ymax = near * Math.tan( _Math.DEG2RAD * fov * 0.5 );
-		var ymin = - ymax;
-		var xmin = ymin * aspect;
-		var xmax = ymax * aspect;
-
-		return this.makeFrustum( xmin, xmax, ymin, ymax, near, far );
-
-	},
-
 	makeOrthographic: function ( left, right, top, bottom, near, far ) {
 
 		var te = this.elements;

+ 5 - 2
src/renderers/WebGLRenderTarget.js

@@ -39,7 +39,9 @@ function WebGLRenderTarget( width, height, options ) {
 
 }
 
-Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
+WebGLRenderTarget.prototype = {
+
+	constructor: WebGLRenderTarget,
 
 	isWebGLRenderTarget: true,
 
@@ -88,7 +90,8 @@ Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
 
 	}
 
-} );
+};
 
+Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype );
 
 export { WebGLRenderTarget };

+ 0 - 56
test/unit/extras/curves/ClosedSplineCurve3.js

@@ -1,56 +0,0 @@
-/**
- * @author zz85 / http://joshuakoo.com
- */
-
-module( "ClosedSplineCurve3" );
-
-var threshold = 0.000001;
-
-function vectorsAreEqual( check, that ) {
-
-	if ( check.length !== that.length ) return 'Length not equal';
-
-	for ( var i = 0; i < check.length; i ++ ) {
-
-		var a = check[ i ], b = that[ i ];
-		if ( a.distanceToSquared( b ) > threshold ) {
-
-			return 'Vector differs at index ' + i +
-				'. Should be ' + [ a.x, a.y, a.z ] +
-				' instead of ' + [ b.x, b.y, b.z ];
-		}
-	}
-
-}
-
-test( "basic check", function() {
-
-	var closedSpline = new THREE.ClosedSplineCurve3( [
-		new THREE.Vector3( -60, -100,  60 ),
-		new THREE.Vector3( -60,   20,  60 ),
-		new THREE.Vector3( -60,  120,  60 ),
-		new THREE.Vector3(  60,   20, -60 ),
-		new THREE.Vector3(  60, -100, -60 )
-	] );
-
-	var closedSplinePoints = [
-		new THREE.Vector3(-60,-100,60),
-		new THREE.Vector3(-67.5,-46.25,67.5),
-		new THREE.Vector3(-60,20,60),
-		new THREE.Vector3(-67.5,83.75,67.5),
-		new THREE.Vector3(-60,120,60),
-		new THREE.Vector3(0,83.75,0),
-		new THREE.Vector3(60,20,-60),
-		new THREE.Vector3(75,-46.25,-75),
-		new THREE.Vector3(60,-100,-60),
-		new THREE.Vector3(0,-115,0),
-		new THREE.Vector3(-60,-100,60),
-	];
-
-	var getPoints = closedSpline.getPoints(10);
-	var error = vectorsAreEqual( getPoints , closedSplinePoints );
-	ok( getPoints.length == 11, 'getPoints should be equal.');
-	var desc = error ? ' ' + error : '';
-	ok( !error, 'Lists of Vectors3 should be equal.' + desc );
-
-});

+ 4 - 4
test/unit/math/Frustum.js

@@ -87,8 +87,8 @@ test( "setFromMatrix/makeOrthographic/containsPoint", function() {
 
 });
 
-test( "setFromMatrix/makeFrustum/containsPoint", function() {
-	var m = new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 100 );
+test( "setFromMatrix/makePerspective/containsPoint", function() {
+	var m = new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 100 );
 	var a = new THREE.Frustum().setFromMatrix( m );
 
 	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
@@ -106,8 +106,8 @@ test( "setFromMatrix/makeFrustum/containsPoint", function() {
 	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, -101 ) ), "Passed!" );
 });
 
-test( "setFromMatrix/makeFrustum/intersectsSphere", function() {
-	var m = new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 100 );
+test( "setFromMatrix/makePerspective/intersectsSphere", function() {
+	var m = new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 100 );
 	var a = new THREE.Frustum().setFromMatrix( m );
 
 	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, 0 ), 0 ) ), "Passed!" );

+ 2 - 2
test/unit/math/Matrix4.js

@@ -184,8 +184,8 @@ test( "getInverse", function() {
 		new THREE.Matrix4().makeRotationZ( -0.3 ),
 		new THREE.Matrix4().makeScale( 1, 2, 3 ),
 		new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 ),
-		new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 1000 ),
-		new THREE.Matrix4().makeFrustum( -16, 16, -9, 9, 0.1, 10000 ),
+		new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 1000 ),
+		new THREE.Matrix4().makePerspective( -16, 16, 9, -9, 0.1, 10000 ),
 		new THREE.Matrix4().makeTranslation( 1, 2, 3 )
 		];
 

+ 0 - 2
test/unit/unittests_sources.html

@@ -36,7 +36,6 @@
   <script src="../../src/extras/core/Curve.js"></script>
   <script src="../../src/extras/CurveUtils.js"></script>
   <script src="../../src/extras/curves/CatmullRomCurve3.js"></script>
-  <script src="../../src/extras/curves/ClosedSplineCurve3.js"></script>
 
   <!-- add class-based unit tests below -->
 
@@ -60,7 +59,6 @@
   <script src="math/Color.js"></script>
   <script src="math/Interpolant.js"></script>
 
-  <script src="extras/curves/ClosedSplineCurve3.js"></script>
   <script src="extras/curves/CatmullRomCurve3.js"></script>
 
 </body>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.