Browse Source

BufferGeometry: Added .setAttribute()

Mr.doob 5 năm trước cách đây
mục cha
commit
eab99103af
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  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 ];