소스 검색

BufferGeometry: Returning attribute object in addAttribute() as suggested in #4459.

Mr.doob 11 년 전
부모
커밋
77b6890c80
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/core/BufferGeometry.js

+ 4 - 2
src/core/BufferGeometry.js

@@ -32,11 +32,13 @@ THREE.BufferGeometry.prototype = {
 
 		this.attributes[ name ] = {
 
-			itemSize: itemSize,
-			array: new type( numItems * itemSize )
+			array: new type( numItems * itemSize ),
+			itemSize: itemSize
 
 		};
 
+		return this.attributes[ name ];
+
 	},
 
 	applyMatrix: function ( matrix ) {