Ha, it actually took me a few minutes to work out what was going on here. The VoxelType need to be sortable because in the old version of the volume it is used as a key in a map. The map is used so that for a given voxel value it can find a block of voxels which are entirely that value. It's part of the old compression system which is now replaced in the RLE branch. But thatnks for pointing it out - in the RLE branch this operator isn't needed anymore and can be removed.
kattle87 wrote:
Also, another maybe related question: if I have to loop through all the blocks (and there's quite a lot of them), do I have to care about anything in particular for getting a decent speed?
'Block' has a specific meaning in PolyVox in that it is a collection of voxels. A volume is then a collection of blocks. I suspect you actually you want to iterate over voxels?
In the old system (which it appears you are using) voxels you will get the best cache efficiency by iterating over the voxels 'z' changes slowest and 'x' changes fastest. The same is true when iterating over blocks within a volume. That said, this might change in the future and it also relies on knowing about the internal representation which isn't exposed.
In the future I might add some code which can be used to iterate over voxels in the best order. In the mean time, you should also look at the VolumeSampler if you want read-only access.