Simplified interface to TerrainVolume

Issue #28 resolved
David Williams created an issue

The use of material weights is conceptually complex compared to other voxel engines which simply store a density value and material ID for each voxel. Of course, we can actually emulate this by simply making sure only one weight has a non-zero value, and setting this to the required density. A function to do this might make the API a little easier to understand.

Something like:

setDensityandMaterialID(int x, int y, int z, byte density, byte materialID) { MaterialSet materialSet(); materialSet.weights[materialID]= density; setVoxel(x, y, z, materialSet); }

What should the reading equivalents be? Maybe getDensity() and getMainMaterial()?

Comments (1)

  1. Log in to comment