Example #1
0
    // Trajectory smoothing when trajectorySmoothing value is true
    List <Vector3> PathSmoothing(List <Vector3> inp_way)
    {
        if (trajectorySmoothing)
        {
            //Interpolation with the Katmull-Rom spline
            CatmullRom spline = new CatmullRom(inp_way, spaceFragmentation);
            return(spline.GetSpline());

            //An alternative variant of interpolation using the Bézier spline
            //            BezierInterpolation Bezier_spline = new BezierInterpolation(inp_way,spaceFragmentation);
            //            Bezier_spline.calc_curves();
            //            return Bezier_spline.BuildSpline();
        }
        else
        {
            return(inp_way);
        }
    }