public static void TriangulateBarMegaQuad(MeshGenerator mesh, Vector3 workingZero, float height, float offset, int cornerIndexA, int cornerIndexB)
    {
        offset -= 0.1f;
        float scale = 0.25f;

        vertexA = (workingZero + (Metrics.CornerFromIndex[cornerIndexA] * scale)) + (Vector3.up * offset);
        vertexB = (workingZero + (Metrics.CornerFromIndex[cornerIndexB] * scale)) + (Vector3.up * offset);
        vertexC = new Vector3(vertexA.x, height, vertexA.z) + (Vector3.up * offset);
        vertexD = new Vector3(vertexB.x, height, vertexB.z) + (Vector3.up * offset);

        uvA = new Vector2(0.5f + (scale / 2f), height);
        uvB = new Vector2(0.5f - (scale / 2f), height);
        uvC = new Vector2(0.5f + (scale / 2f), 0.5f - (scale / 2f));
        uvD = new Vector2(0.5f - (scale / 2f), 0.5f - (scale / 2f));

        mesh.AddTriangle(vertexC, vertexB, vertexA);
        mesh.AddTriangle(vertexD, vertexB, vertexC);

        mesh.AddTriangleUV(uvC, uvB, uvA);
        mesh.AddTriangleUV(uvD, uvB, uvC);

        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[(int)MatI.Boards]);
        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[(int)MatI.Boards]);

        mesh.AddTriangleColor(Metrics.megaSurface.colors[(int)ColI.Black]);
        mesh.AddTriangleColor(Metrics.megaSurface.colors[(int)ColI.Black]);
    }
    public static void TriangulateHorizontalMegaQuad(MeshGenerator mesh, Vector3 workingZero, int materialIndex, int colorIndex, bool flat = false)
    {
        vertexA = workingZero + Metrics.CornerFromIndex[0];
        vertexB = workingZero + Metrics.CornerFromIndex[1];
        vertexC = workingZero + Metrics.CornerFromIndex[2];
        vertexD = workingZero + Metrics.CornerFromIndex[3];

        uvA = new Vector2(1, 1);
        uvB = new Vector2(1, 0);
        uvC = new Vector2(0, 0);
        uvD = new Vector2(0, 1);

        if (flat == true)
        {
            mesh.AddTriangleUnperturbed(Metrics.PerturbFlat(vertexA), Metrics.PerturbFlat(vertexB), Metrics.PerturbFlat(vertexC));
            mesh.AddTriangleUnperturbed(Metrics.PerturbFlat(vertexC), Metrics.PerturbFlat(vertexD), Metrics.PerturbFlat(vertexA));
        }
        else
        {
            mesh.AddTriangle(vertexA, vertexB, vertexC);
            mesh.AddTriangle(vertexC, vertexD, vertexA);
        }


        mesh.AddTriangleUV(uvA, uvB, uvC);
        mesh.AddTriangleUV(uvC, uvD, uvA);

        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);
        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);

        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
    }
    public static void TriangulateGrateMegaQuad(MeshGenerator mesh, Vector3 workingZero, int materialIndex, int colorIndex, int cornerIndexA, int cornerIndexB)
    {
        float horizontalScale = 0.5f;
        float verticalScale   = 0.5f;
        float height          = Metrics.trimHeight * verticalScale;
        float offset          = -height;

        #region TriangulateHorizontalMegaQuad

        vertexA = (workingZero + Metrics.CornerFromIndex[cornerIndexA]);
        vertexB = (workingZero + (Metrics.CornerFromIndex[cornerIndexA] * horizontalScale));
        vertexC = (workingZero + (Metrics.CornerFromIndex[cornerIndexB] * horizontalScale));
        vertexD = (workingZero + Metrics.CornerFromIndex[cornerIndexB]);

        uvA = new Vector2(1, 1);
        uvB = new Vector2(0.75f, 0.25f);
        uvC = new Vector2(0.25f, 0.25f);
        uvD = new Vector2(0, 1);

        mesh.AddTriangle(vertexA, vertexB, vertexC);
        mesh.AddTriangle(vertexC, vertexD, vertexA);

        mesh.AddTriangleUV(uvA, uvB, uvC);
        mesh.AddTriangleUV(uvC, uvD, uvA);

        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);
        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);

        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);

        #endregion

        #region TriangulateReverseVerticalMegaQuad

        vertexA = (workingZero + (Metrics.CornerFromIndex[cornerIndexA] * horizontalScale)) + (Vector3.up * offset);
        vertexB = (workingZero + (Metrics.CornerFromIndex[cornerIndexB] * horizontalScale)) + (Vector3.up * offset);
        vertexC = new Vector3(vertexA.x, height, vertexA.z) + (Vector3.up * offset);
        vertexD = new Vector3(vertexB.x, height, vertexB.z) + (Vector3.up * offset);

        uvA = new Vector2(1, height - offset);
        uvB = new Vector2(verticalScale, height - offset);
        uvC = new Vector2(1, verticalScale);
        uvD = new Vector2(verticalScale, verticalScale);

        mesh.AddTriangle(vertexC, vertexB, vertexD);
        mesh.AddTriangle(vertexA, vertexB, vertexC);

        mesh.AddTriangleUV(uvC, uvB, uvD);
        mesh.AddTriangleUV(uvA, uvB, uvC);

        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);
        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);

        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);

        #endregion
    }
    public static void TriangulateReverseVerticalMegaQuad(MeshGenerator mesh, Vector3 workingZero, float height, float offset, int materialIndex, int colorIndex, int cornerIndexA, int cornerIndexB)
    {
        vertexA = (workingZero + Metrics.CornerFromIndex[cornerIndexA]) + (Vector3.up * offset);
        vertexB = (workingZero + Metrics.CornerFromIndex[cornerIndexB]) + (Vector3.up * offset);
        vertexC = new Vector3(vertexA.x, height, vertexA.z) + (Vector3.up * offset);
        vertexD = new Vector3(vertexB.x, height, vertexB.z) + (Vector3.up * offset);

        uvA = new Vector2(1, height - offset);
        uvB = new Vector2(0, height - offset);
        uvC = new Vector2(1, 0);
        uvD = new Vector2(0, 0);

        mesh.AddTriangle(vertexC, vertexB, vertexD);
        mesh.AddTriangle(vertexA, vertexB, vertexC);

        mesh.AddTriangleUV(uvC, uvB, uvD);
        mesh.AddTriangleUV(uvA, uvB, uvC);

        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);
        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);

        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
    }
    public static void TriangulateReverseHorizontalMegaQuad(MeshGenerator mesh, Vector3 workingZero, int materialIndex, int colorIndex)
    {
        vertexA = workingZero + Metrics.CornerFromIndex[0];
        vertexB = workingZero + Metrics.CornerFromIndex[1];
        vertexC = workingZero + Metrics.CornerFromIndex[2];
        vertexD = workingZero + Metrics.CornerFromIndex[3];

        uvA = new Vector2(1, 1);
        uvB = new Vector2(1, 0);
        uvC = new Vector2(0, 0);
        uvD = new Vector2(0, 1);

        mesh.AddTriangle(vertexA, vertexD, vertexC);
        mesh.AddTriangle(vertexC, vertexB, vertexA);

        mesh.AddTriangleUV(uvA, uvD, uvC);
        mesh.AddTriangleUV(uvC, uvB, uvA);

        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);
        mesh.AddTriangleTextureProperties(Metrics.megaSurface.properties[materialIndex]);

        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
        mesh.AddTriangleColor(Metrics.megaSurface.colors[colorIndex]);
    }