void GetBlockColor(EVoxelBlockType blocktype, int x, int y, int z, out Color32 color) { color = _tables.blockColors[(int)blocktype - 1]; if ((x & 1) != 0) { Color cc = color; cc *= 0.9f; cc.a = 1f; color = cc; } if ((z & 1) != 0) { Color cc = color; cc *= 0.9f; cc.a = 1f; color = cc; } if ((y & 1) != 0) { Color cc = color; cc *= 0.9f; cc.a = 1f; color = cc; } }
void GetBlockColorAndSmoothing(EVoxelBlockType blocktype, out Color32 color, out uint smg, out float smoothing, out int layer) { color = _tables.blockColors[(int)blocktype - 1]; smg = _tables.blockSmoothingGroups[(int)blocktype - 1]; smoothing = _tables.blockSmoothingFactors[(int)blocktype - 1]; layer = GetBlockLayer(blocktype); }
public static bool IsCapBlock(EVoxelBlockType type) { if (type == EVoxelBlockType.Snow) { return(true); } return(false); }
public static bool IsDiggable(EVoxelBlockType type) { if (type == EVoxelBlockType.Water) { return(false); } return(true); }
public static int GetBlockLayer(EVoxelBlockType blocktype) { if (blocktype == EVoxelBlockType.Water) { return(EChunkLayers.Water.ToIndex()); } else if ((blocktype == EVoxelBlockType.Leaves) || (blocktype == EVoxelBlockType.Needles) || (blocktype == EVoxelBlockType.Wood)) { return(EChunkLayers.Trees.ToIndex()); } return(EChunkLayers.Terrain.ToIndex()); }
public static bool IsSolidBlock(EVoxelBlockType type) { if (type == EVoxelBlockType.Water || type == EVoxelBlockType.Air || type == EVoxelBlockType.Snow || type == EVoxelBlockType.Flowers1 || type == EVoxelBlockType.Flowers2 || type == EVoxelBlockType.Flowers3 || type == EVoxelBlockType.Flowers4) { return(false); } return(true); }
public static bool IsTransparentBlock(EVoxelBlockType type) { if (type == EVoxelBlockType.Air || type == EVoxelBlockType.Water || type == EVoxelBlockType.Needles || type == EVoxelBlockType.Flowers1 || type == EVoxelBlockType.Flowers2 || type == EVoxelBlockType.Flowers3 || type == EVoxelBlockType.Flowers4 || type == EVoxelBlockType.Leaves || type == EVoxelBlockType.Snow) { return(true); } return(false); }
public void GetElevationAndTopBlock(int x, int z, out int elevation, out EVoxelBlockType blockType) { elevation = 0; blockType = EVoxelBlockType.Grass; }
public WorldData.TerrainType GetTerrainData(EVoxelBlockType block) { return(data.terrainTypes[blockMapping[block]]); }
public static Voxel_t WithFlags(this EVoxelBlockType type, EVoxelBlockFlags flags = 0) { return(new Voxel_t(type, flags)); }
public Voxel_t(EVoxelBlockType type, EVoxelBlockFlags flags) { raw = (byte)((int)type | (int)flags); }
public Voxel_t(EVoxelBlockType type) { raw = (byte)type; }