public static float GetDistanceFromLoftPath(this IAIPath path, float loftpathDistance) { var nS = path.GetStartPathOffset(); var nE = path.GetEndPathOffset(); //n = (nE - nS) * t + nS; //(nE - nS) * t = n - nS var t = (loftpathDistance - nS) / (nE - nS); return(t * path.GetLength()); }
public static float GetOffsetPercentual(this IAIPath path, float n) { return(Mathf.Lerp(path.GetStartPathOffset(), path.GetEndPathOffset(), n)); }