24 _u_knots_dirty =
true;
25 _u_basis_dirty =
true;
47 _v_knots_dirty =
true;
48 _v_basis_dirty =
true;
66 return _num_u_vertices;
75 return _num_v_vertices;
85set_vertex(
int ui,
int vi,
const LVecBase4 &vertex) {
86 nassertv(ui >= 0 && ui < _num_u_vertices &&
87 vi >= 0 && vi < _num_v_vertices);
88 vert(ui, vi).set_vertex(vertex);
97set_vertex(
int ui,
int vi,
const LVecBase3 &vertex, PN_stdfloat weight) {
98 nassertv(ui >= 0 && ui < _num_u_vertices &&
99 vi >= 0 && vi < _num_v_vertices);
100 vert(ui, vi).set_vertex(LVecBase4(vertex[0] * weight, vertex[1] * weight, vertex[2] * weight, weight));
109 nassertr(ui >= 0 && ui < _num_u_vertices &&
110 vi >= 0 && vi < _num_v_vertices, LVecBase4::zero());
111 return vert(ui, vi).get_vertex();
120 nassertr(ui >= 0 && ui < _num_u_vertices &&
121 vi >= 0 && vi < _num_v_vertices, LVecBase4::zero());
123 NodePath space = vert(ui, vi).get_space(rel_to);
124 const LVecBase4 &vertex = vert(ui, vi).get_vertex();
128 const LMatrix4 &mat = space.
get_mat(rel_to);
144 nassertv(ui >= 0 && ui < _num_u_vertices &&
145 vi >= 0 && vi < _num_v_vertices);
159 nassertv(ui >= 0 && ui < _num_u_vertices &&
160 vi >= 0 && vi < _num_v_vertices);
181 nassertv(ui >= 0 && ui < _num_u_vertices &&
182 vi >= 0 && vi < _num_v_vertices);
193 nassertr(ui >= 0 && ui < _num_u_vertices &&
194 vi >= 0 && vi < _num_v_vertices, 0.0f);
204 return _num_u_vertices + _u_order;
213 return _num_v_vertices + _v_order;
222 if (_u_basis_dirty) {
234 if (_v_basis_dirty) {
245vert(
int ui,
int vi) {
246 return _vertices[ui * _num_v_vertices + vi];
254vert(
int ui,
int vi)
const {
255 return _vertices[ui * _num_v_vertices + vi];
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 surfaces.
void set_extended_vertex(int ui, int vi, int d, PN_stdfloat value)
Sets an n-dimensional vertex value.
get_v_order
Returns the order of the surface in the V direction as set by a previous call to set_v_order().
PN_stdfloat get_extended_vertex(int ui, int vi, int d) const
Returns an n-dimensional vertex value.
void set_vertex(int ui, int vi, const LVecBase4 &vertex)
Sets the nth control vertex of the surface, as a vertex in 4-d homogeneous space.
int get_num_v_segments() const
Returns the number of piecewise continuous segments in the surface in the V direction.
get_num_v_knots
Returns the number of knot values in the surface in the V direction.
const LVecBase4 & get_vertex(int ui, int vi) const
Returns the nth control vertex of the surface, relative to its indicated coordinate space.
set_u_order
Sets the order of the surface in the U direction.
set_v_order
Sets the order of the surface in the V direction.
int get_num_u_vertices() const
Returns the number of control vertices in the U direction on the surface.
get_num_u_knots
Returns the number of knot values in the surface in the U direction.
int get_num_v_vertices() const
Returns the number of control vertices in the V direction on the surface.
void set_vertex_space(int ui, int vi, const NodePath &space)
Sets the coordinate space of the nth control vertex.
get_u_order
Returns the order of the surface in the U direction as set by a previous call to set_u_order().
int get_num_u_segments() const
Returns the number of piecewise continuous segments in the surface in the U direction.
This represents a single control vertex in a NurbsEvaluator.
void set_extended_vertex(int d, PN_stdfloat value)
Sets an n-dimensional vertex value.
void set_space(const NodePath &space)
Sets the space of this vertex as a fixed NodePath.
PN_stdfloat get_extended_vertex(int d) const
Returns an n-dimensional vertex value.