14#ifndef NURBSCURVERESULT_H
15#define NURBSCURVERESULT_H
47 INLINE
bool eval_point(PN_stdfloat t, LVecBase3 &point);
48 INLINE
bool eval_tangent(PN_stdfloat t, LVecBase3 &tangent);
51 PN_stdfloat result[],
int num_values);
58 PN_stdfloat result[],
int num_values)
const;
59 INLINE PN_stdfloat
get_segment_t(
int segment, PN_stdfloat t)
const;
69 int find_segment(PN_stdfloat t);
70 int r_find_segment(PN_stdfloat t,
int top,
int bot)
const;
72 void r_adaptive_sample(
int segment, PN_stdfloat t0,
const LPoint3 &p0,
73 PN_stdfloat t1,
const LPoint3 &p1, PN_stdfloat tolerance_2);
74 static PN_stdfloat sqr_dist_to_line(
const LPoint3 &point,
const LPoint3 &origin,
83 typedef epvector<LMatrix4> ComposedGeom;
84 ComposedGeom _composed;
87 PN_stdfloat _last_from;
90 class AdaptiveSample {
92 INLINE AdaptiveSample(PN_stdfloat t,
const LPoint3 &point);
96 typedef pvector<AdaptiveSample> AdaptiveResult;
97 AdaptiveResult _adaptive_result;
This encapsulates a series of matrices that are used to represent the sequential segments of a NurbsC...
void eval_segment_tangent(int segment, PN_stdfloat t, LVecBase3 &tangent) const
As eval_segment_point, but computes the tangent to the curve at the indicated point.
bool eval_tangent(PN_stdfloat t, LVecBase3 &tangent)
Computes the tangent to the curve at the indicated point in parametric time.
PN_stdfloat get_segment_t(int segment, PN_stdfloat t) const
Accepts a t value in the range [0, 1], and assumed to be relative to the indicated segment (as in eva...
get_sample_point
Returns the point on the curve of the nth sample point generated by the previous call to adaptive_sam...
int get_num_segments() const
Returns the number of piecewise continuous segments within the curve.
get_sample_t
Returns the t value of the nth sample point generated by the previous call to adaptive_sample().
PN_stdfloat get_end_t() const
Returns the last legal value of t on the curve.
bool eval_point(PN_stdfloat t, LVecBase3 &point)
Computes the point on the curve corresponding to the indicated value in parametric time.
PN_stdfloat get_start_t() const
Returns the first legal value of t on the curve.
PN_stdfloat eval_extended_point(PN_stdfloat t, int d)
Evaluates the curve in n-dimensional space according to the extended vertices associated with the cur...
void adaptive_sample(PN_stdfloat tolerance)
Determines the set of subdivisions necessary to approximate the curve with a set of linear segments,...
NurbsCurveResult(const NurbsBasisVector &basis, const LVecBase4 vecs[], const NurbsVertex *verts, int num_vertices)
The constructor automatically builds up the result as the product of the indicated set of basis matri...
void eval_segment_extended_points(int segment, PN_stdfloat t, int d, PN_stdfloat result[], int num_values) const
Simultaneously performs eval_extended_point on a contiguous sequence of dimensions.
void eval_segment_point(int segment, PN_stdfloat t, LVecBase3 &point) const
Evaluates the point on the curve corresponding to the indicated value in parametric time within the i...
PN_stdfloat eval_segment_extended_point(int segment, PN_stdfloat t, int d) const
Evaluates the curve in n-dimensional space according to the extended vertices associated with the cur...
bool eval_extended_points(PN_stdfloat t, int d, PN_stdfloat result[], int num_values)
Simultaneously performs eval_extended_point on a contiguous sequence of dimensions.
get_num_samples
Returns the number of sample points generated by the previous call to adaptive_sample().
This represents a single control vertex in a NurbsEvaluator.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.