|
@@ -20,79 +20,23 @@ function BufferAttribute( array, itemSize, normalized ) {
|
|
|
|
|
|
this.name = '';
|
|
this.name = '';
|
|
|
|
|
|
- this._array = array;
|
|
|
|
- this._itemSize = itemSize;
|
|
|
|
|
|
+ this.array = array;
|
|
|
|
+ this.itemSize = itemSize;
|
|
this.count = array !== undefined ? array.length / itemSize : 0;
|
|
this.count = array !== undefined ? array.length / itemSize : 0;
|
|
- this._normalized = normalized === true;
|
|
|
|
|
|
+ this.normalized = normalized === true;
|
|
|
|
|
|
this.usage = StaticDrawUsage;
|
|
this.usage = StaticDrawUsage;
|
|
this.updateRange = { offset: 0, count: - 1 };
|
|
this.updateRange = { offset: 0, count: - 1 };
|
|
|
|
|
|
this.version = 0;
|
|
this.version = 0;
|
|
- this.versionVAO = 0;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-Object.defineProperties( BufferAttribute.prototype, {
|
|
|
|
|
|
+Object.defineProperty( BufferAttribute.prototype, 'needsUpdate', {
|
|
|
|
|
|
- needsUpdate: {
|
|
|
|
|
|
+ set: function ( value ) {
|
|
|
|
|
|
- set: function ( value ) {
|
|
|
|
-
|
|
|
|
- if ( value === true ) this.version ++;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- array: {
|
|
|
|
-
|
|
|
|
- get: function () {
|
|
|
|
-
|
|
|
|
- return this._array;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- set: function ( value ) {
|
|
|
|
-
|
|
|
|
- this._array = value;
|
|
|
|
- this.versionVAO ++;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- itemSize: {
|
|
|
|
-
|
|
|
|
- get: function () {
|
|
|
|
-
|
|
|
|
- return this._itemSize;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- set: function ( value ) {
|
|
|
|
-
|
|
|
|
- this._itemSize = value;
|
|
|
|
- this.versionVAO ++;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- normalized: {
|
|
|
|
-
|
|
|
|
- get: function () {
|
|
|
|
-
|
|
|
|
- return this._normalized;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- set: function ( value ) {
|
|
|
|
-
|
|
|
|
- this._normalized = value;
|
|
|
|
- this.versionVAO ++;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ if ( value === true ) this.version ++;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|