소스 검색

Add missing clone and copy functions to InterleavedBufferAttribute

Garrett Johnson 7 년 전
부모
커밋
523c34039b
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  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;