33class EXPCL_PANDA_PARAMETRICS CurveFitter {
39 void add_xyz(PN_stdfloat t,
const LVecBase3 &xyz);
40 void add_hpr(PN_stdfloat t,
const LVecBase3 &hpr);
41 void add_xyz_hpr(PN_stdfloat t,
const LVecBase3 &xyz,
const LVecBase3 &hpr);
59 void output(std::ostream &out)
const;
60 void write(std::ostream &out)
const;
66 INLINE
void output(std::ostream &out)
const;
67 INLINE
bool operator < (
const DataPoint &other)
const;
73 LVecBase3 _hpr_tangent;
76 typedef pvector<DataPoint> Data;
86 static void init_type() {
91 static TypeHandle _type_handle;
99INLINE std::ostream &operator << (std::ostream &out,
const CurveFitter &cf) {
void add_xyz(PN_stdfloat t, const LVecBase3 &xyz)
Adds a single sample xyz.
PN_stdfloat get_sample_t(int n) const
Returns the parametric value of the nth sample added.
LVecBase3 get_sample_xyz(int n) const
Returns the point in space of the nth sample added.
void wrap_hpr()
Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degree...
int get_num_samples() const
Returns the number of sample points that have been added.
void sort_points()
Sorts all the data points in order by parametric time, in case they were added in an incorrect order.
void sample(ParametricCurveCollection *curves, int count)
Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated numbe...
void compute_tangents(PN_stdfloat scale)
Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(),...
LVecBase3 get_sample_tangent(int n) const
Returns the tangent associated with the nth sample added.
void remove_samples(int begin, int end)
Eliminates all samples from index begin, up to but not including index end, from the database.
void add_hpr(PN_stdfloat t, const LVecBase3 &hpr)
Adds a single sample hpr.
void add_xyz_hpr(PN_stdfloat t, const LVecBase3 &xyz, const LVecBase3 &hpr)
Adds a single sample xyz & hpr simultaneously.
LVecBase3 get_sample_hpr(int n) const
Returns the orientation of the nth sample added.
void desample(PN_stdfloat factor)
Removes sample points in order to reduce the complexity of a sampled curve.
void reset()
Removes all the data points previously added to the CurveFitter, and initializes it for a new curve.
A parametric curve defined by a sequence of control vertices, each with an in and out tangent.
A Nonuniform Rational B-Spline.
This is a set of zero or more ParametricCurves, which may or may not be related.
A virtual base class for parametric curves.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.