Ejemplo n.º 1
0
    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));
    }
Ejemplo n.º 2
0
    // 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]);
    }