APIdia Launch Partner
Top Description Methods
com.badlogic.gdx.math

public Interface Path<T>

Known Direct Implementers
com.badlogic.gdx.math.Bezier, com.badlogic.gdx.math.BSpline, com.badlogic.gdx.math.CatmullRomSpline

Interface that specifies a path of type T within the window 0.0<=t<=1.0.
Author
Xoppa

Method Summary

Modifier and TypeMethod and Description
public float
approximate(T v)

Returns: The approximated value (between 0 and 1) on the path which is closest to the specified value.

public float
approxLength(int
The amount of divisions used to approximate length. Higher values will produce more precise results, but will be more CPU intensive.
samples
)

Returns: An approximated length of the spline through sampling the curve and accumulating the euclidean distances between the sample points.

public T
derivativeAt(T out, float t)

public float
locate(T v)

Returns: The precise location (between 0 and 1) on the path which is closest to the specified value.

public T
valueAt(T out, float t)

Returns: The value of the path at t where 0<=t<=1

Method Detail

approximateback to summary
public float approximate(T v)
Returns:float

The approximated value (between 0 and 1) on the path which is closest to the specified value. Note that the implementation of this method might be optimized for speed against precision, see locate(Object) for a more precise (but more intensive) method.

approxLengthback to summary
public float approxLength(int samples)
Parameters
samples:int

The amount of divisions used to approximate length. Higher values will produce more precise results, but will be more CPU intensive.

Returns:float

An approximated length of the spline through sampling the curve and accumulating the euclidean distances between the sample points.

derivativeAtback to summary
public T derivativeAt(T out, float t)
locateback to summary
public float locate(T v)
Returns:float

The precise location (between 0 and 1) on the path which is closest to the specified value. Note that the implementation of this method might be CPU intensive, see approximate(Object) for a faster (but less precise) method.

valueAtback to summary
public T valueAt(T out, float t)
Returns:T

The value of the path at t where 0<=t<=1