提交 3ac4adef 编写于 作者: A aardgoose 提交者: Mr.doob

Buffer attribute size is fixed at creation. Remove unneeded recalculations (#9658)

* remove repeated calculation from renderer

* remove now redundant getter
上级 d2399c7b
......@@ -20,6 +20,7 @@ function BufferAttribute( array, itemSize, normalized ) {
this.array = array;
this.itemSize = itemSize;
this.count = array.length / itemSize;
this.normalized = normalized === true;
this.dynamic = false;
......@@ -35,12 +36,6 @@ BufferAttribute.prototype = {
isBufferAttribute: true,
get count() {
return this.array.length / this.itemSize;
},
set needsUpdate( value ) {
if ( value === true ) this.version ++;
......@@ -59,6 +54,7 @@ BufferAttribute.prototype = {
this.array = new source.array.constructor( source.array );
this.itemSize = source.itemSize;
this.count = source.count;
this.normalized = source.normalized;
this.dynamic = source.dynamic;
......
......@@ -10,6 +10,7 @@ function InterleavedBuffer( array, stride ) {
this.array = array;
this.stride = stride;
this.count = array.length / stride;
this.dynamic = false;
this.updateRange = { offset: 0, count: - 1 };
......@@ -30,12 +31,6 @@ InterleavedBuffer.prototype = {
},
get count () {
return this.array.length / this.stride;
},
set needsUpdate( value ) {
if ( value === true ) this.version ++;
......@@ -53,6 +48,7 @@ InterleavedBuffer.prototype = {
copy: function ( source ) {
this.array = new source.array.constructor( source.array );
this.count = source.count;
this.stride = source.stride;
this.dynamic = source.dynamic;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册