ker wrote:
not sure if i got it right.
you want to set a type (e.g. "grass", "earth") and then, depending on the type set some other value? ("grass" -> "green", "brown", "earth" -> "good soil", "stony")
or do you simply want to set a voxel to an enum?
if it is the latter, that is already possible. just create your enum
Code:
enum MyMaterial
{
mmAir,
mmEarth,
mmGrass,
mmWater
};
and use PolyVox::Material8.
Code:
volume.SetVoxelAt(x, y, z, PolyVox::Material8(mmEarth));
if it is the first one, you will need your own Material implementation (which is not all that difficult to implement)
Thanks Ker, that's what I needed, actually I kinda need this for the two reasons you stated above, my terrain is textured using an auto texture system, it takes the y normal of the voxel surfaces and then depending on the angle value from 0 to 1 it assign a texture, the problem with this implementation is that if I try to add trees for example they will get the same auto texturing. Now if I assign a type to some voxels I can exclude it from my auto texturing process and apply the desired texture and proprieties that I want
EDIT:
Code:
volume.SetVoxelAt(x, y, z, PolyVox::Material8(mmEarth));
SetVoxelAt, isn't the last parameter controlling the density of the voxel?