Explorar o código

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

Mr.doob %!s(int64=11) %!d(string=hai) anos
pai
achega
77b6890c80
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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 ) {