Переглянути джерело

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