예제 #1
0
        static public List <CubeCoord> HexLinedraw(CubeCoord a, CubeCoord b)
        {
            int              N       = a.Distance(b);
            FractionalCoord  a_nudge = new FractionalCoord(a.q + 0.000001F, a.r + 0.000001F, a.s - 0.000002F);
            FractionalCoord  b_nudge = new FractionalCoord(b.q + 0.000001F, b.r + 0.000001F, b.s - 0.000002F);
            List <CubeCoord> results = new List <CubeCoord> {
            };
            float step = 1F / Math.Max(N, 1);

            for (int i = 0; i <= N; i++)
            {
                results.Add(a_nudge.HexLerp(b_nudge, step * i).ToCube());
            }
            return(results);
        }
예제 #2
0
 public FractionalCoord HexLerp(FractionalCoord b, float t)
 {
     return(new FractionalCoord(q * (1F - t) + b.q * t, r * (1F - t) + b.r * t, s * (1F - t) + b.s * t));
 }