소스 검색

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 ];