public BlockDescriptor(BlockType blockType, BlockFaceTexture textureTop, BlockFaceTexture textureBottom, BlockFaceTexture textureSide) { BlockType = blockType; TextureTop = textureTop; TextureBottom = textureBottom; TextureFront = textureSide; TextureBack = textureSide; TextureLeft = textureSide; TextureRight = textureSide; }
private UvMapping GetUvMapping(BlockFaceTexture texture) { var offset = texture.Offset; var step = 1.0f / 16;//Enum.GetValues(typeof(BlockFaceTexture)).Length; var uStart = offset * step; var uEnd = (offset + 1) * step; return(new UvMapping { TopLeft = new Vector2(uEnd, 0.0f), TopRight = new Vector2(uStart, 0.0f), BottomLeft = new Vector2(uEnd, 1.0f), BottomRight = new Vector2(uStart, 1.0f), }); }