瀏覽代碼

Merge pull request #6500 from benaadams/buffer-length-to-count

Rename BufferAttribute.length to BufferAttribute.count
Ricardo Cabello 10 年之前
父節點
當前提交
c914858db7
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 7 0
      src/core/BufferAttribute.js
  2. 7 0
      src/core/InterleavedBufferAttribute.js

+ 7 - 0
src/core/BufferAttribute.js

@@ -17,6 +17,13 @@ THREE.BufferAttribute.prototype = {
 
 	get length () {
 
+		THREE.warn( 'THREE.BufferAttribute.length has been removed. Use THREE.BufferAttribute.count instead.' );
+		return this.count;
+
+	},
+
+	get count() {
+
 		return this.array.length / this.itemSize;
 
 	},

+ 7 - 0
src/core/InterleavedBufferAttribute.js

@@ -17,6 +17,13 @@ THREE.InterleavedBufferAttribute.prototype = {
 
 	get length() {
 
+		THREE.warn( 'THREE.InterleavedBufferAttribute.length has been removed. Use THREE.InterleavedBufferAttribute.count instead.' );
+		return this.count;
+
+	},
+
+	get count() {
+
 		return this.data.array.length / this.data.stride;
 
 	},