瀏覽代碼

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 ) {