Constructor and Description |
---|
Bezier() |
Bezier(Array<T> points,
int offset,
int length) |
Bezier(T... points) |
Bezier(T[] points,
int offset,
int length) |
Modifier and Type | Method and Description |
---|---|
float |
approximate(T v) |
float |
approxLength(int samples) |
static <T extends Vector<T>> |
cubic_derivative(T out,
float t,
T p0,
T p1,
T p2,
T p3,
T tmp)
Cubic Bezier curve derivative
|
static <T extends Vector<T>> |
cubic(T out,
float t,
T p0,
T p1,
T p2,
T p3,
T tmp)
Cubic Bezier curve
|
T |
derivativeAt(T out,
float t) |
static <T extends Vector<T>> |
linear_derivative(T out,
float t,
T p0,
T p1,
T tmp)
Simple linear interpolation derivative
|
static <T extends Vector<T>> |
linear(T out,
float t,
T p0,
T p1,
T tmp)
Simple linear interpolation
|
float |
locate(T v) |
static <T extends Vector<T>> |
quadratic_derivative(T out,
float t,
T p0,
T p1,
T p2,
T tmp)
Quadratic Bezier curve derivative
|
static <T extends Vector<T>> |
quadratic(T out,
float t,
T p0,
T p1,
T p2,
T tmp)
Quadratic Bezier curve
|
Bezier |
set(Array<T> points,
int offset,
int length) |
Bezier |
set(T... points) |
Bezier |
set(T[] points,
int offset,
int length) |
T |
valueAt(T out,
float t) |
public Bezier()
public Bezier(T... points)
public Bezier(T[] points, int offset, int length)
public static <T extends Vector<T>> T linear(T out, float t, T p0, T p1, T tmp)
out
- The Vector
to set to the result.t
- The location (ranging 0..1) on the line.p0
- The start point.p1
- The end point.tmp
- A temporary vector to be used by the calculation.public static <T extends Vector<T>> T linear_derivative(T out, float t, T p0, T p1, T tmp)
out
- The Vector
to set to the result.t
- The location (ranging 0..1) on the line.p0
- The start point.p1
- The end point.tmp
- A temporary vector to be used by the calculation.public static <T extends Vector<T>> T quadratic(T out, float t, T p0, T p1, T p2, T tmp)
out
- The Vector
to set to the result.t
- The location (ranging 0..1) on the curve.p0
- The first bezier point.p1
- The second bezier point.p2
- The third bezier point.tmp
- A temporary vector to be used by the calculation.public static <T extends Vector<T>> T quadratic_derivative(T out, float t, T p0, T p1, T p2, T tmp)
out
- The Vector
to set to the result.t
- The location (ranging 0..1) on the curve.p0
- The first bezier point.p1
- The second bezier point.p2
- The third bezier point.tmp
- A temporary vector to be used by the calculation.public static <T extends Vector<T>> T cubic(T out, float t, T p0, T p1, T p2, T p3, T tmp)
out
- The Vector
to set to the result.t
- The location (ranging 0..1) on the curve.p0
- The first bezier point.p1
- The second bezier point.p2
- The third bezier point.p3
- The fourth bezier point.tmp
- A temporary vector to be used by the calculation.public static <T extends Vector<T>> T cubic_derivative(T out, float t, T p0, T p1, T p2, T p3, T tmp)
out
- The Vector
to set to the result.t
- The location (ranging 0..1) on the curve.p0
- The first bezier point.p1
- The second bezier point.p2
- The third bezier point.p3
- The fourth bezier point.tmp
- A temporary vector to be used by the calculation.public T derivativeAt(T out, float t)
derivativeAt
in interface Path<T extends Vector<T>>
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 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.