Enhancement of mergeBufferGeometries() of BufferGeometryUtils

Hi,

When trying to merge geometries (group flag set to true), one of which was already merged and has groups with different materialIndex…the result will be not as expected - geometry with array of materials lost its groups and all will set to one material index… may be it will be better to save internal groups and just reindexed it with respect of geometry sequence?

solution is the following if someone interested:

...
	mergeBufferGeometries: function ( geometries, useGroups ) {
...
		for ( var i = 0, ii = 0; i < geometries.length; ++ i ) {
...
				if(geometry.groups.length > 1)
				{
					let _count = 0;
					let _offset = offset;
					geometry.groups.forEach(grp => {
						mergedGeometry.addGroup( _offset + _count, grp.count, ii++ );
						_count += grp.count;
					});
				}
				else
					mergedGeometry.addGroup( offset, count, ii++ );
...