Exemplo n.º 1
0
    /// <summary>
    /// 0 means no curvature. 1 means max curvature defined by <see cref="maxCurvature"/>
    /// </summary>
    /// <param name="d"></param>
    /// <returns></returns>
    public float GetCurvatureAtDistance(float d)
    {
        float t = AbsoluteDistanceToT(d);

        return(Mathf.Clamp(CubicBezierUtility.EvaluateCurvature(GetPoints(), t), 0f, maxCurvature) / maxCurvature);
    }
Exemplo n.º 2
0
 /// <summary>
 /// 0 means no curvature. 1 means max curvature defined by <see cref="maxCurvature"/>
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public float GetCurvature(float t)
 {
     return(Mathf.Clamp(CubicBezierUtility.EvaluateCurvature(GetPoints(), t), 0f, maxCurvature) / maxCurvature);
 }