Well, that was actually a nice idea Freakazo.
I have set the getUncompressedBlock function of LargeVolume as public. This allows you to get the raw data of a block as it's declared as public on Block. Then I added a new constructor to RawVolume that just copies the data over with a memcpy (no error checking atm).
I don't know if it's the best way of doing it nor if it actually works (I just tried in the test I prepared before), but the new performance for the same test is 19ms, so it seems like the right way to go, assuming it works.
I think the library would really benefit from having more "low-level" functions like this considering how fast they seem to be compared to the other more convenient functions.
I still can't try it in my game because I extract a region bigger than a block (1 voxel bigger in every direction), but maybe a getUncompressedRegion function can be added although that would be a little more complicated.
Thanks for pointing me in the right direction
EDIT: after a bit of testing, it seems to work for the first X row of voxels (x,0,0) but not for the others (the data is different), any idea why? The order used in Block and RawVolume seems the same to me.
The new constructor is just the normal one with the memcpy call after initialise (data is a VoxelType* pointer to the uncompressed block raw data):
Code:
memcpy(m_pData, data, this->getWidth() * this->getHeight()* this->getDepth() * sizeof(VoxelType));