Skip to content

Commit c8e3b3b

Browse files
committed
Removed remaining addIndex(). Fixes mrdoob#7164.
1 parent 84d4ef4 commit c8e3b3b

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

src/core/BufferGeometry.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ THREE.BufferGeometry.prototype = {
6464
if ( name === 'index' ) {
6565

6666
console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
67-
this.addIndex( attribute );
67+
this.setIndex( attribute );
6868

6969
}
7070

@@ -505,7 +505,7 @@ THREE.BufferGeometry.prototype = {
505505

506506
var TypeArray = geometry.vertices.length > 65535 ? Uint32Array : Uint16Array;
507507
var indices = new TypeArray( geometry.indices.length * 3 );
508-
this.addIndex( new THREE.BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) );
508+
this.setIndex( new THREE.BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) );
509509

510510
}
511511

@@ -968,7 +968,7 @@ THREE.BufferGeometry.prototype = {
968968

969969
if ( index !== null ) {
970970

971-
this.addIndex( index.clone() );
971+
this.setIndex( index.clone() );
972972

973973
}
974974

src/core/InstancedBufferGeometry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ THREE.InstancedBufferGeometry.prototype.copy = function ( source ) {
3232

3333
if ( index !== null ) {
3434

35-
this.addIndex( index.clone() );
35+
this.setIndex( index.clone() );
3636

3737
}
3838

src/extras/geometries/CircleBufferGeometry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ THREE.CircleBufferGeometry = function ( radius, segments, thetaStart, thetaLengt
5656

5757
}
5858

59-
this.addIndex( new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) );
59+
this.setIndex( new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) );
6060
this.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
6161
this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
6262
this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );

src/extras/geometries/PlaneBufferGeometry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegme
8585

8686
}
8787

88-
this.addIndex( new THREE.BufferAttribute( indices, 1 ) );
88+
this.setIndex( new THREE.BufferAttribute( indices, 1 ) );
8989
this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
9090
this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
9191
this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );

src/extras/geometries/SphereBufferGeometry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p
8888

8989
}
9090

91-
this.addIndex( new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) );
91+
this.setIndex( new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) );
9292
this.addAttribute( 'position', positions );
9393
this.addAttribute( 'normal', normals );
9494
this.addAttribute( 'uv', uvs );

src/extras/helpers/BoxHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ THREE.BoxHelper = function ( object ) {
88
var positions = new Float32Array( 8 * 3 );
99

1010
var geometry = new THREE.BufferGeometry();
11-
geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
11+
geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
1212
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
1313

1414
THREE.LineSegments.call( this, geometry, new THREE.LineBasicMaterial( { color: 0xffff00 } ) );

src/loaders/BufferGeometryLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ THREE.BufferGeometryLoader.prototype = {
4141
if ( index !== undefined ) {
4242

4343
var typedArray = new self[ index.type ]( index.array );
44-
geometry.addIndex( new THREE.BufferAttribute( typedArray, 1 ) );
44+
geometry.setIndex( new THREE.BufferAttribute( typedArray, 1 ) );
4545

4646
}
4747

src/objects/Sprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ THREE.Sprite = ( function () {
1010
var uvs = new Float32Array( [ 0, 0, 1, 0, 1, 1, 0, 1 ] );
1111

1212
var geometry = new THREE.BufferGeometry();
13-
geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
13+
geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
1414
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
1515
geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
1616

0 commit comments

Comments
 (0)