Package com.jme3.math

Class CurveAndSurfaceMath

java.lang.Object
com.jme3.math.CurveAndSurfaceMath

public class CurveAndSurfaceMath extends Object
This class offers methods to help with curves and surfaces calculations.
  • Method Details

    • interpolateNurbs

      public static void interpolateNurbs(float u, Spline nurbSpline, Vector3f store)
      This method interpolates the data for the nurbs curve.
      Parameters:
      u - the u value
      nurbSpline - the nurbs spline definition
      store - the resulting point in 3D space
    • interpolate

      public static void interpolate(float u, float v, List<List<Vector4f>> controlPoints, List<Float>[] knots, int basisUFunctionDegree, int basisVFunctionDegree, Vector3f store)
      This method interpolates the data for the nurbs surface.
      Parameters:
      u - the u value
      v - the v value
      controlPoints - the nurbs' control points
      knots - the nurbs' knots
      basisUFunctionDegree - the degree of basis U function
      basisVFunctionDegree - the degree of basis V function
      store - the resulting point in 3D space
    • prepareNurbsKnots

      public static void prepareNurbsKnots(List<Float> knots, int basisFunctionDegree)
      This method prepares the knots to be used. If the knots represent non-uniform B-splines (first and last knot values are being repeated) it leads to NaN results during calculations. This method adds a small number to each of such knots to avoid NaN's.
      Parameters:
      knots - the knots to be prepared to use
      basisFunctionDegree - the degree of basis function