24 _u_knots_dirty =
true;
25 _u_basis_dirty =
true;
32 INLINE
int NurbsSurfaceEvaluator::
47 _v_knots_dirty =
true;
48 _v_basis_dirty =
true;
55 INLINE
int NurbsSurfaceEvaluator::
66 return _num_u_vertices;
75 return _num_v_vertices;
86 nassertv(ui >= 0 && ui < _num_u_vertices &&
87 vi >= 0 && vi < _num_v_vertices);
88 vert(ui, vi).set_vertex(vertex);
97 set_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);
202 INLINE
int NurbsSurfaceEvaluator::
203 get_num_u_knots()
const {
204 return _num_u_vertices + _u_order;
211 INLINE
int NurbsSurfaceEvaluator::
212 get_num_v_knots()
const {
213 return _num_v_vertices + _v_order;
222 if (_u_basis_dirty) {
234 if (_v_basis_dirty) {
245 vert(
int ui,
int vi) {
246 return _vertices[ui * _num_v_vertices + vi];
254 vert(
int ui,
int vi)
const {
255 return _vertices[ui * _num_v_vertices + vi];
258 INLINE std::ostream &
void set_vertex_space(int ui, int vi, const NodePath &space)
Sets the coordinate space of the nth control vertex.
const LVecBase4 & get_vertex(int ui, int vi) const
Returns the nth control vertex of the surface, relative to its indicated coordinate space.
bool is_empty() const
Returns true if the NodePath contains no nodes.
int get_num_segments() const
Returns the number of piecewise continuous segments in the curve.
set_u_order
Sets the order of the surface in the U direction.
void set_extended_vertex(int ui, int vi, int d, PN_stdfloat value)
Sets an n-dimensional vertex value.
This class is an abstraction for evaluating NURBS surfaces.
int get_num_v_vertices() const
Returns the number of control vertices in the V direction on the surface.
This represents a single control vertex in a NurbsEvaluator.
int get_num_u_vertices() const
Returns the number of control vertices in the U direction on the surface.
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.
int get_num_u_segments() const
Returns the number of piecewise continuous segments in the surface in the U direction.
void set_space(const NodePath &space)
Sets the space of this vertex as a fixed NodePath.
set_v_order
Sets the order of the surface in the V direction.
PN_stdfloat get_extended_vertex(int d) const
Returns an n-dimensional vertex value.
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
void set_extended_vertex(int d, PN_stdfloat value)
Sets an n-dimensional vertex value.
PN_stdfloat get_extended_vertex(int ui, int vi, int d) const
Returns an n-dimensional vertex value.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...