|
Panda3D
|
This class draws a visible representation of the NURBS curve stored in its NurbsCurveEvaluator. More...
Public Types | |
| enum | NormalMode { NMNone = 0, NMVertex = 1 } |
| enum | RenderMode { RMThread = 0, RMTape = 1, RMBillboard = 2, RMTube = 3 } |
| enum | UVMode { UVNone = 0, UVParametric = 1, UVDistance = 2, UVDistance2 = 3 } |
Public Member Functions | |
| RopeNode (string name) | |
| clearMatrix () | |
| Resets the node's matrix to identity. | |
| NurbsCurveEvaluator | getCurve () |
| Returns the curve represented by the RopeNode. | |
| Mat4 const | getMatrix () |
| Returns the optional matrix which is used to transform each control vertex after it has been transformed into the RopeNode's coordinate space, but before the polygon vertices are generated. | |
| NormalMode | getNormalMode () |
| Returns the kind of normals to generate for the rope. | |
| int | getNumSlices () |
| Returns the number of radial subdivisions to make if RenderMode is RM_tube. | |
| int | getNumSubdiv () |
| Returns the number of subdivisions per cubic segment to draw. | |
| RenderMode | getRenderMode () |
| Returns the method used to render the rope. | |
| float | getThickness () |
| Returns the thickness of the rope. | |
| Vec3 const | getTubeUp () |
| Returns the normal vector used to control the "top" of the curve, when RenderMode is RM_tube. | |
| bool | getUseVertexColor () |
| Returns the "use vertex color" flag. | |
| bool | getUseVertexThickness () |
| Returns the "use vertex thickness" flag. | |
| bool | getUvDirection () |
| Returns true if the rope runs down the U coordinate of the texture, or false if it runs down the V coordinate. | |
| UVMode | getUvMode () |
| Returns the algorithm to use to generate UV's for the rope. | |
| float | getUvScale () |
| Returns the scaling factor to apply to generated UV's for the rope. | |
| bool | hasMatrix () |
| Returns true if the node has a matrix set, false otherwise. | |
| resetBound (NodePath const rel_to) | |
| Recomputes the bounding volume. | |
| setCurve (NurbsCurveEvaluator curve) | |
| Sets the particular curve represented by the RopeNode. | |
| setMatrix (Mat4 const matrix) | |
| Specifies an optional matrix which is used to transform each control vertex after it has been transformed into the RopeNode's coordinate space, but before the polygon vertices are generated. | |
| setNormalMode (NormalMode normal_mode) | |
| Specifies the kind of normals to generate for the rope. | |
| setNumSlices (int num_slices) | |
| Specifies the number of radial subdivisions to make if RenderMode is RM_tube. | |
| setNumSubdiv (int num_subdiv) | |
| Specifies the number of subdivisions per cubic segment (that is, per unique knot value) to draw in a fixed uniform tesselation of the curve. | |
| setRenderMode (RenderMode render_mode) | |
| Specifies the method used to render the rope. | |
| setThickness (float thickness) | |
| Specifies the thickness of the rope, in pixels or in spatial units, depending on the render mode. | |
| setTubeUp (Vec3 const tube_up) | |
| Specifies a normal vector, generally perpendicular to the main axis of the starting point of the curve, that controls the "top" of the curve, when RenderMode is RM_tube. | |
| setUseVertexColor (bool flag) | |
| Sets the "use vertex color" flag. | |
| setUseVertexThickness (bool flag) | |
| Sets the "use vertex thickness" flag. | |
| setUvDirection (bool u_dominant) | |
| Specify true to vary the U coordinate down the length of the rope, or false to vary the V coordinate. | |
| setUvMode (UVMode uv_mode) | |
| Specifies the algorithm to use to generate UV's for the rope. | |
| setUvScale (float scale) | |
| Specifies an additional scaling factor to apply to generated UV's along the rope. | |
Static Public Member Functions | |
| static TypeHandle | getClassType () |
| static int | getVertexColorDimension () |
| Returns the numeric extended dimension in which the color components should be found. | |
| static int | getVertexThicknessDimension () |
| Returns the numeric extended dimension in which the thickness component should be found. | |
This class draws a visible representation of the NURBS curve stored in its NurbsCurveEvaluator.
It automatically recomputes the curve every frame.
This is not related to NurbsCurve, CubicCurveseg or any of the ParametricCurve-derived objects in this module. It is a completely parallel implementation of NURBS curves, and will probably eventually replace the whole ParametricCurve class hierarchy.
| enum NormalMode |
| enum RenderMode |
| enum UVMode |
| RopeNode | ( | string | name | ) |
| clearMatrix | ( | ) |
Resets the node's matrix to identity.
See set_matrix().
| static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from PandaNode.
| NurbsCurveEvaluator getCurve | ( | ) |
Returns the curve represented by the RopeNode.
| Mat4 const getMatrix | ( | ) |
Returns the optional matrix which is used to transform each control vertex after it has been transformed into the RopeNode's coordinate space, but before the polygon vertices are generated.
| NormalMode getNormalMode | ( | ) |
Returns the kind of normals to generate for the rope.
This is only applicable when the RenderMode is set to RM_tube.
| int getNumSlices | ( | ) |
Returns the number of radial subdivisions to make if RenderMode is RM_tube.
It is ignored in the other render modes. See set_num_slices().
| int getNumSubdiv | ( | ) |
Returns the number of subdivisions per cubic segment to draw.
See set_num_subdiv().
| RenderMode getRenderMode | ( | ) |
Returns the method used to render the rope.
See set_render_mode().
| float getThickness | ( | ) |
Returns the thickness of the rope.
See set_thickness().
| Vec3 const getTubeUp | ( | ) |
Returns the normal vector used to control the "top" of the curve, when RenderMode is RM_tube.
See set_tube_up().
| bool getUseVertexColor | ( | ) |
Returns the "use vertex color" flag.
See set_use_vertex_color().
| bool getUseVertexThickness | ( | ) |
Returns the "use vertex thickness" flag.
See set_use_vertex_thickness().
| bool getUvDirection | ( | ) |
Returns true if the rope runs down the U coordinate of the texture, or false if it runs down the V coordinate.
| UVMode getUvMode | ( | ) |
Returns the algorithm to use to generate UV's for the rope.
| float getUvScale | ( | ) |
Returns the scaling factor to apply to generated UV's for the rope.
| static int getVertexColorDimension | ( | ) | [static] |
Returns the numeric extended dimension in which the color components should be found.
See NurbsCurveEvaluator.set_extended_vertex().
The color components will be expected at (n, n + 1, n + 2, n + 3).
| static int getVertexThicknessDimension | ( | ) | [static] |
Returns the numeric extended dimension in which the thickness component should be found.
See NurbsCurveEvaluator.set_extended_vertex().
| bool hasMatrix | ( | ) |
Returns true if the node has a matrix set, false otherwise.
See set_matrix().
| resetBound | ( | NodePath const | rel_to | ) |
Recomputes the bounding volume.
This is normally called automatically, but it must occasionally be called explicitly when the curve has changed properties outside of this node's knowledge.
| setCurve | ( | NurbsCurveEvaluator | curve | ) |
Sets the particular curve represented by the RopeNode.
| setMatrix | ( | Mat4 const | matrix | ) |
Specifies an optional matrix which is used to transform each control vertex after it has been transformed into the RopeNode's coordinate space, but before the polygon vertices are generated.
| setNormalMode | ( | NormalMode | normal_mode | ) |
Specifies the kind of normals to generate for the rope.
This is only applicable when the RenderMode is set to RM_tube; in the other render modes, normals are never generated.
| setNumSlices | ( | int | num_slices | ) |
Specifies the number of radial subdivisions to make if RenderMode is RM_tube.
It is ignored in the other render modes.
Increasing this number increases the roundness of a cross-section of the tube. The minimum value for a dimensional tube is 3; setting it to 2 will get you a thin piece of tape (which is similar to RM_billboard, except it won't rotate to face the camera).
| setNumSubdiv | ( | int | num_subdiv | ) |
Specifies the number of subdivisions per cubic segment (that is, per unique knot value) to draw in a fixed uniform tesselation of the curve.
| setRenderMode | ( | RenderMode | render_mode | ) |
Specifies the method used to render the rope.
The simplest is RM_thread, which just draws a one-pixel line segment.
| setThickness | ( | float | thickness | ) |
Specifies the thickness of the rope, in pixels or in spatial units, depending on the render mode.
See set_render_mode().
The thickness may also be specified on a per-vertex basis. See set_use_vertex_thickness().
| setTubeUp | ( | Vec3 const | tube_up | ) |
Specifies a normal vector, generally perpendicular to the main axis of the starting point of the curve, that controls the "top" of the curve, when RenderMode is RM_tube.
This is used to orient the vertices that make up the tube. If this vector is too nearly parallel with the starting direction of the curve, there may be a tendency for the whole tube to gimble-lock around its primary axis.
| setUseVertexColor | ( | bool | flag | ) |
Sets the "use vertex color" flag.
When this is true, the R, G, B, A vertex color is assumed to be stored as the dimensions n + 0, n + 1, n + 2, n + 3, respectively, of the extended vertex values, where n is the value returned by get_vertex_color_dimension(). Use NurbsCurveEvaluator.set_extended_vertex() to set these values.
| setUseVertexThickness | ( | bool | flag | ) |
Sets the "use vertex thickness" flag.
When this is true, the vertex thickness is assumed to be stored as the dimension get_vertex_thickness_dimension(), of the extended vertex values. Use NurbsCurveEvaluator.set_extended_vertex() to set these values.
In this mode, the overall thickness is also applied as a scale to the vertex thickness. Not all render modes support vertex thickness.
| setUvDirection | ( | bool | u_dominant | ) |
Specify true to vary the U coordinate down the length of the rope, or false to vary the V coordinate.
| setUvMode | ( | UVMode | uv_mode | ) |
Specifies the algorithm to use to generate UV's for the rope.
| setUvScale | ( | float | scale | ) |
Specifies an additional scaling factor to apply to generated UV's along the rope.
This scale factor is applied in whichever direction is along the rope, as specified by set_uv_direction().
1.7.3