예제 #1
0
        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());
        }
예제 #2
0
 public static float GetOffsetPercentual(this IAIPath path, float n)
 {
     return(Mathf.Lerp(path.GetStartPathOffset(), path.GetEndPathOffset(), n));
 }