Prechádzať zdrojové kódy

Merge branch 'dev' into geometry

Mr.doob 4 rokov pred
rodič
commit
0e2d3aaf8e

+ 59 - 98
build/three.js

@@ -19855,6 +19855,7 @@
 		copy: function copy(source) {
 			Mesh.prototype.copy.call(this, source);
 			this.instanceMatrix.copy(source.instanceMatrix);
+			if (source.instanceColor !== null) this.instanceColor = source.instanceColor.clone();
 			this.count = source.count;
 			return this;
 		},
@@ -22097,8 +22098,9 @@
 			};
 			thresholdAngle = thresholdAngle !== undefined ? thresholdAngle : 1;
 
-			if (geometry.isGeometry) {
-				geometry = new BufferGeometry().fromGeometry(geometry);
+			if (geometry.isGeometry === true) {
+				console.error('THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');
+				return _assertThisInitialized(_this);
 			}
 
 			var precisionPoints = 4;
@@ -24823,34 +24825,55 @@
 			var _this;
 
 			_this = _BufferGeometry.call(this) || this;
-			_this.type = 'WireframeGeometry'; // buffer
+			_this.type = 'WireframeGeometry';
+
+			if (geometry.isGeometry === true) {
+				console.error('THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');
+				return _assertThisInitialized(_this);
+			} // buffer
+
 
 			var vertices = []; // helper variables
 
 			var edge = [0, 0],
 					edges = {};
-			var keys = ['a', 'b', 'c']; // different logic for Geometry and BufferGeometry
+			var vertex = new Vector3();
+
+			if (geometry.index !== null) {
+				// indexed BufferGeometry
+				var position = geometry.attributes.position;
+				var indices = geometry.index;
+				var groups = geometry.groups;
 
-			if (geometry && geometry.isGeometry) {
-				// create a data structure that contains all edges without duplicates
-				var faces = geometry.faces;
+				if (groups.length === 0) {
+					groups = [{
+						start: 0,
+						count: indices.count,
+						materialIndex: 0
+					}];
+				} // create a data structure that contains all eges without duplicates
 
-				for (var i = 0, l = faces.length; i < l; i++) {
-					var face = faces[i];
 
-					for (var j = 0; j < 3; j++) {
-						var edge1 = face[keys[j]];
-						var edge2 = face[keys[(j + 1) % 3]];
-						edge[0] = Math.min(edge1, edge2); // sorting prevents duplicates
+				for (var o = 0, ol = groups.length; o < ol; ++o) {
+					var group = groups[o];
+					var start = group.start;
+					var count = group.count;
 
-						edge[1] = Math.max(edge1, edge2);
-						var key = edge[0] + ',' + edge[1];
+					for (var i = start, l = start + count; i < l; i += 3) {
+						for (var j = 0; j < 3; j++) {
+							var edge1 = indices.getX(i + j);
+							var edge2 = indices.getX(i + (j + 1) % 3);
+							edge[0] = Math.min(edge1, edge2); // sorting prevents duplicates
 
-						if (edges[key] === undefined) {
-							edges[key] = {
-								index1: edge[0],
-								index2: edge[1]
-							};
+							edge[1] = Math.max(edge1, edge2);
+							var key = edge[0] + ',' + edge[1];
+
+							if (edges[key] === undefined) {
+								edges[key] = {
+									index1: edge[0],
+									index2: edge[1]
+								};
+							}
 						}
 					}
 				} // generate vertices
@@ -24858,87 +24881,25 @@
 
 				for (var _key in edges) {
 					var e = edges[_key];
-					var vertex = geometry.vertices[e.index1];
+					vertex.fromBufferAttribute(position, e.index1);
 					vertices.push(vertex.x, vertex.y, vertex.z);
-					vertex = geometry.vertices[e.index2];
+					vertex.fromBufferAttribute(position, e.index2);
 					vertices.push(vertex.x, vertex.y, vertex.z);
 				}
-			} else if (geometry && geometry.isBufferGeometry) {
-				var _vertex = new Vector3();
-
-				if (geometry.index !== null) {
-					// indexed BufferGeometry
-					var position = geometry.attributes.position;
-					var indices = geometry.index;
-					var groups = geometry.groups;
-
-					if (groups.length === 0) {
-						groups = [{
-							start: 0,
-							count: indices.count,
-							materialIndex: 0
-						}];
-					} // create a data structure that contains all eges without duplicates
-
-
-					for (var o = 0, ol = groups.length; o < ol; ++o) {
-						var group = groups[o];
-						var start = group.start;
-						var count = group.count;
-
-						for (var _i = start, _l = start + count; _i < _l; _i += 3) {
-							for (var _j = 0; _j < 3; _j++) {
-								var _edge = indices.getX(_i + _j);
-
-								var _edge2 = indices.getX(_i + (_j + 1) % 3);
-
-								edge[0] = Math.min(_edge, _edge2); // sorting prevents duplicates
-
-								edge[1] = Math.max(_edge, _edge2);
-
-								var _key2 = edge[0] + ',' + edge[1];
-
-								if (edges[_key2] === undefined) {
-									edges[_key2] = {
-										index1: edge[0],
-										index2: edge[1]
-									};
-								}
-							}
-						}
-					} // generate vertices
-
-
-					for (var _key3 in edges) {
-						var _e = edges[_key3];
-
-						_vertex.fromBufferAttribute(position, _e.index1);
-
-						vertices.push(_vertex.x, _vertex.y, _vertex.z);
-
-						_vertex.fromBufferAttribute(position, _e.index2);
-
-						vertices.push(_vertex.x, _vertex.y, _vertex.z);
-					}
-				} else {
-					// non-indexed BufferGeometry
-					var _position = geometry.attributes.position;
-
-					for (var _i2 = 0, _l2 = _position.count / 3; _i2 < _l2; _i2++) {
-						for (var _j2 = 0; _j2 < 3; _j2++) {
-							// three edges per triangle, an edge is represented as (index1, index2)
-							// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)
-							var index1 = 3 * _i2 + _j2;
-
-							_vertex.fromBufferAttribute(_position, index1);
-
-							vertices.push(_vertex.x, _vertex.y, _vertex.z);
-							var index2 = 3 * _i2 + (_j2 + 1) % 3;
-
-							_vertex.fromBufferAttribute(_position, index2);
-
-							vertices.push(_vertex.x, _vertex.y, _vertex.z);
-						}
+			} else {
+				// non-indexed BufferGeometry
+				var _position = geometry.attributes.position;
+
+				for (var _i = 0, _l = _position.count / 3; _i < _l; _i++) {
+					for (var _j = 0; _j < 3; _j++) {
+						// three edges per triangle, an edge is represented as (index1, index2)
+						// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)
+						var index1 = 3 * _i + _j;
+						vertex.fromBufferAttribute(_position, index1);
+						vertices.push(vertex.x, vertex.y, vertex.z);
+						var index2 = 3 * _i + (_j + 1) % 3;
+						vertex.fromBufferAttribute(_position, index2);
+						vertices.push(vertex.x, vertex.y, vertex.z);
 					}
 				}
 			} // build geometry

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
build/three.min.js


+ 57 - 96
build/three.module.js

@@ -26658,6 +26658,9 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 		Mesh.prototype.copy.call( this, source );
 
 		this.instanceMatrix.copy( source.instanceMatrix );
+
+		if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();
+
 		this.count = source.count;
 
 		return this;
@@ -29674,9 +29677,10 @@ class EdgesGeometry extends BufferGeometry {
 
 		thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1;
 
-		if ( geometry.isGeometry ) {
+		if ( geometry.isGeometry === true ) {
 
-			geometry = new BufferGeometry().fromGeometry( geometry );
+			console.error( 'THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		}
 
@@ -33108,6 +33112,13 @@ class WireframeGeometry extends BufferGeometry {
 		super();
 		this.type = 'WireframeGeometry';
 
+		if ( geometry.isGeometry === true ) {
+
+			console.error( 'THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
+
+		}
+
 		// buffer
 
 		const vertices = [];
@@ -33115,96 +33126,46 @@ class WireframeGeometry extends BufferGeometry {
 		// helper variables
 
 		const edge = [ 0, 0 ], edges = {};
-		const keys = [ 'a', 'b', 'c' ];
-
-		// different logic for Geometry and BufferGeometry
-
-		if ( geometry && geometry.isGeometry ) {
-
-			// create a data structure that contains all edges without duplicates
-
-			const faces = geometry.faces;
-
-			for ( let i = 0, l = faces.length; i < l; i ++ ) {
-
-				const face = faces[ i ];
-
-				for ( let j = 0; j < 3; j ++ ) {
 
-					const edge1 = face[ keys[ j ] ];
-					const edge2 = face[ keys[ ( j + 1 ) % 3 ] ];
-					edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates
-					edge[ 1 ] = Math.max( edge1, edge2 );
+		const vertex = new Vector3();
 
-					const key = edge[ 0 ] + ',' + edge[ 1 ];
+		if ( geometry.index !== null ) {
 
-					if ( edges[ key ] === undefined ) {
+			// indexed BufferGeometry
 
-						edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] };
+			const position = geometry.attributes.position;
+			const indices = geometry.index;
+			let groups = geometry.groups;
 
-					}
+			if ( groups.length === 0 ) {
 
-				}
+				groups = [ { start: 0, count: indices.count, materialIndex: 0 } ];
 
 			}
 
-			// generate vertices
-
-			for ( const key in edges ) {
+			// create a data structure that contains all eges without duplicates
 
-				const e = edges[ key ];
+			for ( let o = 0, ol = groups.length; o < ol; ++ o ) {
 
-				let vertex = geometry.vertices[ e.index1 ];
-				vertices.push( vertex.x, vertex.y, vertex.z );
-
-				vertex = geometry.vertices[ e.index2 ];
-				vertices.push( vertex.x, vertex.y, vertex.z );
-
-			}
-
-		} else if ( geometry && geometry.isBufferGeometry ) {
-
-			const vertex = new Vector3();
+				const group = groups[ o ];
 
-			if ( geometry.index !== null ) {
-
-				// indexed BufferGeometry
-
-				const position = geometry.attributes.position;
-				const indices = geometry.index;
-				let groups = geometry.groups;
-
-				if ( groups.length === 0 ) {
-
-					groups = [ { start: 0, count: indices.count, materialIndex: 0 } ];
-
-				}
-
-				// create a data structure that contains all eges without duplicates
-
-				for ( let o = 0, ol = groups.length; o < ol; ++ o ) {
-
-					const group = groups[ o ];
-
-					const start = group.start;
-					const count = group.count;
-
-					for ( let i = start, l = ( start + count ); i < l; i += 3 ) {
+				const start = group.start;
+				const count = group.count;
 
-						for ( let j = 0; j < 3; j ++ ) {
+				for ( let i = start, l = ( start + count ); i < l; i += 3 ) {
 
-							const edge1 = indices.getX( i + j );
-							const edge2 = indices.getX( i + ( j + 1 ) % 3 );
-							edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates
-							edge[ 1 ] = Math.max( edge1, edge2 );
+					for ( let j = 0; j < 3; j ++ ) {
 
-							const key = edge[ 0 ] + ',' + edge[ 1 ];
+						const edge1 = indices.getX( i + j );
+						const edge2 = indices.getX( i + ( j + 1 ) % 3 );
+						edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates
+						edge[ 1 ] = Math.max( edge1, edge2 );
 
-							if ( edges[ key ] === undefined ) {
+						const key = edge[ 0 ] + ',' + edge[ 1 ];
 
-								edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] };
+						if ( edges[ key ] === undefined ) {
 
-							}
+							edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] };
 
 						}
 
@@ -33212,42 +33173,42 @@ class WireframeGeometry extends BufferGeometry {
 
 				}
 
-				// generate vertices
+			}
 
-				for ( const key in edges ) {
+			// generate vertices
 
-					const e = edges[ key ];
+			for ( const key in edges ) {
 
-					vertex.fromBufferAttribute( position, e.index1 );
-					vertices.push( vertex.x, vertex.y, vertex.z );
+				const e = edges[ key ];
 
-					vertex.fromBufferAttribute( position, e.index2 );
-					vertices.push( vertex.x, vertex.y, vertex.z );
+				vertex.fromBufferAttribute( position, e.index1 );
+				vertices.push( vertex.x, vertex.y, vertex.z );
 
-				}
+				vertex.fromBufferAttribute( position, e.index2 );
+				vertices.push( vertex.x, vertex.y, vertex.z );
 
-			} else {
+			}
 
-				// non-indexed BufferGeometry
+		} else {
 
-				const position = geometry.attributes.position;
+			// non-indexed BufferGeometry
 
-				for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {
+			const position = geometry.attributes.position;
 
-					for ( let j = 0; j < 3; j ++ ) {
+			for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {
 
-						// three edges per triangle, an edge is represented as (index1, index2)
-						// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)
+				for ( let j = 0; j < 3; j ++ ) {
 
-						const index1 = 3 * i + j;
-						vertex.fromBufferAttribute( position, index1 );
-						vertices.push( vertex.x, vertex.y, vertex.z );
+					// three edges per triangle, an edge is represented as (index1, index2)
+					// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)
 
-						const index2 = 3 * i + ( ( j + 1 ) % 3 );
-						vertex.fromBufferAttribute( position, index2 );
-						vertices.push( vertex.x, vertex.y, vertex.z );
+					const index1 = 3 * i + j;
+					vertex.fromBufferAttribute( position, index1 );
+					vertices.push( vertex.x, vertex.y, vertex.z );
 
-					}
+					const index2 = 3 * i + ( ( j + 1 ) % 3 );
+					vertex.fromBufferAttribute( position, index2 );
+					vertices.push( vertex.x, vertex.y, vertex.z );
 
 				}
 

+ 1 - 1
docs/api/en/geometries/EdgesGeometry.html

@@ -29,7 +29,7 @@ scene.add( line );
 
 		<h2>Constructor</h2>
 
-		<h3>[name]( [param:Geometry geometry], [param:Integer thresholdAngle] )</h3>
+		<h3>[name]( [param:BufferGeometry geometry], [param:Integer thresholdAngle] )</h3>
 		<p>
 		geometry — Any geometry object.<br />
 		thresholdAngle — An edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.

+ 1 - 1
docs/api/en/geometries/WireframeGeometry.html

@@ -36,7 +36,7 @@
 
 		<h2>Constructor</h2>
 
-		<h3>[name]( [param:Geometry geometry] )</h3>
+		<h3>[name]( [param:BufferGeometry geometry] )</h3>
 		<p>
 		geometry — any geometry object.
 		</p>

+ 1 - 1
docs/api/zh/geometries/EdgesGeometry.html

@@ -28,7 +28,7 @@
 
 		<h2>构造器</h2>
 
-		<h3>[name]( [param:Geometry geometry], [param:Integer thresholdAngle] )</h3>
+		<h3>[name]( [param:BufferGeometry geometry], [param:Integer thresholdAngle] )</h3>
 		<p>
 		geometry — 任何一个几何体对象。<br />
 		thresholdAngle — 仅当相邻面的法线之间的角度(单位为角度)超过这个值时,才会渲染边缘。默认值为1。

+ 1 - 1
docs/api/zh/geometries/WireframeGeometry.html

@@ -35,7 +35,7 @@
 
 		<h2>构造器</h2>
 
-		<h3>[name]( [param:Geometry geometry] )</h3>
+		<h3>[name]( [param:BufferGeometry geometry] )</h3>
 		<p>
 		geometry — 任意几何体对象。
 		</p>

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

@@ -89,7 +89,7 @@
 		<div>
 			<p>
 				تسمح BMFonts (الخطوط النقطية) بدمج الصور الرمزية في BufferGeometry واحد. يدعم عرض BMFont التفاف الكلمات ، وتباعد الأحرف ، وتقنين الأحرف ، وحقول المسافة الموقعة مع المشتقات القياسية ، وحقول المسافة الموقعة متعددة القنوات ، والخطوط متعددة الأنسجة ، والمزيد.
-				انظر [link:https://github.com/Jam3/three-bmfont-text three-bmfont-text].
+				انظر [link:https://github.com/felixmariotto/three-mesh-ui three-mesh-ui] أو [link:https://github.com/Jam3/three-bmfont-text three-bmfont-text].
 			</p>
 			<p>
 				تتوفر الخطوط في مشاريع مثل [link:https://github.com/etiennepinchon/aframe-fonts A-Frame Fonts] ، أو يمكنك إنشاء خطوطك الخاصة من أي خط .TTF ، مع التحسين لتضمين الأحرف المطلوبة  للمشروع.

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

@@ -97,7 +97,7 @@
 				BMFonts (bitmap fonts) allow batching glyphs into a single BufferGeometry. BMFont rendering
 				supports word-wrapping, letter spacing, kerning, signed distance fields with standard
 				derivatives, multi-channel signed distance fields, multi-texture fonts, and more.
-				See [link:https://github.com/Jam3/three-bmfont-text three-bmfont-text].
+				See [link:https://github.com/felixmariotto/three-mesh-ui three-mesh-ui] or [link:https://github.com/Jam3/three-bmfont-text three-bmfont-text].
 			</p>
 			<p>
 				Stock fonts are available in projects like

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

@@ -87,7 +87,7 @@
 		<div>
 			<p>
 				BMFonts (位图字体) 可以将字形批处理为单个BufferGeometry。BMFont的渲染支持自动换行、字母间距、字句调整、signed distance fields with standard derivatives、multi-channel signed distance fields、多纹理字体等特性。
-				详情请参阅[link:https://github.com/Jam3/three-bmfont-text three-bmfont-text]。
+				详情请参阅 [link:https://github.com/felixmariotto/three-mesh-ui three-mesh-ui] 或 [link:https://github.com/Jam3/three-bmfont-text three-bmfont-text]。
 			</p>
 			<p>
 				现有库存的字体在项目中同样可用,就像[link:https://github.com/etiennepinchon/aframe-fonts A-Frame Fonts]一样,

+ 6 - 7
examples/js/geometries/DecalGeometry.js

@@ -49,7 +49,7 @@ THREE.DecalGeometry = function ( mesh, position, orientation, size ) {
 	function generate() {
 
 		var i;
-		var geometry = new THREE.BufferGeometry();
+
 		var decalVertices = [];
 
 		var vertex = new THREE.Vector3();
@@ -57,16 +57,15 @@ THREE.DecalGeometry = function ( mesh, position, orientation, size ) {
 
 		// handle different geometry types
 
-		if ( mesh.geometry.isGeometry ) {
-
-			geometry.fromGeometry( mesh.geometry );
+		if ( mesh.geometry.isGeometry === true ) {
 
-		} else {
-
-			geometry.copy( mesh.geometry );
+			console.error( 'THREE.DecalGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		}
 
+		var geometry = mesh.geometry;
+
 		var positionAttribute = geometry.attributes.position;
 		var normalAttribute = geometry.attributes.normal;
 

+ 6 - 7
examples/jsm/geometries/DecalGeometry.js

@@ -56,7 +56,7 @@ var DecalGeometry = function ( mesh, position, orientation, size ) {
 	function generate() {
 
 		var i;
-		var geometry = new BufferGeometry();
+
 		var decalVertices = [];
 
 		var vertex = new Vector3();
@@ -64,16 +64,15 @@ var DecalGeometry = function ( mesh, position, orientation, size ) {
 
 		// handle different geometry types
 
-		if ( mesh.geometry.isGeometry ) {
-
-			geometry.fromGeometry( mesh.geometry );
+		if ( mesh.geometry.isGeometry === true ) {
 
-		} else {
-
-			geometry.copy( mesh.geometry );
+			console.error( 'THREE.DecalGeometry no longer supports THREE.Geometry. Use BufferGeometry instead.' );
+			return;
 
 		}
 
+		var geometry = mesh.geometry;
+
 		var positionAttribute = geometry.attributes.position;
 		var normalAttribute = geometry.attributes.normal;
 

+ 1 - 2
src/geometries/EdgesGeometry.d.ts

@@ -1,5 +1,4 @@
 import { BufferGeometry } from '../core/BufferGeometry';
-import { Geometry } from '../core/Geometry';
 
 export class EdgesGeometry extends BufferGeometry {
 
@@ -7,7 +6,7 @@ export class EdgesGeometry extends BufferGeometry {
 	 * @param geometry
 	 * @param [thresholdAngle=1]
 	 */
-	constructor( geometry: BufferGeometry | Geometry, thresholdAngle?: number );
+	constructor( geometry: BufferGeometry, thresholdAngle?: number );
 
 	/**
 	 * @default 'EdgesGeometry'

+ 3 - 2
src/geometries/EdgesGeometry.js

@@ -23,9 +23,10 @@ class EdgesGeometry extends BufferGeometry {
 
 		thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1;
 
-		if ( geometry.isGeometry ) {
+		if ( geometry.isGeometry === true ) {
 
-			geometry = new BufferGeometry().fromGeometry( geometry );
+			console.error( 'THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		}
 

+ 1 - 2
src/geometries/WireframeGeometry.d.ts

@@ -1,9 +1,8 @@
-import { Geometry } from './../core/Geometry';
 import { BufferGeometry } from './../core/BufferGeometry';
 
 export class WireframeGeometry extends BufferGeometry {
 
-	constructor( geometry: Geometry | BufferGeometry );
+	constructor( geometry: BufferGeometry );
 
 	/**
 	 * @default 'WireframeGeometry'

+ 51 - 94
src/geometries/WireframeGeometry.js

@@ -9,6 +9,13 @@ class WireframeGeometry extends BufferGeometry {
 		super();
 		this.type = 'WireframeGeometry';
 
+		if ( geometry.isGeometry === true ) {
+
+			console.error( 'THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
+
+		}
+
 		// buffer
 
 		const vertices = [];
@@ -16,96 +23,46 @@ class WireframeGeometry extends BufferGeometry {
 		// helper variables
 
 		const edge = [ 0, 0 ], edges = {};
-		const keys = [ 'a', 'b', 'c' ];
-
-		// different logic for Geometry and BufferGeometry
-
-		if ( geometry && geometry.isGeometry ) {
-
-			// create a data structure that contains all edges without duplicates
-
-			const faces = geometry.faces;
-
-			for ( let i = 0, l = faces.length; i < l; i ++ ) {
-
-				const face = faces[ i ];
-
-				for ( let j = 0; j < 3; j ++ ) {
-
-					const edge1 = face[ keys[ j ] ];
-					const edge2 = face[ keys[ ( j + 1 ) % 3 ] ];
-					edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates
-					edge[ 1 ] = Math.max( edge1, edge2 );
 
-					const key = edge[ 0 ] + ',' + edge[ 1 ];
+		const vertex = new Vector3();
 
-					if ( edges[ key ] === undefined ) {
+		if ( geometry.index !== null ) {
 
-						edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] };
+			// indexed BufferGeometry
 
-					}
-
-				}
+			const position = geometry.attributes.position;
+			const indices = geometry.index;
+			let groups = geometry.groups;
 
-			}
+			if ( groups.length === 0 ) {
 
-			// generate vertices
-
-			for ( const key in edges ) {
-
-				const e = edges[ key ];
-
-				let vertex = geometry.vertices[ e.index1 ];
-				vertices.push( vertex.x, vertex.y, vertex.z );
-
-				vertex = geometry.vertices[ e.index2 ];
-				vertices.push( vertex.x, vertex.y, vertex.z );
+				groups = [ { start: 0, count: indices.count, materialIndex: 0 } ];
 
 			}
 
-		} else if ( geometry && geometry.isBufferGeometry ) {
+			// create a data structure that contains all eges without duplicates
 
-			const vertex = new Vector3();
+			for ( let o = 0, ol = groups.length; o < ol; ++ o ) {
 
-			if ( geometry.index !== null ) {
+				const group = groups[ o ];
 
-				// indexed BufferGeometry
+				const start = group.start;
+				const count = group.count;
 
-				const position = geometry.attributes.position;
-				const indices = geometry.index;
-				let groups = geometry.groups;
+				for ( let i = start, l = ( start + count ); i < l; i += 3 ) {
 
-				if ( groups.length === 0 ) {
-
-					groups = [ { start: 0, count: indices.count, materialIndex: 0 } ];
-
-				}
-
-				// create a data structure that contains all eges without duplicates
-
-				for ( let o = 0, ol = groups.length; o < ol; ++ o ) {
-
-					const group = groups[ o ];
-
-					const start = group.start;
-					const count = group.count;
-
-					for ( let i = start, l = ( start + count ); i < l; i += 3 ) {
-
-						for ( let j = 0; j < 3; j ++ ) {
-
-							const edge1 = indices.getX( i + j );
-							const edge2 = indices.getX( i + ( j + 1 ) % 3 );
-							edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates
-							edge[ 1 ] = Math.max( edge1, edge2 );
+					for ( let j = 0; j < 3; j ++ ) {
 
-							const key = edge[ 0 ] + ',' + edge[ 1 ];
+						const edge1 = indices.getX( i + j );
+						const edge2 = indices.getX( i + ( j + 1 ) % 3 );
+						edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates
+						edge[ 1 ] = Math.max( edge1, edge2 );
 
-							if ( edges[ key ] === undefined ) {
+						const key = edge[ 0 ] + ',' + edge[ 1 ];
 
-								edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] };
+						if ( edges[ key ] === undefined ) {
 
-							}
+							edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] };
 
 						}
 
@@ -113,42 +70,42 @@ class WireframeGeometry extends BufferGeometry {
 
 				}
 
-				// generate vertices
+			}
 
-				for ( const key in edges ) {
+			// generate vertices
 
-					const e = edges[ key ];
+			for ( const key in edges ) {
 
-					vertex.fromBufferAttribute( position, e.index1 );
-					vertices.push( vertex.x, vertex.y, vertex.z );
+				const e = edges[ key ];
 
-					vertex.fromBufferAttribute( position, e.index2 );
-					vertices.push( vertex.x, vertex.y, vertex.z );
+				vertex.fromBufferAttribute( position, e.index1 );
+				vertices.push( vertex.x, vertex.y, vertex.z );
 
-				}
+				vertex.fromBufferAttribute( position, e.index2 );
+				vertices.push( vertex.x, vertex.y, vertex.z );
 
-			} else {
+			}
 
-				// non-indexed BufferGeometry
+		} else {
 
-				const position = geometry.attributes.position;
+			// non-indexed BufferGeometry
 
-				for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {
+			const position = geometry.attributes.position;
 
-					for ( let j = 0; j < 3; j ++ ) {
+			for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {
 
-						// three edges per triangle, an edge is represented as (index1, index2)
-						// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)
+				for ( let j = 0; j < 3; j ++ ) {
 
-						const index1 = 3 * i + j;
-						vertex.fromBufferAttribute( position, index1 );
-						vertices.push( vertex.x, vertex.y, vertex.z );
+					// three edges per triangle, an edge is represented as (index1, index2)
+					// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)
 
-						const index2 = 3 * i + ( ( j + 1 ) % 3 );
-						vertex.fromBufferAttribute( position, index2 );
-						vertices.push( vertex.x, vertex.y, vertex.z );
+					const index1 = 3 * i + j;
+					vertex.fromBufferAttribute( position, index1 );
+					vertices.push( vertex.x, vertex.y, vertex.z );
 
-					}
+					const index2 = 3 * i + ( ( j + 1 ) % 3 );
+					vertex.fromBufferAttribute( position, index2 );
+					vertices.push( vertex.x, vertex.y, vertex.z );
 
 				}
 

+ 3 - 0
src/objects/InstancedMesh.js

@@ -33,6 +33,9 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 		Mesh.prototype.copy.call( this, source );
 
 		this.instanceMatrix.copy( source.instanceMatrix );
+
+		if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();
+
 		this.count = source.count;
 
 		return this;

+ 1 - 4
test/unit/src/geometries/EdgesGeometry.tests.js

@@ -1,7 +1,6 @@
 /* global QUnit */
 
 import { EdgesGeometry } from '../../../../src/geometries/EdgesGeometry';
-import { Geometry } from '../../../../src/core/Geometry';
 import { BufferGeometry } from '../../../../src/core/BufferGeometry';
 import { BufferAttribute } from '../../../../src/core/BufferAttribute';
 import { Vector3 } from '../../../../src/math/Vector3';
@@ -41,10 +40,8 @@ function testEdges( vertList, idxList, numAfter, assert ) {
 function createGeometries( vertList, idxList ) {
 
 	var geomIB = createIndexedBufferGeometry( vertList, idxList );
-	var geom = new Geometry().fromBufferGeometry( geomIB );
-	var geomB = new BufferGeometry().fromGeometry( geom );
 	var geomDC = addDrawCalls( geomIB.clone() );
-	return [ geom, geomB, geomIB, geomDC ];
+	return [ geomIB, geomDC ];
 
 }
 

+ 1 - 1
utils/modularize.js

@@ -44,7 +44,7 @@ var files = [
 
 	{ path: 'geometries/BoxLineGeometry.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/ConvexGeometry.js', dependencies: [ { name: 'ConvexHull', path: 'math/ConvexHull.js' } ], ignoreList: [] },
-	{ path: 'geometries/DecalGeometry.js', dependencies: [], ignoreList: [] },
+	{ path: 'geometries/DecalGeometry.js', dependencies: [], ignoreList: [ 'Geometry' ] },
 	{ path: 'geometries/LightningStrike.js', dependencies: [ { name: 'SimplexNoise', path: 'math/SimplexNoise.js' } ], ignoreList: [ 'Mesh' ] },
 	{ path: 'geometries/ParametricGeometries.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/TeapotBufferGeometry.js', dependencies: [], ignoreList: [] },

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov