ソースを参照

Fixed InterleavedBufferAttribute.

Mr.doob 8 年 前
コミット
58b1f74fb9
2 ファイル変更5 行追加9 行削除
  1. 0 4
      src/core/BufferAttribute.js
  2. 5 5
      src/renderers/webgl/WebGLAttributes.js

+ 0 - 4
src/core/BufferAttribute.js

@@ -8,8 +8,6 @@ import { _Math } from '../math/Math';
  * @author mrdoob / http://mrdoob.com/
  */
 
-var bufferAttributeId = 0;
-
 function BufferAttribute( array, itemSize, normalized ) {
 
 	if ( Array.isArray( array ) ) {
@@ -18,8 +16,6 @@ function BufferAttribute( array, itemSize, normalized ) {
 
 	}
 
-	Object.defineProperty( this, 'id', { value: bufferAttributeId ++ } );
-
 	this.uuid = _Math.generateUUID();
 
 	this.array = array;

+ 5 - 5
src/renderers/webgl/WebGLAttributes.js

@@ -101,19 +101,19 @@ function WebGLAttributes( gl ) {
 
 		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
 
-		return buffers[ attribute.id ];
+		return buffers[ attribute.uuid ];
 
 	}
 
 	function remove( attribute ) {
 
-		var data = buffers[ attribute.id ];
+		var data = buffers[ attribute.uuid ];
 
 		if ( data ) {
 
 			gl.deleteBuffer( data.buffer );
 
-			delete buffers[ attribute.id ];
+			delete buffers[ attribute.uuid ];
 
 		}
 
@@ -123,11 +123,11 @@ function WebGLAttributes( gl ) {
 
 		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
 
-		var data = buffers[ attribute.id ];
+		var data = buffers[ attribute.uuid ];
 
 		if ( data === undefined ) {
 
-			buffers[ attribute.id ] = createBuffer( attribute, bufferType );
+			buffers[ attribute.uuid ] = createBuffer( attribute, bufferType );
 
 		} else if ( data.version < attribute.version ) {