From 1cf5f4c89969a39472182e129d6d5fd9f909032a Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Wed, 26 Feb 2014 17:00:40 +0100 Subject: [PATCH] Added comment. --- .../include/PolyVoxCore/DefaultMarchingCubesController.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index 892b8004..55eef19e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -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)