Exemple #1
0
        public bool CanCreateFace(VoxelType neighbor)
        {
            if (neighbor == null)
            {
                return(true);
            }
            else
            {
                switch (FaceMode)
                {
                case VoxelFaceMode.Transparent:
                    return(neighbor.FaceMode != VoxelFaceMode.Opaque && neighbor != this);

                case VoxelFaceMode.Opaque:
                case VoxelFaceMode.TransparentInner:
                    return(neighbor.FaceMode != VoxelFaceMode.Opaque);

                default:
                    return(false);
                }
            }
        }
Exemple #2
0
 public VoxelData(VoxelType type, VoxelTypeIndex index)
     : this(new Voxel(type, 0), index)
 {
 }
Exemple #3
0
 public Voxel(VoxelType type, ushort data = 0)
 {
     Type = type;
     Data = data;
 }
Exemple #4
0
 public VoxelData(VoxelType type, ushort data, VoxelTypeIndex index)
     : this(new Voxel(type, data), index)
 {
 }
Exemple #5
0
 public Voxel(VoxelData data, VoxelTypeIndex index)
 {
     Type = index[data.TypeIndex];
     Data = data.Data;
 }