Modifier and Type | Field and Description |
---|---|
boolean |
continuous |
T[] |
controlPoints |
int |
degree |
Array<T> |
knots |
int |
spanCount |
Constructor and Description |
---|
BSpline() |
BSpline(T[] controlPoints,
int degree,
boolean continuous) |
Modifier and Type | Method and Description |
---|---|
float |
approximate(T v) |
float |
approximate(T in,
int near) |
float |
approximate(T in,
int start,
int count) |
static <T extends Vector<T>> |
calculate(T out,
float t,
T[] points,
int degree,
boolean continuous,
T tmp)
Calculates the n-degree b-spline value for the given position (t).
|
static <T extends Vector<T>> |
calculate(T out,
int i,
float u,
T[] points,
int degree,
boolean continuous,
T tmp)
Calculates the n-degree b-spline value for the given span (i) at the given position (u).
|
static <T extends Vector<T>> |
cubic(T out,
float t,
T[] points,
boolean continuous,
T tmp)
Calculates the cubic b-spline value for the given position (t).
|
static <T extends Vector<T>> |
cubic(T out,
int i,
float u,
T[] points,
boolean continuous,
T tmp)
Calculates the cubic b-spline value for the given span (i) at the given position (u).
|
float |
locate(T v) |
int |
nearest(T in) |
int |
nearest(T in,
int start,
int count) |
BSpline |
set(T[] controlPoints,
int degree,
boolean continuous) |
T |
valueAt(T out,
float t) |
T |
valueAt(T out,
int span,
float u) |
public int degree
public boolean continuous
public int spanCount
public BSpline()
public BSpline(T[] controlPoints, int degree, boolean continuous)
public static <T extends Vector<T>> T cubic(T out, float t, T[] points, boolean continuous, T tmp)
out
- The Vector to set to the result.t
- The position (0<=t<=1) on the splinepoints
- The control pointscontinuous
- If true the b-spline restarts at 0 when reaching 1tmp
- A temporary vector used for the calculationpublic static <T extends Vector<T>> T cubic(T out, int i, float u, T[] points, boolean continuous, T tmp)
out
- The Vector to set to the result.i
- The span (0<=iu
- The position (0<=u<=1) on the spanpoints
- The control pointscontinuous
- If true the b-spline restarts at 0 when reaching 1tmp
- A temporary vector used for the calculationpublic static <T extends Vector<T>> T calculate(T out, float t, T[] points, int degree, boolean continuous, T tmp)
out
- The Vector to set to the result.t
- The position (0<=t<=1) on the splinepoints
- The control pointsdegree
- The degree of the b-splinecontinuous
- If true the b-spline restarts at 0 when reaching 1tmp
- A temporary vector used for the calculationpublic static <T extends Vector<T>> T calculate(T out, int i, float u, T[] points, int degree, boolean continuous, T tmp)
out
- The Vector to set to the result.i
- The span (0<=iu
- The position (0<=u<=1) on the spanpoints
- The control pointsdegree
- The degree of the b-splinecontinuous
- If true the b-spline restarts at 0 when reaching 1tmp
- A temporary vector used for the calculationpublic T valueAt(T out, int span, float u)
public int nearest(T in)
public int nearest(T in, int start, int count)
public float approximate(T v)
approximate
in interface Path<T extends Vector<T>>
Path.locate(Object)
for a more precise (but more intensive) method.public float approximate(T in, int start, int count)
public float approximate(T in, int near)
public float locate(T v)