34class EXPCL_PANDA_PARAMETRICS RopeNode :
public PandaNode {
36 explicit RopeNode(
const std::string &name);
39 RopeNode(
const RopeNode ©);
41 virtual void output(std::ostream &out)
const;
42 virtual void write(std::ostream &out,
int indent_level = 0)
const;
132 INLINE
void set_matrix(
const LMatrix4 &matrix);
157 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
158 int &internal_vertices,
160 Thread *current_thread)
const;
167 Thread *current_thread)
const;
168 void render_thread(
CullTraverser *trav, CullTraverserData &data,
170 void render_tape(
CullTraverser *trav, CullTraverserData &data,
172 void render_billboard(
CullTraverser *trav, CullTraverserData &data,
174 void render_tube(
CullTraverser *trav, CullTraverserData &data,
180 UnalignedLVecBase4 _c;
181 PN_stdfloat _thickness;
184 typedef pvector<CurveVertex> CurveSegment;
185 typedef pvector<CurveSegment> CurveSegments;
187 int get_connected_segments(CurveSegments &curve_segments,
191 const CurveSegments &curve_segments,
192 int num_curve_verts)
const;
194 const LVector3 &camera_vec,
195 const CurveSegments &curve_segments,
199 int &num_verts_per_slice,
200 const CurveSegments &curve_segments,
204 static void compute_tangent(LVector3 &tangent,
const CurveSegment &segment,
206 static PN_stdfloat compute_uv_t(PN_stdfloat &dist,
const UVMode &uv_mode,
207 PN_stdfloat uv_scale,
const CurveSegment &segment,
213 class EXPCL_PANDA_PARAMETRICS CData :
public CycleData {
216 INLINE CData(
const CData ©);
221 return RopeNode::get_class_type();
224 PT(NurbsCurveEvaluator) _curve;
225 RenderMode _render_mode;
228 PN_stdfloat _uv_scale;
229 NormalMode _normal_mode;
233 bool _use_vertex_color;
236 bool _use_vertex_thickness;
237 PN_stdfloat _thickness;
240 PipelineCycler<CData> _cycler;
241 typedef CycleDataReader<CData> CDReader;
242 typedef CycleDataWriter<CData> CDWriter;
244 static PStatCollector _rope_node_pcollector;
251 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
252 void fillin(DatagramIterator &scan, BamReader *manager);
255 static TypeHandle get_class_type() {
258 static void init_type() {
259 PandaNode::init_type();
261 PandaNode::get_class_type());
263 virtual TypeHandle get_type()
const {
264 return get_class_type();
266 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
269 static TypeHandle _type_handle;
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A single page of data maintained by a PipelineCycler.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This class is an abstraction for evaluating NURBS curves.
The result of a NurbsCurveEvaluator.
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of PandaNode by calling the xf...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
set_num_slices
Specifies the number of radial subdivisions to make if RenderMode is RM_tube.
get_num_slices
Returns the number of radial subdivisions to make if RenderMode is RM_tube.
get_vertex_thickness_dimension
Returns the numeric extended dimension in which the thickness component should be found.
get_render_mode
Returns the method used to render the rope.
clear_matrix
Resets the node's matrix to identity.
set_use_vertex_thickness
Sets the "use vertex thickness" flag.
set_thickness
Specifies the thickness of the rope, in pixels or in spatial units, depending on the render mode.
void reset_bound(const NodePath &rel_to)
Recomputes the bounding volume.
get_thickness
Returns the thickness of the rope.
set_num_subdiv
Specifies the number of subdivisions per cubic segment (that is, per unique knot value) to draw in a ...
get_normal_mode
Returns the kind of normals to generate for the rope.
has_matrix
Returns true if the node has a matrix set, false otherwise.
get_uv_mode
Returns the algorithm to use to generate UV's for the rope.
set_uv_direction
Specify true to vary the U coordinate down the length of the rope, or false to vary the V coordinate.
set_normal_mode
Specifies the kind of normals to generate for the rope.
get_num_subdiv
Returns the number of subdivisions per cubic segment to draw.
get_uv_scale
Returns the scaling factor to apply to generated UV's for the rope.
set_uv_mode
Specifies the algorithm to use to generate UV's for the rope.
get_use_vertex_color
Returns the "use vertex color" flag.
get_uv_direction
Returns true if the rope runs down the U coordinate of the texture, or false if it runs down the V co...
get_tube_up
Returns the normal vector used to control the "top" of the curve, when RenderMode is RM_tube.
set_render_mode
Specifies the method used to render the rope.
get_vertex_color_dimension
Returns the numeric extended dimension in which the color components should be found.
get_use_vertex_thickness
Returns the "use vertex thickness" flag.
get_matrix
Returns the optional matrix which is used to transform each control vertex after it has been transfor...
set_matrix
Specifies an optional matrix which is used to transform each control vertex after it has been transfo...
get_curve
Returns the curve represented by the RopeNode.
set_tube_up
Specifies a normal vector, generally perpendicular to the main axis of the starting point of the curv...
set_uv_scale
Specifies an additional scaling factor to apply to generated UV's along the rope.
set_curve
Sets the particular curve represented by the RopeNode.
set_use_vertex_color
Sets the "use vertex color" flag.
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.