42 return (
int)_vertices.size();
53 nassertv(i >= 0 && i < (
int)_vertices.size());
54 _vertices[i].set_vertex(vertex);
63set_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();
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);
163 return (
int)_vertices.size() + _order;
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
bool is_empty() const
Returns true if the NodePath contains no nodes.
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
int get_num_segments() const
Returns the number of piecewise continuous segments in the curve.
This class is an abstraction for evaluating NURBS curves.
get_num_vertices
Returns the number of control vertices in the curve.
void set_vertex(int i, const LVecBase4 &vertex)
Sets the nth control vertex of the curve, as a vertex in 4-d homogeneous space.
void set_order(int order)
Sets the order of the curve.
void set_extended_vertex(int i, int d, PN_stdfloat value)
Sets an n-dimensional vertex value.
get_vertex
Returns the nth control vertex of the curve, relative to its indicated coordinate space.
int get_order() const
Returns the order of the curve as set by a previous call to set_order().
int get_num_segments() const
Returns the number of piecewise continuous segments in the curve.
PN_stdfloat get_extended_vertex(int i, int d) const
Returns an n-dimensional vertex value.
get_num_knots
Returns the number of knot values in the curve.
void set_vertex_space(int i, const NodePath &space)
Sets the coordinate space of the nth control vertex.