15 #ifndef PIECEWISECURVE_H 16 #define PIECEWISECURVE_H 18 #include "pandabase.h" 20 #include "parametricCurve.h" 21 #include "pointerTo.h" 41 virtual bool get_point(PN_stdfloat t,
LVecBase3 &point)
const;
42 virtual bool get_tangent(PN_stdfloat t,
LVecBase3 &tangent)
const;
44 virtual bool get_2ndtangent(PN_stdfloat t,
LVecBase3 &tangent2)
const;
46 virtual bool adjust_point(PN_stdfloat t, PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz);
47 virtual bool adjust_tangent(PN_stdfloat t, PN_stdfloat tx, PN_stdfloat ty, PN_stdfloat tz);
49 PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
50 PN_stdfloat tx, PN_stdfloat ty, PN_stdfloat tz);
53 int get_num_segs()
const;
56 bool insert_curveseg(
int ti,
ParametricCurve *seg, PN_stdfloat tlength);
58 bool remove_curveseg(
int ti);
59 void remove_all_curvesegs();
61 PN_stdfloat get_tlength(
int ti)
const;
62 PN_stdfloat get_tstart(
int ti)
const;
63 PN_stdfloat get_tend(
int ti)
const;
64 bool set_tlength(
int ti, PN_stdfloat tlength);
66 void make_nurbs(
int order,
int num_cvs,
67 const PN_stdfloat knots[],
const LVecBase4 cvs[]);
72 rebuild_curveseg(
int rtype0, PN_stdfloat t0,
const LVecBase4 &v0,
73 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
74 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
75 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3);
79 PN_stdfloat current_seg_range(PN_stdfloat t)
const;
105 static void init_type() {
106 ParametricCurve::init_type();
107 register_type(_type_handle,
"PiecewiseCurve",
108 ParametricCurve::get_class_type());
111 return get_class_type();
113 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This is the base class for all three-component vectors and points.
virtual bool adjust_point(PN_stdfloat t, PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz)
Recomputes the curve such that it passes through the point (px, py, pz) at time t, but keeps the same tangent value at that point.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
A virtual base class for parametric curves.
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
This is our own Panda specialization on the default STL vector.
virtual bool is_valid() const
Returns true if the curve is defined.
A PiecewiseCurve is a curve made up of several curve segments, connected in a head-to-tail fashion...
virtual PN_stdfloat get_max_t() const
Returns the upper bound of t for the entire curve.
virtual bool get_bezier_segs(BezierSegs &) const
Fills up the indicated vector with a list of BezierSeg structs that describe the curve.
virtual bool adjust_pt(PN_stdfloat t, PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat tx, PN_stdfloat ty, PN_stdfloat tz)
Recomputes the curve such that it passes through the point (px, py, pz) with the tangent (tx...
virtual bool adjust_tangent(PN_stdfloat t, PN_stdfloat tx, PN_stdfloat ty, PN_stdfloat tz)
Recomputes the curve such that it has the tangent (tx, ty, tz) at time t, but keeps the same position...
This is the base class for all three-component vectors and points.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...