Modifier and Type | Field and Description |
---|---|
boolean |
continuous |
T[] |
controlPoints |
int |
spanCount |
Constructor and Description |
---|
CatmullRomSpline() |
CatmullRomSpline(T[] controlPoints,
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,
boolean continuous,
T tmp)
Calculates the catmullrom value for the given position (t).
|
static <T extends Vector<T>> |
calculate(T out,
int i,
float u,
T[] points,
boolean continuous,
T tmp)
Calculates the catmullrom 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) |
CatmullRomSpline |
set(T[] controlPoints,
boolean continuous) |
T |
valueAt(T out,
float t) |
T |
valueAt(T out,
int span,
float u) |
public CatmullRomSpline()
public CatmullRomSpline(T[] controlPoints, boolean continuous)
public static <T extends Vector<T>> T calculate(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 calculate(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 CatmullRomSpline set(T[] controlPoints, boolean continuous)
public 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)