Class SplineUtil



  • public class SplineUtil
    extends Object
    • Constructor Detail

      • SplineUtil

        public SplineUtil()
    • Method Detail

      • spline

        public static CubicSpline spline(Point p1,
                                         Point p2,
                                         Vector2 d1,
                                         Vector2 d2,
                                         double f,
                                         boolean normalized)
        Create a cubic spline that connects p1 and p2
        Parameters:
        p1 - the start point of the spline
        p2 - the end point of the spline
        d1 - the tangent vector from the start point pointing in the direction that the curve should have at its start (towards the end point)
        d2 - the tangent vector from the end point pointing in the direction that the curve should have at its end (towards the start point)
        f - the fraction in [0..1] of the length of the straight line connecting start and end point that the control points should be positioned along the tangents
        normalized - whether the tangent vectors are already normalized
        Returns:
      • spline

        public static CubicSpline spline(double p1x,
                                         double p1y,
                                         double p2x,
                                         double p2y,
                                         Vector2 d1,
                                         Vector2 d2,
                                         double f,
                                         boolean normalized)
      • spline

        public static void spline(CubicSpline spline,
                                  double p1x,
                                  double p1y,
                                  double p2x,
                                  double p2y,
                                  Vector2 d1,
                                  Vector2 d2,
                                  double f,
                                  boolean normalized)