Package com.jme3.math
Class CurveAndSurfaceMath
java.lang.Object
com.jme3.math.CurveAndSurfaceMath
This class offers methods to help with curves and surfaces calculations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static void
interpolateNurbs
(float u, Spline nurbSpline, Vector3f store) This method interpolates the data for the nurbs curve.static void
prepareNurbsKnots
(List<Float> knots, int basisFunctionDegree) This method prepares the knots to be used.
-
Method Details
-
interpolateNurbs
This method interpolates the data for the nurbs curve.- Parameters:
u
- the u valuenurbSpline
- the nurbs spline definitionstore
- 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 valuev
- the v valuecontrolPoints
- the nurbs' control pointsknots
- the nurbs' knotsbasisUFunctionDegree
- the degree of basis U functionbasisVFunctionDegree
- the degree of basis V functionstore
- the resulting point in 3D space
-
prepareNurbsKnots
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 usebasisFunctionDegree
- the degree of basis function
-