Exemple #1
0
    public Quaternion EvaluateRotation(float tPath)
    {
        float currentDistPath = Mathf.Lerp(0, _length, tPath);

        CurveSegment curveSegment = FindCurveWithDist(currentDistPath);

        float startDistCurve   = curveSegment.BeginDist;
        float endDistCurve     = curveSegment.EndDist;
        float currentDistCurve = currentDistPath;
        float tCurve;

        endDistCurve     -= startDistCurve;
        currentDistCurve -= startDistCurve;

        tCurve = currentDistCurve / endDistCurve;

        Quaternion rotation = curveSegment.EvaluateRotation(tCurve);

        return(rotation);
    }