com.jme3.math
Class CurveAndSurfaceMath

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

public class CurveAndSurfaceMath
extends java.lang.Object

This class offers methods to help with curves and surfaces calculations.


Method Summary
static void interpolate(float u, float v, java.util.List<java.util.List<Vector4f>> controlPoints, java.util.List<java.lang.Float>[] knots, int basisUFunctionDegree, int basisVFunctionDegree, Vector3f store)
          This method interpolates tha data for the nurbs surface.
static void interpolateNurbs(float u, Spline nurbSpline, Vector3f store)
          This method interpolates tha data for the nurbs curve.
static void prepareNurbsKnots(java.util.List<java.lang.Float> knots, int basisFunctionDegree)
          This method prepares the knots to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

interpolateNurbs

public static void interpolateNurbs(float u,
                                    Spline nurbSpline,
                                    Vector3f store)
This method interpolates tha 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,
                               java.util.List<java.util.List<Vector4f>> controlPoints,
                               java.util.List<java.lang.Float>[] knots,
                               int basisUFunctionDegree,
                               int basisVFunctionDegree,
                               Vector3f store)
This method interpolates tha 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(java.util.List<java.lang.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