21 INLINE RopeNode::CData::
24 _render_mode = RopeNode::RM_thread;
25 _uv_mode = RopeNode::UV_none;
28 _normal_mode = RopeNode::NM_none;
32 _use_vertex_color =
false;
35 _use_vertex_thickness =
false;
44 INLINE RopeNode::CData::
45 CData(
const RopeNode::CData ©) :
47 _render_mode(copy._render_mode),
48 _uv_mode(copy._uv_mode),
49 _u_dominant(copy._u_dominant),
50 _uv_scale(copy._uv_scale),
51 _normal_mode(copy._normal_mode),
52 _tube_up(copy._tube_up),
53 _matrix(copy._matrix),
54 _has_matrix(copy._has_matrix),
55 _use_vertex_color(copy._use_vertex_color),
56 _num_subdiv(copy._num_subdiv),
57 _num_slices(copy._num_slices),
58 _use_vertex_thickness(copy._use_vertex_thickness),
59 _thickness(copy._thickness)
72 cdata->_curve = curve;
96 cdata->_render_mode = render_mode;
108 return cdata->_render_mode;
120 cdata->_uv_mode = uv_mode;
132 return cdata->_uv_mode;
144 cdata->_u_dominant = u_dominant;
157 return cdata->_u_dominant;
171 cdata->_uv_scale = uv_scale;
183 return cdata->_uv_scale;
197 cdata->_normal_mode = normal_mode;
210 return cdata->_normal_mode;
228 cdata->_tube_up = tube_up;
241 return cdata->_tube_up;
259 cdata->_use_vertex_color = flag;
271 return cdata->_use_vertex_color;
298 nassertv(num_subdiv >= 0);
300 cdata->_num_subdiv = num_subdiv;
312 return cdata->_num_subdiv;
330 nassertv(num_slices >= 0);
332 cdata->_num_slices = num_slices;
345 return cdata->_num_slices;
365 cdata->_use_vertex_thickness = flag;
377 return cdata->_use_vertex_thickness;
404 nassertv(thickness >= 0);
406 cdata->_thickness = thickness;
418 return cdata->_thickness;
432 cdata->_matrix = matrix;
433 cdata->_has_matrix =
true;
446 cdata->_has_matrix =
false;
458 return cdata->_has_matrix;
472 return cdata->_matrix;
void set_normal_mode(NormalMode normal_mode)
Specifies the kind of normals to generate for the rope.
static const LMatrix4f & ident_mat()
Returns an identity matrix.
void set_tube_up(const LVector3 &tube_up)
Specifies a normal vector, generally perpendicular to the main axis of the starting point of the curv...
UVMode get_uv_mode() const
Returns the algorithm to use to generate UV's for the rope.
int get_num_slices() const
Returns the number of radial subdivisions to make if RenderMode is RM_tube.
bool get_use_vertex_color() const
Returns the "use vertex color" flag.
This class is an abstraction for evaluating NURBS curves.
bool has_matrix() const
Returns true if the node has a matrix set, false otherwise.
const LMatrix4 & get_matrix() const
Returns the optional matrix which is used to transform each control vertex after it has been transfor...
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
int get_num_subdiv() const
Returns the number of subdivisions per cubic segment to draw.
NormalMode get_normal_mode() const
Returns the kind of normals to generate for the rope.
bool get_uv_direction() const
Returns true if the rope runs down the U coordinate of the texture, or false if it runs down the V co...
void clear_matrix()
Resets the node's matrix to identity.
void set_curve(NurbsCurveEvaluator *curve)
Sets the particular curve represented by the RopeNode.
void set_uv_direction(bool u_dominant)
Specify true to vary the U coordinate down the length of the rope, or false to vary the V coordinate...
PN_stdfloat get_uv_scale() const
Returns the scaling factor to apply to generated UV's for the rope.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
void set_use_vertex_thickness(bool flag)
Sets the "use vertex thickness" flag.
void set_num_slices(int num_slices)
Specifies the number of radial subdivisions to make if RenderMode is RM_tube.
void set_num_subdiv(int num_subdiv)
Specifies the number of subdivisions per cubic segment (that is, per unique knot value) to draw in a ...
void set_render_mode(RenderMode render_mode)
Specifies the method used to render the rope.
bool get_use_vertex_thickness() const
Returns the "use vertex thickness" flag.
This is a 4-by-4 transform matrix.
void set_thickness(PN_stdfloat thickness)
Specifies the thickness of the rope, in pixels or in spatial units, depending on the render mode...
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
void set_uv_mode(UVMode uv_mode)
Specifies the algorithm to use to generate UV's for the rope.
void set_use_vertex_color(bool flag)
Sets the "use vertex color" flag.
const LVector3 & get_tube_up() const
Returns the normal vector used to control the "top" of the curve, when RenderMode is RM_tube...
void set_matrix(const LMatrix4 &matrix)
Specifies an optional matrix which is used to transform each control vertex after it has been transfo...
RenderMode get_render_mode() const
Returns the method used to render the rope.
void set_uv_scale(PN_stdfloat scale)
Specifies an additional scaling factor to apply to generated UV's along the rope. ...
static int get_vertex_thickness_dimension()
Returns the numeric extended dimension in which the thickness component should be found...
PN_stdfloat get_thickness() const
Returns the thickness of the rope.
NurbsCurveEvaluator * get_curve() const
Returns the curve represented by the RopeNode.
static LVector3f up(CoordinateSystem cs=CS_default)
Returns the up vector for the given coordinate system.
static int get_vertex_color_dimension()
Returns the numeric extended dimension in which the color components should be found.