public override void AddNegXFace(ref SurfaceTool surfaceTool, Vector3 origin, byte blockType) { Rect2 uvs = Game.GetBlockUV(blockType, BlockFace.Right); surfaceTool.AddUv(uvs.Get(0, 1)); surfaceTool.AddVertex(origin + this[-1, -1, -1]); surfaceTool.AddUv(uvs.Get(0, 0)); surfaceTool.AddVertex(origin + this[-1, +1, -1]); surfaceTool.AddUv(uvs.Get(1, 0)); surfaceTool.AddVertex(origin + this[-1, +1, +1]); surfaceTool.AddUv(uvs.Position + new Vector2(0, uvs.Size.y)); surfaceTool.AddVertex(origin + SIZE * new Vector3(-0.5f, -0.5f, -0.5f)); surfaceTool.AddUv(uvs.Position + new Vector2(uvs.Size.x, 0)); surfaceTool.AddVertex(origin + SIZE * new Vector3(-0.5f, +0.5f, +0.5f)); surfaceTool.AddUv(uvs.End); surfaceTool.AddVertex(origin + SIZE * new Vector3(-0.5f, -0.5f, +0.5f)); }
// TODO: spend some time to actually properly refactor that (the first step is 25% done) public override void AddPosXFace(ref SurfaceTool surfaceTool, Vector3 origin, byte blockType) { Rect2 uvs = Game.GetBlockUV(blockType, BlockFace.Left); surfaceTool.AddUv(uvs.Get(1, 1)); surfaceTool.AddVertex(origin + this[+1, -1, -1]); surfaceTool.AddUv(uvs.Get(0, 0)); surfaceTool.AddVertex(origin + this[+1, +1, +1]); surfaceTool.AddUv(uvs.Get(1, 0)); surfaceTool.AddVertex(origin + this[+1, +1, -1]); surfaceTool.AddUv(uvs.Get(1, 1)); surfaceTool.AddVertex(origin + this[+1, -1, -1]); surfaceTool.AddUv(uvs.Get(0, 1)); surfaceTool.AddVertex(origin + this[+1, -1, +1]); surfaceTool.AddUv(uvs.Get(0, 0)); surfaceTool.AddVertex(origin + this[+1, +1, +1]); }