RopeNode

from panda3d.core import RopeNode
class RopeNode

Bases: PandaNode

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.

Inheritance diagram

Inheritance diagram of RopeNode

NMNone = 0
NMVertex = 1
NM_none = 0
NM_vertex = 1
RMBillboard = 2
RMTape = 1
RMThread = 0
RMTube = 3
RM_billboard = 2
RM_tape = 1
RM_thread = 0
RM_tube = 3
UVDistance = 2
UVDistance2 = 3
UVNone = 0
UVParametric = 1
UV_distance = 2
UV_distance2 = 3
UV_none = 0
UV_parametric = 1
__init__(*args, **kwargs)
clearMatrix()

C++ Interface: clear_matrix(const RopeNode self)

/**
  • Resets the node’s matrix to identity. See set_matrix().

*/

clear_matrix()

C++ Interface: clear_matrix(const RopeNode self)

/**
  • Resets the node’s matrix to identity. See set_matrix().

*/

curve
getClassType()

C++ Interface: get_class_type()

getCurve()

C++ Interface: get_curve(RopeNode self)

/**
  • Returns the curve represented by the RopeNode.

*/

getMatrix()

C++ Interface: get_matrix(RopeNode self)

/**
  • 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.

*/

getNormalMode()

C++ Interface: get_normal_mode(RopeNode self)

/**
  • Returns the kind of normals to generate for the rope. This is only

  • applicable when the RenderMode is set to RM_tube.

*/

getNumSlices()

C++ Interface: get_num_slices(RopeNode self)

/**
  • 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().

*/

getNumSubdiv()

C++ Interface: get_num_subdiv(RopeNode self)

/**
  • Returns the number of subdivisions per cubic segment to draw. See

  • set_num_subdiv().

*/

getRenderMode()

C++ Interface: get_render_mode(RopeNode self)

/**
  • Returns the method used to render the rope. See set_render_mode().

*/

getThickness()

C++ Interface: get_thickness(RopeNode self)

/**
  • Returns the thickness of the rope. See set_thickness().

*/

getTubeUp()

C++ Interface: get_tube_up(RopeNode self)

/**
  • Returns the normal vector used to control the “top” of the curve, when

  • RenderMode is RM_tube. See set_tube_up().

*/

getUseVertexColor()

C++ Interface: get_use_vertex_color(RopeNode self)

/**
  • Returns the “use vertex color” flag. See set_use_vertex_color().

*/

getUseVertexThickness()

C++ Interface: get_use_vertex_thickness(RopeNode self)

/**
  • Returns the “use vertex thickness” flag. See set_use_vertex_thickness().

*/

getUvDirection()

C++ Interface: get_uv_direction(RopeNode self)

/**
  • Returns true if the rope runs down the U coordinate of the texture, or

  • false if it runs down the V coordinate.

*/

getUvMode()

C++ Interface: get_uv_mode(RopeNode self)

/**
  • Returns the algorithm to use to generate UV’s for the rope.

*/

getUvScale()

C++ Interface: get_uv_scale(RopeNode self)

/**
  • Returns the scaling factor to apply to generated UV’s for the rope.

*/

getVertexColorDimension()

C++ Interface: get_vertex_color_dimension()

/**
  • 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).

*/

getVertexThicknessDimension()

C++ Interface: get_vertex_thickness_dimension()

/**
  • Returns the numeric extended dimension in which the thickness component

  • should be found. See NurbsCurveEvaluator::set_extended_vertex().

*/

get_class_type()

C++ Interface: get_class_type()

get_curve()

C++ Interface: get_curve(RopeNode self)

/**
  • Returns the curve represented by the RopeNode.

*/

get_matrix()

C++ Interface: get_matrix(RopeNode self)

/**
  • 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.

*/

get_normal_mode()

C++ Interface: get_normal_mode(RopeNode self)

/**
  • Returns the kind of normals to generate for the rope. This is only

  • applicable when the RenderMode is set to RM_tube.

*/

get_num_slices()

C++ Interface: get_num_slices(RopeNode self)

/**
  • 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().

*/

get_num_subdiv()

C++ Interface: get_num_subdiv(RopeNode self)

/**
  • Returns the number of subdivisions per cubic segment to draw. See

  • set_num_subdiv().

*/

get_render_mode()

C++ Interface: get_render_mode(RopeNode self)

/**
  • Returns the method used to render the rope. See set_render_mode().

*/

get_thickness()

C++ Interface: get_thickness(RopeNode self)

/**
  • Returns the thickness of the rope. See set_thickness().

*/

get_tube_up()

C++ Interface: get_tube_up(RopeNode self)

/**
  • Returns the normal vector used to control the “top” of the curve, when

  • RenderMode is RM_tube. See set_tube_up().

*/

get_use_vertex_color()

C++ Interface: get_use_vertex_color(RopeNode self)

/**
  • Returns the “use vertex color” flag. See set_use_vertex_color().

*/

get_use_vertex_thickness()

