Added comment.

This commit is contained in:
Daviw Williams 2014-02-26 17:00:40 +01:00
parent c5780dd8e2
commit 1cf5f4c899

View File

@ -103,6 +103,14 @@ namespace PolyVox
return 1;
}
/**
* Returns a material which is in some sense a weighted combination of the supplied materials.
*
* The Marching Cubes algotithm generates vertices which lie between voxels, and ideally the material of the vertex should be interpolated from the materials
* of the voxels. In practice, that material type is often an integer identifier (e.g. 1 = rock, 2 = soil, 3 = grass) and an interpolation doean't make sense
* (e.g. soil is not a combination or rock and grass). Therefore this default interpolation just return one material or the other, but if more advanced voxel
* types do support interpolation then it can be implemented in this function.
*/
MaterialType blendMaterials(MaterialType a, MaterialType b, float weight)
{
if(weight < 0.5f)