Explorar el Código

Updated builds.

Mr.doob hace 2 años
padre
commit
b8520eb165
Se han modificado 4 ficheros con 56 adiciones y 56 borrados
  1. 18 18
      build/three.cjs
  2. 18 18
      build/three.js
  3. 0 0
      build/three.min.js
  4. 20 20
      build/three.module.js

+ 18 - 18
build/three.cjs

@@ -7274,10 +7274,8 @@ class BufferAttribute {
 	}
 
 	set(value, offset = 0) {
-		const array = this.array;
-		const normalized = this.normalized;
-		if (normalized) value = value.map(v => normalize(v, array));
-		array.set(value, offset);
+		// Matching BufferAttribute constructor, do not normalize the array.
+		this.array.set(value, offset);
 		return this;
 	}
 
@@ -34422,27 +34420,29 @@ class GridHelper extends LineSegments {
 }
 
 class PolarGridHelper extends LineSegments {
-	constructor(radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888) {
+	constructor(radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888) {
 		color1 = new Color(color1);
 		color2 = new Color(color2);
 		const vertices = [];
-		const colors = []; // create the radials
+		const colors = []; // create the sectors
 
-		for (let i = 0; i <= radials; i++) {
-			const v = i / radials * (Math.PI * 2);
-			const x = Math.sin(v) * radius;
-			const z = Math.cos(v) * radius;
-			vertices.push(0, 0, 0);
-			vertices.push(x, 0, z);
-			const color = i & 1 ? color1 : color2;
-			colors.push(color.r, color.g, color.b);
-			colors.push(color.r, color.g, color.b);
-		} // create the circles
+		if (sectors > 1) {
+			for (let i = 0; i < sectors; i++) {
+				const v = i / sectors * (Math.PI * 2);
+				const x = Math.sin(v) * radius;
+				const z = Math.cos(v) * radius;
+				vertices.push(0, 0, 0);
+				vertices.push(x, 0, z);
+				const color = i & 1 ? color1 : color2;
+				colors.push(color.r, color.g, color.b);
+				colors.push(color.r, color.g, color.b);
+			}
+		} // create the rings
 
 
-		for (let i = 0; i <= circles; i++) {
+		for (let i = 0; i < rings; i++) {
 			const color = i & 1 ? color1 : color2;
-			const r = radius - radius / circles * i;
+			const r = radius - radius / rings * i;
 
 			for (let j = 0; j < divisions; j++) {
 				// first vertex

+ 18 - 18
build/three.js

@@ -7276,10 +7276,8 @@
 		}
 
 		set(value, offset = 0) {
-			const array = this.array;
-			const normalized = this.normalized;
-			if (normalized) value = value.map(v => normalize(v, array));
-			array.set(value, offset);
+			// Matching BufferAttribute constructor, do not normalize the array.
+			this.array.set(value, offset);
 			return this;
 		}
 
@@ -34424,27 +34422,29 @@
 	}
 
 	class PolarGridHelper extends LineSegments {
-		constructor(radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888) {
+		constructor(radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888) {
 			color1 = new Color(color1);
 			color2 = new Color(color2);
 			const vertices = [];
-			const colors = []; // create the radials
+			const colors = []; // create the sectors
 
-			for (let i = 0; i <= radials; i++) {
-				const v = i / radials * (Math.PI * 2);
-				const x = Math.sin(v) * radius;
-				const z = Math.cos(v) * radius;
-				vertices.push(0, 0, 0);
-				vertices.push(x, 0, z);
-				const color = i & 1 ? color1 : color2;
-				colors.push(color.r, color.g, color.b);
-				colors.push(color.r, color.g, color.b);
-			} // create the circles
+			if (sectors > 1) {
+				for (let i = 0; i < sectors; i++) {
+					const v = i / sectors * (Math.PI * 2);
+					const x = Math.sin(v) * radius;
+					const z = Math.cos(v) * radius;
+					vertices.push(0, 0, 0);
+					vertices.push(x, 0, z);
+					const color = i & 1 ? color1 : color2;
+					colors.push(color.r, color.g, color.b);
+					colors.push(color.r, color.g, color.b);
+				}
+			} // create the rings
 
 
-			for (let i = 0; i <= circles; i++) {
+			for (let i = 0; i < rings; i++) {
 				const color = i & 1 ? color1 : color2;
-				const r = radius - radius / circles * i;
+				const r = radius - radius / rings * i;
 
 				for (let j = 0; j < divisions; j++) {
 					// first vertex

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
build/three.min.js


+ 20 - 20
build/three.module.js

@@ -9495,12 +9495,8 @@ class BufferAttribute {
 
 	set( value, offset = 0 ) {
 
-		const array = this.array;
-		const normalized = this.normalized;
-
-		if ( normalized ) value = value.map( v => normalize( v, array ) );
-
-		array.set( value, offset );
+		// Matching BufferAttribute constructor, do not normalize the array.
+		this.array.set( value, offset );
 
 		return this;
 
@@ -48126,7 +48122,7 @@ class GridHelper extends LineSegments {
 
 class PolarGridHelper extends LineSegments {
 
-	constructor( radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {
+	constructor( radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {
 
 		color1 = new Color( color1 );
 		color2 = new Color( color2 );
@@ -48134,32 +48130,36 @@ class PolarGridHelper extends LineSegments {
 		const vertices = [];
 		const colors = [];
 
-		// create the radials
+		// create the sectors
 
-		for ( let i = 0; i <= radials; i ++ ) {
+		if ( sectors > 1 ) {
 
-			const v = ( i / radials ) * ( Math.PI * 2 );
+			for ( let i = 0; i < sectors; i ++ ) {
 
-			const x = Math.sin( v ) * radius;
-			const z = Math.cos( v ) * radius;
+				const v = ( i / sectors ) * ( Math.PI * 2 );
 
-			vertices.push( 0, 0, 0 );
-			vertices.push( x, 0, z );
+				const x = Math.sin( v ) * radius;
+				const z = Math.cos( v ) * radius;
 
-			const color = ( i & 1 ) ? color1 : color2;
+				vertices.push( 0, 0, 0 );
+				vertices.push( x, 0, z );
+
+				const color = ( i & 1 ) ? color1 : color2;
+
+				colors.push( color.r, color.g, color.b );
+				colors.push( color.r, color.g, color.b );
 
-			colors.push( color.r, color.g, color.b );
-			colors.push( color.r, color.g, color.b );
+			}
 
 		}
 
-		// create the circles
+		// create the rings
 
-		for ( let i = 0; i <= circles; i ++ ) {
+		for ( let i = 0; i < rings; i ++ ) {
 
 			const color = ( i & 1 ) ? color1 : color2;
 
-			const r = radius - ( radius / circles * i );
+			const r = radius - ( radius / rings * i );
 
 			for ( let j = 0; j < divisions; j ++ ) {
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio