Pārlūkot izejas kodu

Merge pull request #6742 from echevil/dev

Fixed dashed lines. Issue #6699
Ricardo Cabello 10 gadi atpakaļ
vecāks
revīzija
6b6eb8f07a
1 mainītis faili ar 23 papildinājumiem un 0 dzēšanām
  1. 23 0
      src/core/BufferGeometry.js

+ 23 - 0
src/core/BufferGeometry.js

@@ -156,6 +156,14 @@ THREE.BufferGeometry.prototype = {
 			this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) );
 			this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) );
 			this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) );
 			this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) );
 
 
+			if ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) {
+
+				var lineDistances = new THREE.Float32Attribute( geometry.lineDistances.length, 1 );
+
+				this.addAttribute( 'lineDistance',  lineDistances.copyArray( geometry.lineDistances ) );
+
+			}
+
 			if ( geometry.boundingSphere !== null ) {
 			if ( geometry.boundingSphere !== null ) {
 
 
 				this.boundingSphere = geometry.boundingSphere.clone();
 				this.boundingSphere = geometry.boundingSphere.clone();
@@ -266,6 +274,21 @@ THREE.BufferGeometry.prototype = {
 
 
 		}
 		}
 
 
+		if ( geometry.lineDistancesNeedUpdate ) {
+
+			var attribute = this.attributes.lineDistance;
+
+			if ( attribute !== undefined ) {
+
+				attribute.copyArray( geometry.lineDistances );
+				attribute.needsUpdate = true;
+
+			}
+
+			geometry.lineDistancesNeedUpdate = false;
+
+		}
+
 		return this;
 		return this;
 
 
 	},
 	},