vtdata library
Public Member Functions | List of all members
CubicSpline Class Reference

Public Member Functions

void Cleanup ()
int AddPoint (const DPoint3 &vec)
bool Generate ()
bool Interpolate (double par, DPoint3 *vec, DPoint3 *dvec=NULL, DPoint3 *ddvec=NULL) const
int NumPoints () const

Detailed Description

Implements interpolation of a cubic spline curved, defined by a set of control points. The curve will pass through each control point.

Member Function Documentation

int CubicSpline::AddPoint ( const DPoint3 vec)

Adds an interpolation point.

void CubicSpline::Cleanup ( )


bool CubicSpline::Generate ( )

Generate the spline coeffs.

bool CubicSpline::Interpolate ( double  par,
DPoint3 vec,
DPoint3 dvec = NULL,
DPoint3 ddvec = NULL 
) const

Perform interpolation.

parThe interpolation parameter, in the range of 0 to N, where N is the number of segments (one less than the number of control points that define the curve).
vecThe point that results from the interpolation.
dvecTangential vector (optional).
ddvecCurvature vector (optional).
int CubicSpline::NumPoints ( ) const

Return number of control points that define this curve.