Procházet zdrojové kódy

Fixed more UV sharing geometry generators and loaders. See #3762.

Mr.doob před 12 roky
rodič
revize
c57ac02251

+ 1 - 1
examples/js/loaders/ColladaLoader.js

@@ -2635,7 +2635,7 @@ THREE.ColladaLoader = function () {
 
 								} else {
 
-									uvArr = [ uv[1], uv[2], uv[3] ];
+									uvArr = [ uv[1].clone(), uv[2], uv[3].clone() ];
 
 								}
 

+ 1 - 1
src/extras/geometries/ParametricGeometry.js

@@ -56,7 +56,7 @@ THREE.ParametricGeometry = function ( func, slices, stacks ) {
 			uvs.push( [ uva, uvb, uvd ] );
 
 			faces.push( new THREE.Face3( b, c, d ) );
-			uvs.push( [ uvb, uvc, uvd ] );
+			uvs.push( [ uvb.clone(), uvc, uvd.clone() ] );
 
 		}
 

+ 1 - 1
src/extras/geometries/PlaneGeometry.js

@@ -67,7 +67,7 @@ THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments )
 			face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );
 
 			this.faces.push( face );
-			this.faceVertexUvs[ 0 ].push( [ uvb, uvc, uvd ] );
+			this.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] );
 
 		}
 

+ 1 - 1
src/extras/geometries/SphereGeometry.js

@@ -81,7 +81,7 @@ THREE.SphereGeometry = function ( radius, widthSegments, heightSegments, phiStar
 				this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv4 ] );
 
 				this.faces.push( new THREE.Face3( v2, v3, v4, [ n2, n3, n4 ] ) );
-				this.faceVertexUvs[ 0 ].push( [ uv2, uv3, uv4 ] );
+				this.faceVertexUvs[ 0 ].push( [ uv2.clone(), uv3, uv4.clone() ] );
 
 			}
 

+ 1 - 1
src/extras/geometries/TorusKnotGeometry.js

@@ -74,7 +74,7 @@ THREE.TorusKnotGeometry = function ( radius, tube, radialSegments, tubularSegmen
 			this.faceVertexUvs[ 0 ].push( [ uva, uvb, uvd ] );
 
 			this.faces.push( new THREE.Face3( b, c, d ) );
-			this.faceVertexUvs[ 0 ].push( [ uvb, uvc, uvd ] );
+			this.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] );
 
 		}
 	}

+ 1 - 1
src/extras/geometries/TubeGeometry.js

@@ -114,7 +114,7 @@ THREE.TubeGeometry = function( path, segments, radius, radialSegments, closed )
 			this.faceVertexUvs[ 0 ].push( [ uva, uvb, uvd ] );
 
 			this.faces.push( new THREE.Face3( b, c, d ) );
-			this.faceVertexUvs[ 0 ].push( [ uvb, uvc, uvd ] );
+			this.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] );
 
 		}
 	}