Explorar o código

BufferGeometry addAttribute() backwards compatible.

Mr.doob %!s(int64=12) %!d(string=hai) anos
pai
achega
c42abb2f61
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  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;
 
 	},

粤ICP备19079148号