14 #ifndef PIECEWISECURVE_H 15 #define PIECEWISECURVE_H 38 virtual bool get_point(PN_stdfloat t, LVecBase3 &point)
const;
39 virtual bool get_tangent(PN_stdfloat t, LVecBase3 &tangent)
const;
40 virtual bool get_pt(PN_stdfloat t, LVecBase3 &point, LVecBase3 &tangent)
const;
41 virtual bool get_2ndtangent(PN_stdfloat t, LVecBase3 &tangent2)
const;
43 virtual bool adjust_point(PN_stdfloat t, PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz);
44 virtual bool adjust_tangent(PN_stdfloat t, PN_stdfloat tx, PN_stdfloat ty, PN_stdfloat tz);
46 PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
47 PN_stdfloat tx, PN_stdfloat ty, PN_stdfloat tz);
50 int get_num_segs()
const;
53 bool insert_curveseg(
int ti,
ParametricCurve *seg, PN_stdfloat tlength);
55 bool remove_curveseg(
int ti);
56 void remove_all_curvesegs();
58 PN_stdfloat get_tlength(
int ti)
const;
59 PN_stdfloat get_tstart(
int ti)
const;
60 PN_stdfloat get_tend(
int ti)
const;
61 bool set_tlength(
int ti, PN_stdfloat tlength);
63 void make_nurbs(
int order,
int num_cvs,
64 const PN_stdfloat knots[],
const LVecBase4 cvs[]);
69 rebuild_curveseg(
int rtype0, PN_stdfloat t0,
const LVecBase4 &v0,
70 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
71 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
72 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3);
76 PN_stdfloat current_seg_range(PN_stdfloat t)
const;
102 static void init_type() {
103 ParametricCurve::init_type();
105 ParametricCurve::get_class_type());
108 return get_class_type();
110 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
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,...
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.
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
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 ...