Browse Source

BufferGeometry: Renamed .addIndex() to setIndex().

Mr.doob 10 years ago
parent
commit
4a606a66fe
1 changed files with 16 additions and 3 deletions
  1. 16 3
      src/core/BufferGeometry.js

+ 16 - 3
src/core/BufferGeometry.js

@@ -30,9 +30,22 @@ THREE.BufferGeometry.prototype = {
 
 	constructor: THREE.BufferGeometry,
 
-	addIndex: function ( attribute ) {
+	addIndex: function ( index ) {
 
-		this.index = attribute;
+		console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
+		this.setIndex( index );
+
+	},
+
+	getIndex: function () {
+
+		return this.index;
+
+	},
+
+	setIndex: function ( index ) {
+
+		this.index = index;
 
 	},
 
@@ -50,7 +63,7 @@ THREE.BufferGeometry.prototype = {
 
 		if ( name === 'index' ) {
 
-			console.warn( 'THREE.BufferGeometry.addAttribute: Use .addIndex() for index attribute.' );
+			console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
 			this.addIndex( attribute );
 
 		}