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) |
float |
approxLength(int samples) |
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_derivative(T out,
float t,
T[] points,
boolean continuous,
T tmp)
Calculates the cubic b-spline derivative for the given position (t).
|
static <T extends Vector<T>> |
cubic_derivative(T out,
int i,
float u,
T[] points,
boolean continuous,
T tmp)
Calculates the cubic b-spline derivative 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).
|
static <T extends Vector<T>> |
derivative(T out,
float t,
T[] points,
int degree,
boolean continuous,
T tmp)
Calculates the n-degree b-spline derivative for the given position (t).
|
static <T extends Vector<T>> |
derivative(T out,
int i,
float u,
T[] points,
int degree,
boolean continuous,
T tmp)
Calculates the n-degree b-spline derivative for the given span (i) at the given position (u).
|
T |
derivativeAt(T out,
float t) |
T |
derivativeAt(T out,
int span,
float 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_derivative(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 cubic_derivative(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 derivative(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 static <T extends Vector<T>> T derivative(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 T derivativeAt(T out, float t)
derivativeAt
in interface Path<T extends Vector<T>>
public T derivativeAt(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)
public float approxLength(int samples)
approxLength
in interface Path<T extends Vector<T>>
samples
- The amount of divisions used to approximate length. Higher values will produce more precise results,
but will be more CPU intensive.Copyright © 2014. All Rights Reserved.