浏览代码

BufferGeometry: Added .setAttribute()

Mr.doob 5 年之前
父节点
当前提交
eab99103af
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      src/core/BufferGeometry.js

+ 9 - 3
src/core/BufferGeometry.js

@@ -94,9 +94,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 		}
 
-		this.attributes[ name ] = attribute;
-
-		return this;
+		return this.setAttribute( name, attribute );
 
 	},
 
@@ -106,6 +104,14 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 	},
 
+	setAttribute: function ( name, attribute ) {
+
+		this.attributes[ name ] = attribute;
+
+		return this;
+
+	},
+
 	removeAttribute: function ( name ) {
 
 		delete this.attributes[ name ];