|
@@ -19,47 +19,19 @@ InstancedBufferGeometry.prototype = Object.assign( Object.create( BufferGeometry
|
|
|
|
|
|
isInstancedBufferGeometry: true,
|
|
|
|
|
|
- addGroup: function ( start, count, materialIndex ) {
|
|
|
-
|
|
|
- this.groups.push( {
|
|
|
-
|
|
|
- start: start,
|
|
|
- count: count,
|
|
|
- materialIndex: materialIndex
|
|
|
-
|
|
|
- } );
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
copy: function ( source ) {
|
|
|
|
|
|
- var index = source.index;
|
|
|
-
|
|
|
- if ( index !== null ) {
|
|
|
-
|
|
|
- this.setIndex( index.clone() );
|
|
|
+ BufferGeometry.prototype.copy.call( this, source );
|
|
|
|
|
|
- }
|
|
|
+ this.maxInstancedCount = source.maxInstancedCount;
|
|
|
|
|
|
- var attributes = source.attributes;
|
|
|
-
|
|
|
- for ( var name in attributes ) {
|
|
|
-
|
|
|
- var attribute = attributes[ name ];
|
|
|
- this.addAttribute( name, attribute.clone() );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- var groups = source.groups;
|
|
|
-
|
|
|
- for ( var i = 0, l = groups.length; i < l; i ++ ) {
|
|
|
+ return this;
|
|
|
|
|
|
- var group = groups[ i ];
|
|
|
- this.addGroup( group.start, group.count, group.materialIndex );
|
|
|
+ },
|
|
|
|
|
|
- }
|
|
|
+ clone: function () {
|
|
|
|
|
|
- return this;
|
|
|
+ return new this.constructor().copy( this );
|
|
|
|
|
|
}
|
|
|
|