C++ Interface: get_use_vertex_thickness(RopeNode self)

/**
  • Returns the “use vertex thickness” flag. See set_use_vertex_thickness().

*/

get_uv_direction()

C++ Interface: get_uv_direction(RopeNode self)

/**
  • Returns true if the rope runs down the U coordinate of the texture, or

  • false if it runs down the V coordinate.

*/

get_uv_mode()

C++ Interface: get_uv_mode(RopeNode self)

/**
  • Returns the algorithm to use to generate UV’s for the rope.

*/

get_uv_scale()

C++ Interface: get_uv_scale(RopeNode self)

/**
  • Returns the scaling factor to apply to generated UV’s for the rope.

*/

get_vertex_color_dimension()

C++ Interface: get_vertex_color_dimension()

/**
  • 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).

*/

get_vertex_thickness_dimension()

C++ Interface: get_vertex_thickness_dimension()

/**
  • Returns the numeric extended dimension in which the thickness component

  • should be found. See NurbsCurveEvaluator::set_extended_vertex().

*/

hasMatrix()

C++ Interface: has_matrix(RopeNode self)

/**
  • Returns true if the node has a matrix set, false otherwise. See

  • set_matrix().

*/

has_matrix()

C++ Interface: has_matrix(RopeNode self)

/**
  • Returns true if the node has a matrix set, false otherwise. See

  • set_matrix().

*/

matrix
normal_mode
num_slices
num_subdiv
render_mode
resetBound()

C++ Interface: reset_bound(const RopeNode self, const NodePath 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.

*/

reset_bound()

C++ Interface: reset_bound(const RopeNode self, const NodePath 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()

C++ Interface: set_curve(const RopeNode self, NurbsCurveEvaluator curve)

/**
  • Sets the particular curve represented by the RopeNode.

*/

setMatrix()

C++ Interface: set_matrix(const RopeNode self, const LMatrix4f 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()

C++ Interface: set_normal_mode(const RopeNode self, int 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()

C++ Interface: set_num_slices(const RopeNode self, 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()

C++ Interface: set_num_subdiv(const RopeNode self, 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()

C++ Interface: set_render_mode(const RopeNode self, int render_mode)

/**
  • Specifies the method used to render the rope. The simplest is RM_thread,

  • which just draws a one-pixel line segment.

*/

setThickness()

C++ Interface: set_thickness(const RopeNode self, 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()

C++ Interface: set_tube_up(const RopeNode self, const LVector3f 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()

C++ Interface: set_use_vertex_color(const RopeNode self, 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()

C++ Interface: set_use_vertex_thickness(const RopeNode self, 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()

C++ Interface: set_uv_direction(const RopeNode self, bool u_dominant)

/**
  • Specify true to vary the U coordinate down the length of the rope, or false

  • to vary the V coordinate.

*/

setUvMode()

C++ Interface: set_uv_mode(const RopeNode self, int uv_mode)

/**
  • Specifies the algorithm to use to generate UV’s for the rope.

*/

setUvScale()

C++ Interface: set_uv_scale(const RopeNode self, 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().

*/

set_curve()

C++ Interface: set_curve(const RopeNode self, NurbsCurveEvaluator curve)

/**
  • Sets the particular curve represented by the RopeNode.

*/

set_matrix()

C++ Interface: set_matrix(const RopeNode self, const LMatrix4f 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.

*/

set_normal_mode()

C++ Interface: set_normal_mode(const RopeNode self, int 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.

*/

set_num_slices()

C++ Interface: set_num_slices(const RopeNode self, 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).

*/

set_num_subdiv()

C++ Interface: set_num_subdiv(const RopeNode self, 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.

*/

set_render_mode()

C++ Interface: set_render_mode(const RopeNode self, int render_mode)

/**
  • Specifies the method used to render the rope. The simplest is RM_thread,

  • which just draws a one-pixel line segment.

*/

set_thickness()

C++ Interface: set_thickness(const RopeNode self, 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().

*/

set_tube_up()

C++ Interface: set_tube_up(const RopeNode self, const LVector3f 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.

*/

set_use_vertex_color()

C++ Interface: set_use_vertex_color(const RopeNode self, 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.

*/

set_use_vertex_thickness()

C++ Interface: set_use_vertex_thickness(const RopeNode self, 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.

*/

set_uv_direction()

C++ Interface: set_uv_direction(const RopeNode self, bool u_dominant)

/**
  • Specify true to vary the U coordinate down the length of the rope, or false

  • to vary the V coordinate.

*/

set_uv_mode()

C++ Interface: set_uv_mode(const RopeNode self, int uv_mode)

/**
  • Specifies the algorithm to use to generate UV’s for the rope.

*/

set_uv_scale()

C++ Interface: set_uv_scale(const RopeNode self, 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().

*/

thickness
tube_up
use_vertex_color
use_vertex_thickness
uv_direction
uv_mode
uv_scale
vertex_color_dimension = 0
vertex_thickness_dimension = 4