public static void GetFaceUVs(this BlockID B, BlockFace F, Texture Tx, List <Vector2> Opaque, List <Vector2> Trans) { float TexSize = 1f / 6f * Tx.W; float w = 1f / ((float)Tx.W / TexSize); float h = 1f / ((float)Tx.H / TexSize); float x = 0; float y = h * B.GetTexID(); Vector2[] R; List <Vector2> L = B.IsTransparent() ? Trans : Opaque; switch (F) { case BlockFace.Forward: R = new Vector2[] { new Vector2(x + w * 2, y + h), new Vector2(x + w * 3, y + h), new Vector2(x + w * 3, y), new Vector2(x + w * 2, y), }; break; case BlockFace.Backward: R = new Vector2[] { new Vector2(x + w * 5, y), new Vector2(x + w * 4, y), new Vector2(x + w * 4, y + h), new Vector2(x + w * 5, y + h), }; break; case BlockFace.Left: R = new Vector2[] { new Vector2(x + w * 6, y), new Vector2(x + w * 5, y), new Vector2(x + w * 5, y + h), new Vector2(x + w * 6, y + h), }; break; case BlockFace.Right: R = new Vector2[] { new Vector2(x + w * 3, y + h), new Vector2(x + w * 4, y + h), new Vector2(x + w * 4, y), new Vector2(x + w * 3, y), }; break; case BlockFace.Top: R = new Vector2[] { new Vector2(x, y), new Vector2(x, y + h), new Vector2(x + w, y + h), new Vector2(x + w, y), }; break; case BlockFace.Bottom: R = new Vector2[] { new Vector2(x + w, y), new Vector2(x + w, y + h), new Vector2(x + w * 2, y + h), new Vector2(x + w * 2, y), }; break; default: throw new Exception("Unknown block face"); } L.AddRange(R); }