14 #ifndef CUBICCURVESEG_H
15 #define CUBICCURVESEG_H
26 #define RT_TANGENT 0x02
28 #define RT_BASE_TYPE 0xff
30 #define RT_KEEP_ORIG 0x100
52 virtual bool get_point(PN_stdfloat t, LVecBase3 &point)
const;
53 virtual bool get_tangent(PN_stdfloat t, LVecBase3 &tangent)
const;
54 virtual bool get_pt(PN_stdfloat t, LVecBase3 &point, LVecBase3 &tangent)
const;
55 virtual bool get_2ndtangent(PN_stdfloat t, LVecBase3 &tangent2)
const;
61 CubicCurveseg(
int order,
const PN_stdfloat knots[],
const LVecBase4 cvs[]);
67 PN_stdfloat tlength = 1.0f);
69 void nurbs_basis(
int order,
const PN_stdfloat knots[],
const LVecBase4 cvs[]);
83 void evaluate_point(
const LVecBase4 &tv, LVecBase3 &result)
const {
84 PN_stdfloat recip_h = (rational) ? 1.0f/tv.dot(Bw) : 1.0f;
85 result.set(tv.dot(Bx) * recip_h,
87 tv.dot(Bz) * recip_h);
90 void evaluate_vector(
const LVecBase4 &tv, LVecBase3 &result)
const {
91 result.set(tv.dot(Bx),
98 static bool compute_seg(
int rtype0, PN_stdfloat t0,
const LVecBase4 &v0,
99 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
100 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
101 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3,
106 LVecBase4 Bx, By, Bz, Bw;
123 static void init_type() {
124 ParametricCurve::init_type();
126 ParametricCurve::get_class_type());
129 return get_class_type();
131 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
139 void compute_nurbs_basis(
int order,
140 const PN_stdfloat knots_in[],
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A CubicCurveseg is any curve that can be completely described by four 4-valued basis vectors,...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A single CV of a Hermite curve.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
A virtual base class for parametric curves.
virtual bool get_bezier_seg(BezierSeg &) const
Fills the BezierSeg structure with a description of the curve segment as a Bezier,...
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
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(),...