It's also worth pointing out that ther is a 'PagingExampe' available in PolyVox. It doesn't actually let you fly around but it does demonstrate the basic usage of the LargeVolume.
GM_Riscvul wrote:
If that is the case, how does polyvox know it is approaching the boundary of its loaded area?
It doesn't. PolyVox doesn't know where your camera is or what it can see. However,
you know where you camera is, so you can decide what regions you need to extract a surface for. If you try to extract a region and there is no data for that region then PolyVox will try to load the data via the dataRequiredHandler() which you have provided.
In other words, you can create a volume without any data and start extracting. PolyVox will the request data from you as it needs it.
Alternatively, you can use the setVoxelAt() function to put data into part of the volume before you perform the extraction. If you do this, PolyVox will see the data is already present in memory and won't call the callback to request it. As you insert data you may cause some other data to be pushed out of memory, in which case PolyVox will call the dataOverflowHandler() to give you a chance to save that data.
You can think of it as a pyramid. At the top we have a small amount data which is stored uncompressed and can be accessed very quickly. In the middle we have a larger amount of data, stored in a compressed form. And at the bottom we have a huge amount of data in some user defined form (files, database, network, etc). When PolyVox uses data (for surface extraction, etc) it gets pulled to the top of the pyramid. If it is untouched for periods of time it gets pushed back down, first to a compressed form and then to the user defined form.
Data is moved between the top level and the middle level via compress() and uncompress() functions, and it is moved between the middle level and bottom level via the dataRequiredHandler() and dataOverflowHandler().