17 INLINE NurbsBasisVector::
25 INLINE NurbsBasisVector::
42 return _segments.size();
50 nassertr(!_segments.empty(), 0.0f);
51 return _segments.front()._from;
59 nassertr(!_segments.empty(), 0.0f);
60 return _segments.back()._to;
70 nassertr(segment >= 0 && segment < (
int)_segments.size(), 0);
71 return _segments[segment]._vertex_index;
79 nassertr(segment >= 0 && segment < (
int)_segments.size(), 0.0f);
80 return _segments[segment]._from;
88 nassertr(segment >= 0 && segment < (
int)_segments.size(), 0.0f);
89 return _segments[segment]._to;
99 nassertr(segment >= 0 && segment < (
int)_segments.size(), LMatrix4::ident_mat());
100 return _segments[segment]._basis;
109 nassertr(segment >= 0 && segment < (
int)_segments.size(), 0.0f);
110 PN_stdfloat from = _segments[segment]._from;
111 PN_stdfloat to = _segments[segment]._to;
112 t = (t - from) / (to - from);
113 return std::min(std::max(t, (PN_stdfloat)0.0), (PN_stdfloat)1.0);
const LMatrix4 & get_basis(int segment) const
Returns the basis matrix associated with the nth segment.
int get_num_segments() const
Returns the number of piecewise continuous segments in the curve.
PN_stdfloat get_from(int segment) const
Returns the t value of the beginning of this segment.
int get_vertex_index(int segment) const
Returns the vertex index of the nth segment.
PN_stdfloat get_to(int segment) const
Returns the t value of the end of this segment.
PN_stdfloat get_start_t() const
Returns the first legal value of t on the curve.
int get_order() const
Returns the order of the segments in the curve.
PN_stdfloat scale_t(int segment, PN_stdfloat t) const
Scales the value of t into the range [0, 1] corresponding to [from, to].
PN_stdfloat get_end_t() const
Returns the last legal value of t on the curve.