Browse Source

BufferGeometry addAttribute() backwards compatible.

Mr.doob 11 years ago
parent
commit
c42abb2f61
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/core/BufferGeometry.js

+ 10 - 0
src/core/BufferGeometry.js

@@ -24,6 +24,16 @@ THREE.BufferGeometry.prototype = {
 
 	addAttribute: function ( name, attribute ) {
 
+		if ( attribute instanceof THREE.BufferAttribute === false ) {
+
+			console.warn( 'DEPRECATED: BufferGeometry\'s addAttribute() now expects ( name, attribute ).' );
+
+			this.attributes[ name ] = { array: arguments[ 1 ], itemSize: arguments[ 2 ] };
+
+			return;
+
+		}
+
 		this.attributes[ name ] = attribute;
 
 	},