Exemplo n.º 1
0
        Line(CubicHexCoord start, CubicHexCoord end)
        {
            int distance = CubicHexCoord.Distance(start, end);

            CubicHexCoord[] result = new CubicHexCoord[distance + 1];

            for (int i = 0; i <= distance; i++)
            {
                float xLerp = start.x + (end.x - start.x) * 1f / distance * i;
                float yLerp = start.y + (end.y - start.y) * 1f / distance * i;
                float zLerp = start.z + (end.z - start.z) * 1f / distance * i;

                result[i] = new FloatCubic(xLerp, yLerp, zLerp).Round();
            }

            return(result);
        }
Exemplo n.º 2
0
 DistanceTo(CubicHexCoord other)
 {
     return(CubicHexCoord.Distance(this, other));
 }