Browse Source

Add missing clone and copy functions to InterleavedBufferAttribute

Garrett Johnson 7 years ago
parent
commit
523c34039b
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/core/InterleavedBufferAttribute.js

+ 17 - 0
src/core/InterleavedBufferAttribute.js

@@ -41,6 +41,23 @@ Object.assign( InterleavedBufferAttribute.prototype, {
 
 	isInterleavedBufferAttribute: true,
 
+	copy: function ( source ) {
+
+		this.data = source.data;
+		this.itemSize = source.itemSize;
+		this.offset = source.offset;
+		this.normalized = source.normalized;
+
+		return this;
+
+	},
+
+	clone: function () {
+
+		return new this.constructor( this.data, this.itemSize, this.offset, this.normalized ).copy( this );
+
+	},
+
 	setX: function ( index, x ) {
 
 		this.data.array[ index * this.data.stride + this.offset ] = x;