|
@@ -13,54 +13,56 @@ function InstancedBufferGeometry() {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-InstancedBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
|
|
|
|
-InstancedBufferGeometry.prototype.constructor = InstancedBufferGeometry;
|
|
|
|
|
|
+InstancedBufferGeometry.prototype = Object.assign( Object.create( BufferGeometry.prototype ), {
|
|
|
|
|
|
-InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
|
|
|
|
|
|
+ constructor: InstancedBufferGeometry,
|
|
|
|
|
|
-InstancedBufferGeometry.prototype.addGroup = function ( start, count, materialIndex ) {
|
|
|
|
|
|
+ isInstancedBufferGeometry: true,
|
|
|
|
|
|
- this.groups.push( {
|
|
|
|
|
|
+ addGroup: function ( start, count, materialIndex ) {
|
|
|
|
|
|
- start: start,
|
|
|
|
- count: count,
|
|
|
|
- materialIndex: materialIndex
|
|
|
|
|
|
+ this.groups.push( {
|
|
|
|
|
|
- } );
|
|
|
|
|
|
+ start: start,
|
|
|
|
+ count: count,
|
|
|
|
+ materialIndex: materialIndex
|
|
|
|
|
|
-};
|
|
|
|
|
|
+ } );
|
|
|
|
|
|
-InstancedBufferGeometry.prototype.copy = function ( source ) {
|
|
|
|
|
|
+ },
|
|
|
|
|
|
- var index = source.index;
|
|
|
|
|
|
+ copy: function ( source ) {
|
|
|
|
|
|
- if ( index !== null ) {
|
|
|
|
|
|
+ var index = source.index;
|
|
|
|
|
|
- this.setIndex( index.clone() );
|
|
|
|
|
|
+ if ( index !== null ) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ this.setIndex( index.clone() );
|
|
|
|
|
|
- var attributes = source.attributes;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- for ( var name in attributes ) {
|
|
|
|
|
|
+ var attributes = source.attributes;
|
|
|
|
|
|
- var attribute = attributes[ name ];
|
|
|
|
- this.addAttribute( name, attribute.clone() );
|
|
|
|
|
|
+ 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 ++ ) {
|
|
|
|
|
|
+ var groups = source.groups;
|
|
|
|
|
|
- var group = groups[ i ];
|
|
|
|
- this.addGroup( group.start, group.count, group.materialIndex );
|
|
|
|
|
|
+ for ( var i = 0, l = groups.length; i < l; i ++ ) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ var group = groups[ i ];
|
|
|
|
+ this.addGroup( group.start, group.count, group.materialIndex );
|
|
|
|
|
|
- return this;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
-};
|
|
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+} );
|
|
|
|
|
|
export { InstancedBufferGeometry };
|
|
export { InstancedBufferGeometry };
|