Beispiel #1
0
    public static hexNumFloat RandomLerp(hexNumFloat start, hexNumFloat end, float range)
    {
        float division = UnityEngine.Random.Range(0.5f - range / 2, 0.5f + range / 2);
        //Debug.Log("division: "+division);
        hexNumFloat tmp = Lerp(start, end, division);

        return(tmp);
    }
Beispiel #2
0
    public static hexNumFloat Lerp(hexNumFloat start, hexNumFloat end, float ratio)
    {
        Debug.Assert(ratio >= 0 && ratio <= 1, "ratio out of [0, 1] in Lerp");
        hexNumFloat tmp;

        tmp.num_x_float = ratio * start.num_x_float + (1 - ratio) * end.num_x_float;
        tmp.num_z_float = ratio * start.num_z_float + (1 - ratio) * end.num_z_float;
        return(tmp);
    }
Beispiel #3
0
 public static hexNumFloat HalfLerp(hexNumFloat start, hexNumFloat end)
 {
     return(Lerp(start, end, 0.5f));
 }