提交 90d5c798 编写于 作者: D dubejf

Rename updateCounter to version. Add api doc.

上级 68a4b12e
......@@ -43,10 +43,14 @@
Flag to indicate that this attribute has changed and should be re-send to the GPU. Set this to true when you modify the value of the array.
</div>
<h3>[property:Integer version]</h3>
<div>
A version number, incremented every time the needsUpdate property is set to true.
</div>
<h2>Methods</h2>
<h3>[method:null copyAt] ( [page:Integer index1], attribute, [page:Integer index2] ) </h3>
<div>
Copies itemSize values in the array from the vertex at index2 to the vertex at index1.
......
......@@ -9,7 +9,7 @@ THREE.BufferAttribute = function ( array, itemSize ) {
this.array = array;
this.itemSize = itemSize;
this.updateCounter = 0;
this.version = 0;
};
......@@ -32,7 +32,7 @@ THREE.BufferAttribute.prototype = {
set needsUpdate( value ) {
if ( value === true ) this.updateCounter ++;
if ( value === true ) this.version ++;
},
......
......@@ -9,7 +9,7 @@ THREE.InterleavedBuffer = function ( array, stride, dynamic ) {
this.array = array;
this.stride = stride;
this.updateCounter = 0;
this.version = 0;
this.dynamic = dynamic || false;
this.updateRange = { offset: 0, count: -1 };
......@@ -34,7 +34,7 @@ THREE.InterleavedBuffer.prototype = {
set needsUpdate( value ) {
if ( value === true ) this.updateCounter ++;
if ( value === true ) this.version ++;
},
......
......@@ -185,7 +185,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
createBuffer( attributeProperties, data, bufferType );
} else if ( attributeProperties.updateCounter !== data.updateCounter ) {
} else if ( attributeProperties.version !== data.version ) {
updateBuffer( attributeProperties, data, bufferType );
......@@ -210,8 +210,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
gl.bufferData( bufferType, data.array, usage );
attributeProperties.updateCounter = data.updateCounter;
data.needsUpdate = false;
attributeProperties.version = data.version;
}
......@@ -236,8 +235,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
}
attributeProperties.updateCounter = data.updateCounter;
data.needsUpdate = false;
attributeProperties.version = data.version;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册