#include <c4d_baseobject.h>
Helper class to obtain the length of splines and the natural position along their path.
公共成员函数 |
|
Bool | Init ( SplineObject *op, Int32 segment=0, const 向量 *padr=nullptr) |
Float | UniformToNatural ( Float t) |
Float | GetLength (void) |
Float | GetSegmentLength ( Int32 a, Int32 b) |
私有成员函数 |
|
SplineLengthData () | |
~SplineLengthData () |
Alloc/Free |
|
static SplineLengthData * | Alloc () |
static void | Free ( SplineLengthData *&bl) |
|
|
|
static |
Allocates a spline length data. Destroy the allocated spline length data with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
|
static |
Destructs spline length data allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
[in,out] | bl | The spline length data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
Bool Init | ( | SplineObject * | op , |
Int32 |
segment
=
0
,
|
||
const 向量 * |
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. |
Float UniformToNatural | ( | Float | t | ) |
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 | ( | void | ) |
Gets the length of the spline.
Float GetSegmentLength | ( | Int32 | a , |
Int32 | b | ||
) |
Gets the length of a segment.
[in] | a | Start segment. |
[in] | b | End segment. |