40 INLINE
int NurbsCurveEvaluator::
41 get_num_vertices()
const {
42 return (
int)_vertices.size();
53 nassertv(i >= 0 && i < (
int)_vertices.size());
54 _vertices[i].set_vertex(vertex);
63 set_vertex(
int i,
const LVecBase3 &vertex, PN_stdfloat weight) {
64 nassertv(i >= 0 && i < (
int)_vertices.size());
65 _vertices[i].set_vertex(LVecBase4(vertex[0] * weight, vertex[1] * weight, vertex[2] * weight, weight));
74 nassertr(i >= 0 && i < (
int)_vertices.size(), LVecBase4::zero());
75 return _vertices[i].get_vertex();
84 nassertr(i >= 0 && i < (
int)_vertices.size(), LVecBase4::zero());
86 NodePath space = _vertices[i].get_space(rel_to);
87 const LVecBase4 &vertex = _vertices[i].get_vertex();
88 if (space.is_empty()) {
91 const LMatrix4 &mat = space.get_mat(rel_to);
107 nassertv(i >= 0 && i < (
int)_vertices.size());
108 _vertices[i].set_space(space);
121 nassertv(i >= 0 && i < (
int)_vertices.size());
122 _vertices[i].set_space(space);
142 nassertv(i >= 0 && i < (
int)_vertices.size());
143 _vertices[i].set_extended_vertex(d, value);
153 nassertr(i >= 0 && i < (
int)_vertices.size(), 0.0f);
154 return _vertices[i].get_extended_vertex(d);
161 INLINE
int NurbsCurveEvaluator::
162 get_num_knots()
const {
163 return (
int)_vertices.size() + _order;
178 INLINE std::ostream &
int get_num_segments() const
Returns the number of piecewise continuous segments in the curve.
This class is an abstraction for evaluating NURBS curves.
void set_order(int order)
Sets the order of the curve.
get_vertex
Returns the nth control vertex of the curve, relative to its indicated coordinate space.
PN_stdfloat get_extended_vertex(int i, int d) const
Returns an n-dimensional vertex value.
void set_extended_vertex(int i, int d, PN_stdfloat value)
Sets an n-dimensional vertex value.
void set_vertex(int i, const LVecBase4 &vertex)
Sets the nth control vertex of the curve, as a vertex in 4-d homogeneous space.
int get_num_segments() const
Returns the number of piecewise continuous segments in the curve.
void set_vertex_space(int i, const NodePath &space)
Sets the coordinate space of the nth control vertex.
int get_order() const
Returns the order of the curve as set by a previous call to set_order().
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...