예제 #1
0
    void Triangulate(HexCell cell, Direction dir)
    {
        Vector3 center = cell.Position;
        //center.y = HexMetrics.GetElevationHeight(cell.Elevation);
        Vector3 v1 = center + HexMetrics.SolidCorner(dir);
        Vector3 v2 = center + HexMetrics.GetNextSolidCorner(dir);
        Vector3 e1 = Vector3.Lerp(v1, v2, 0.333f);
        Vector3 e2 = Vector3.Lerp(v1, v2, 0.666f);

        AddTriangle(center, v1, e1);
        AddTriangle(center, e1, e2);
        AddTriangle(center, e2, v2);

        if (dir <= Direction.SE)
        {
            GenBridge(cell, dir, v1, v2, e1, e2);
        }
    }