|
@@ -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 ++ ) {
|
|
|
|