CurveFitter

Inheritance:

Methods of CurveFitter:

CurveFitter
CurveFitter::CurveFitter(void);

Description:

addHpr
void CurveFitter::add_hpr(float t, LVecBase3f const &hpr);

Description: Adds a single sample hpr.

addXyz
void CurveFitter::add_xyz(float t, LVecBase3f const &xyz);

Description: Adds a single sample xyz.

addXyzHpr
void CurveFitter::add_xyz_hpr(float t, LVecBase3f const &xyz, LVecBase3f const &hpr);

Description: Adds a single sample xyz & hpr simultaneously.

computeTangents
void CurveFitter::compute_tangents(float scale);

Description: Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(), ComputeTangents() must be called to set up the tangents correctly (unless the tangents were defined as the points were added).

desample
void CurveFitter::desample(float factor);

Description: Removes sample points in order to reduce the complexity of a sampled curve. Keeps one out of every factor samples. Also keeps the first and the last samples.

getClassType
static TypeHandle CurveFitter::get_class_type(void);

Undocumented function.

getNumSamples
int CurveFitter::get_num_samples(void) const;

Description: Returns the number of sample points that have been added.

getSampleHpr
LVecBase3f CurveFitter::get_sample_hpr(int n) const;

Description: Returns the orientation of the nth sample added.

getSampleT
float CurveFitter::get_sample_t(int n) const;

Description: Returns the parametric value of the nth sample added.

getSampleTangent
LVecBase3f CurveFitter::get_sample_tangent(int n) const;

Description: Returns the tangent associated with the nth sample added. This is only meaningful if compute_tangents() has already been called.

getSampleXyz
LVecBase3f CurveFitter::get_sample_xyz(int n) const;

Description: Returns the point in space of the nth sample added.

makeHermite
PointerTo< ParametricCurveCollection > CurveFitter::make_hermite(void) const;

Description: Converts the current set of data points into a Hermite curve.

makeNurbs
PointerTo< ParametricCurveCollection > CurveFitter::make_nurbs(void) const;

Description: Converts the current set of data points into a NURBS curve. This gives a smoother curve than produced by MakeHermite().

output
void CurveFitter::output(ostream &out) const;

Description:

removeSamples
void CurveFitter::remove_samples(int begin, int end);

Description: Eliminates all samples from index begin, up to but not including index end, from the database.

reset
void CurveFitter::reset(void);

Description: Removes all the data points previously added to the CurveFitter, and initializes it for a new curve.

sample
void CurveFitter::sample(ParametricCurveCollection *curves, int count);

Description: Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated number of times. The sampling is made evenly in parametric time, and then the timewarps, if any, are applied.

sortPoints
void CurveFitter::sort_points(void);

Description: Sorts all the data points in order by parametric time, in case they were added in an incorrect order.

wrapHpr
void CurveFitter::wrap_hpr(void);

Description: Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degrees, which should prevent incorrect HPR wrapping.

write
void CurveFitter::write(ostream &out) const;

Description: