#include <c4d_baseobject.h>
Helper class to obtain the length of splines and the natural position along their path.
Public Member Functions | |
Bool | Init (SplineObject *op, Int32 segment=0, const Vector *padr=nullptr) |
Float | UniformToNatural (Float t) |
Float | GetLength () |
Float | GetSegmentLength (Int32 a, Int32 b) |
Private Member Functions | |
SplineLengthData () | |
~SplineLengthData () | |
Alloc/Free | |
static SplineLengthData * | Alloc () |
static void | Free (SplineLengthData *&bl) |
|
private |
|
private |
|
static |
|
static |
Bool Init | ( | SplineObject * | op, |
Int32 | segment = 0 , |
||
const Vector * | padr = nullptr |
||
) |
Initializes the spline length data.
[in] | op | The spline object to initialize. The caller owns the pointed spline object. |
[in] | segment | The segment to use. Decides what spline segment the calculations in SplineLengthData methods will be performed on. |
[in] | padr | For speedup purposes pass a pointer to start of the specified segment in the point array. Otherwise the spline has to search its array manually. |
Gets the natural position along the spline, to be used in SplineObject::GetSplinePoint() and SplineObject::GetSplineTangent(), from a uniform position.
The uniform position is with respect to the actual length of the spline, where the natural position only cares about the interpolation of the curve parameter.
[in] | t | The uniform position along the spline. |
Float GetLength | ( | ) |
Gets the length of the spline.