29NodePath(
const std::string &top_node_name,
Thread *current_thread) :
34 _head = top_node->get_generic_component(
false, pipeline_stage, current_thread);
49 if (
node !=
nullptr) {
51 _head =
node->get_generic_component(
false, pipeline_stage, current_thread);
64 if (
node !=
nullptr) {
66 result._head =
node->get_generic_component(
true, pipeline_stage,
78 _backup_key(copy._backup_key),
79 _error_type(copy._error_type)
89 _backup_key = copy._backup_key;
90 _error_type = copy._error_type;
98 _head(std::move(from._head)),
99 _backup_key(from._backup_key),
100 _error_type(from._error_type)
107INLINE
void NodePath::
108operator = (
NodePath &&from)
noexcept {
109 _head = std::move(from._head);
110 _backup_key = from._backup_key;
111 _error_type = from._error_type;
131 result._error_type = ET_not_found;
141 result._error_type = ET_removed;
151 result._error_type = ET_fail;
172 _max_search_depth = max_search_depth;
181 return _max_search_depth;
189 return (_head ==
nullptr);
198 return (_head !=
nullptr && _head->is_top_node(pipeline_stage, current_thread));
228 nassertr_always(!
is_empty(),
nullptr);
229 return _head->get_node();
249 return _head->get_key();
285 int a_count, b_count;
286 return (find_common_ancestor(*
this, other, a_count, b_count, current_thread) !=
nullptr);
295 int a_count, b_count;
296 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
303 return (a_count == 0);
313 int a_count, b_count;
314 NodePathComponent *common = find_common_ancestor(*
this, other, a_count, b_count, current_thread);
315 if (common ==
nullptr) {
320 result._head = common;
330 return _head->get_node()->get_num_children(current_thread);
341 child._head = PandaNode::get_component(_head, _head->get_node()->get_child(n, current_thread),
342 pipeline_stage, current_thread);
354 return _head->get_node()->count_num_descendants();
380 parent._head = _head->get_next(pipeline_stage, current_thread);
407ls(std::ostream &out,
int indent_level)
const {
411 node()->ls(out, indent_level);
436get_net_state(
Thread *current_thread)
const {
437 nassertr(_error_type == ET_ok, RenderState::make_empty());
438 return r_get_net_state(_head, current_thread);
446INLINE
void NodePath::
460 nassertr_always(!
is_empty(),
nullptr);
461 return node()->get_attrib(type);
470 nassertr_always(!
is_empty(),
false);
471 return node()->has_attrib(type);
482 node()->clear_attrib(type);
501 nassertr_always(!
is_empty(),
nullptr);
502 return node()->get_effect(type);
511 nassertr_always(!
is_empty(),
false);
512 return node()->has_effect(type);
540 nassertr_always(!
is_empty(), RenderEffects::make_empty());
541 return node()->get_effects();
550 node()->clear_effects();
558 set_transform(TransformState::make_identity(), current_thread);
577 set_transform(other, TransformState::make_identity(), current_thread);
584get_net_transform(
Thread *current_thread)
const {
585 nassertr(_error_type == ET_ok, TransformState::make_identity());
586 return r_get_net_transform(_head, current_thread);
594INLINE
void NodePath::
605get_net_prev_transform(
Thread *current_thread)
const {
606 nassertr(_error_type == ET_ok, TransformState::make_identity());
607 return r_get_net_prev_transform(_head, current_thread);
616INLINE
void NodePath::
617set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
618 set_pos(LPoint3(x, y, z));
631INLINE PN_stdfloat NodePath::
636INLINE PN_stdfloat NodePath::
641INLINE PN_stdfloat NodePath::
651set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
655INLINE PN_stdfloat NodePath::
660INLINE PN_stdfloat NodePath::
665INLINE PN_stdfloat NodePath::
676 set_scale(LVecBase3(scale, scale, scale));
680set_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
684INLINE PN_stdfloat NodePath::
689INLINE PN_stdfloat NodePath::
694INLINE PN_stdfloat NodePath::
704set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
708INLINE PN_stdfloat NodePath::
713INLINE PN_stdfloat NodePath::
718INLINE PN_stdfloat NodePath::
728set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
729 set_pos_hpr(LVecBase3(x, y, z), LVecBase3(h, p, r));
737set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
746set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
747 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
749 LVecBase3(sx, sy, sz));
758 node()->clear_transform();
767 nassertr_always(!
is_empty(),
false);
768 return !
node()->get_transform()->is_identity();
777 nassertr_always(!
is_empty(), LMatrix4::ident_mat());
779 return node()->get_transform()->get_mat();
789look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
798heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
806INLINE
void NodePath::
807set_pos(
const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
808 set_pos(other, LPoint3(x, y, z));
821INLINE PN_stdfloat NodePath::
826INLINE PN_stdfloat NodePath::
831INLINE PN_stdfloat NodePath::
840set_hpr(
const NodePath &other, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
841 set_hpr(other, LPoint3(h, p, r));
844INLINE PN_stdfloat NodePath::
849INLINE PN_stdfloat NodePath::
854INLINE PN_stdfloat NodePath::
864 set_scale(other, LPoint3(scale, scale, scale));
871set_scale(
const NodePath &other, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
879INLINE PN_stdfloat NodePath::
880get_sx(
const NodePath &other)
const {
884INLINE PN_stdfloat NodePath::
885get_sy(
const NodePath &other)
const {
889INLINE PN_stdfloat NodePath::
890get_sz(
const NodePath &other)
const {
898set_shear(
const NodePath &other, PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
899 set_shear(other, LPoint3(shxy, shxz, shyz));
906INLINE PN_stdfloat NodePath::
907get_shxy(
const NodePath &other)
const {
911INLINE PN_stdfloat NodePath::
912get_shxz(
const NodePath &other)
const {
916INLINE PN_stdfloat NodePath::
917get_shyz(
const NodePath &other)
const {
927 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
928 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
929 set_pos_hpr(other, LVecBase3(x, y, z), LVecBase3(h, p, r));
939 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
940 set_hpr_scale(other, LVecBase3(h, p, r), LVecBase3(sx, sy, sz));
949 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
950 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
951 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
953 LVecBase3(sx, sy, sz));
961look_at(
const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
962 look_at(other, LPoint3(x, y, z));
970heads_up(
const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
981 return length(LVector3(pos));
988set_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa,
int priority) {
996compose_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa,
int priority) {
1087INLINE
void NodePath::
1089 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1095INLINE
void NodePath::
1097 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1103INLINE
void NodePath::
1105 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1111INLINE
void NodePath::
1112set_shader_input(
CPT_InternalName id,
const PTA_LVecBase4 &v,
int priority) {
1113 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1119INLINE
void NodePath::
1120set_shader_input(
CPT_InternalName id,
const PTA_LVecBase3 &v,
int priority) {
1121 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1128INLINE
void NodePath::
1129set_shader_input(
CPT_InternalName id,
const PTA_LVecBase2 &v,
int priority) {
1130 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1136INLINE
void NodePath::
1138 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1144INLINE
void NodePath::
1146 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1152INLINE
void NodePath::
1154 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1160INLINE
void NodePath::
1161set_shader_input(
CPT_InternalName id,
const PTA_LVecBase4i &v,
int priority) {
1162 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1168INLINE
void NodePath::
1169set_shader_input(
CPT_InternalName id,
const PTA_LVecBase3i &v,
int priority) {
1170 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1177INLINE
void NodePath::
1178set_shader_input(
CPT_InternalName id,
const PTA_LVecBase2i &v,
int priority) {
1179 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1185INLINE
void NodePath::
1187 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1193INLINE
void NodePath::
1195 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1201INLINE
void NodePath::
1203 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1209INLINE
void NodePath::
1210set_shader_input(
CPT_InternalName id,
const PTA_LMatrix4 &v,
int priority) {
1211 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1217INLINE
void NodePath::
1218set_shader_input(
CPT_InternalName id,
const PTA_LMatrix3 &v,
int priority) {
1219 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1225INLINE
void NodePath::
1227 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1233INLINE
void NodePath::
1235 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1241INLINE
void NodePath::
1243 set_shader_input(
ShaderInput(std::move(
id), tex, priority));
1249INLINE
void NodePath::
1251 set_shader_input(
ShaderInput(std::move(
id), tex, sampler, priority));
1257INLINE
void NodePath::
1259 set_shader_input(
ShaderInput(std::move(
id), tex, read, write, z, n, priority));
1265INLINE
void NodePath::
1267 set_shader_input(
ShaderInput(std::move(
id), buf, priority));
1273INLINE
void NodePath::
1275 set_shader_input(
ShaderInput(std::move(
id), np, priority));
1281INLINE
void NodePath::
1282set_shader_input(
CPT_InternalName id,
int n1,
int n2,
int n3,
int n4,
int priority) {
1283 set_shader_input(
ShaderInput(std::move(
id), LVecBase4i(n1, n2, n3, n4), priority));
1289INLINE
void NodePath::
1290set_shader_input(
CPT_InternalName id, PN_stdfloat n1, PN_stdfloat n2, PN_stdfloat n3, PN_stdfloat n4,
int priority) {
1291 set_shader_input(
ShaderInput(std::move(
id), LVecBase4(n1, n2, n3, n4), priority));
1315 get_tex_transform(stage)->set_pos2d(uv));
1328 get_tex_transform(stage)->set_rotate2d(r));
1341 get_tex_transform(stage)->
set_scale(scale));
1365 get_tex_transform(stage)->set_scale2d(scale));
1376 nassertr_always(!
is_empty(), LVecBase2::zero());
1377 return get_tex_transform(stage)->get_pos2d();
1388 nassertr_always(!
is_empty(), 0.0f);
1389 return get_tex_transform(stage)->get_rotate2d();
1399 nassertr_always(!
is_empty(), LVecBase2(1.0f, 1.0f));
1400 return get_tex_transform(stage)->get_scale2d();
1424 get_tex_transform(stage)->set_pos(uvw));
1448 get_tex_transform(stage)->
set_hpr(hpr));
1472 get_tex_transform(stage)->
set_scale(scale));
1483 nassertr_always(!
is_empty(), LVecBase3::zero());
1484 return get_tex_transform(stage)->get_pos();
1495 nassertr_always(!
is_empty(), LVecBase3::zero());
1496 return get_tex_transform(stage)->get_hpr();
1507 nassertr_always(!
is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
1508 return get_tex_transform(stage)->get_scale();
1532 get_tex_transform(other, stage)->set_pos2d(uv));
1545 get_tex_transform(other, stage)->set_rotate2d(r));
1558 get_tex_transform(stage)->
set_scale(scale));
1582 get_tex_transform(stage)->set_scale2d(scale));
1593 nassertr_always(!
is_empty(), LVecBase2::zero());
1594 return get_tex_transform(other, stage)->get_pos2d();
1605 nassertr_always(!
is_empty(), 0.0f);
1606 return get_tex_transform(other, stage)->get_rotate2d();
1616 nassertr_always(!
is_empty(), LVecBase2(1.0f, 1.0f));
1617 return get_tex_transform(other, stage)->get_scale2d();
1641 get_tex_transform(stage)->set_pos(uvw));
1665 get_tex_transform(stage)->
set_hpr(hpr));
1689 get_tex_transform(stage)->
set_scale(scale));
1700 nassertr_always(!
is_empty(), LVecBase3::zero());
1701 return get_tex_transform(stage)->get_pos();
1712 nassertr_always(!
is_empty(), LVecBase3::zero());
1713 return get_tex_transform(stage)->get_hpr();
1724 nassertr_always(!
is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
1725 return get_tex_transform(stage)->get_scale();
1786 r_adjust_all_priorities(
node(), adjustment);
1811 camera_mask &=
~PandaNode::get_overall_bit();
1840 camera_mask &=
~PandaNode::get_overall_bit();
1869 camera_mask &=
~PandaNode::get_overall_bit();
1918 if (node_type == TypeHandle::none()) {
1919 node_type = PandaNode::get_class_type();
1922 r_set_collide_mask(
node(), ~bits_to_change, new_mask & bits_to_change,
1932 return _head == other._head;
1940 return _head != other._head;
1951 return _head < other._head;
1969 if (_head != other._head) {
1970 return _head < other._head ? -1 : 1;
1986 return r_clear_model_nodes(
node());
1999set_tag(
const std::string &key,
const std::string &value) {
2010get_tag(
const std::string &key)
const {
2014 return std::string();
2016 return node()->get_tag(key);
2037has_tag(
const std::string &key)
const {
2043 return node()->has_tag(key);
2094 node()->set_name(name);
2102 nassertr_always(!
is_empty(), std::string());
2103 return node()->get_name();
2124INLINE std::ostream &operator << (std::ostream &out,
const NodePath &node_path) {
static BitMask< uint32_t, nbits > all_off()
Returns a BitMask whose bits are all off.
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
This is one component of a NodePath.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void set_tex_hpr(TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets a texture matrix on the current node to apply the indicated rotation, as a 3-D HPR,...
void set_sa(PN_stdfloat sa)
Sets the alpha component of the color scale.
void set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
Sets the rotation and scale components of the transform, leaving translation untouched.
static void set_max_search_depth(int max_search_depth)
Certain operations, such as find() or find_all_matches(), require a traversal of the scene graph to s...
static NodePath any_path(PandaNode *node, Thread *current_thread=Thread::get_current_thread())
Returns a new NodePath that represents any arbitrary path from the root to the indicated node.
void compose_color_scale(const LVecBase4 &scale, int priority=0)
multiplies the color scale component of the transform, with previous color scale leaving translation ...
void set_sb(PN_stdfloat sb)
Sets the blue component of the color scale.
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
void list_tags() const
Lists the tags to the nout stream, one per line.
void clear_transform(Thread *current_thread=Thread::get_current_thread())
Sets the transform object on this node to identity.
bool is_same_graph(const NodePath &other, Thread *current_thread=Thread::get_current_thread()) const
Returns true if the node represented by this NodePath is parented within the same graph as that of th...
int get_num_children(Thread *current_thread=Thread::get_current_thread()) const
Returns the number of children of the referenced node.
int count_num_descendants() const
Returns the number of nodes at and below this level.
void clear_mat()
Completely removes any transform from the referenced node.
bool verify_complete(Thread *current_thread=Thread::get_current_thread()) const
Returns true if all of the nodes described in the NodePath are connected, or false otherwise.
void set_billboard_point_eye(PN_stdfloat offset=0.0, bool fixed_depth=false)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
bool operator<(const NodePath &other) const
Returns true if this NodePath sorts before the other one, false otherwise.
bool has_vertex_column(const InternalName *name) const
Returns true if there are at least some vertices at this node and below that contain a reference to t...
static NodePath not_found()
Creates a NodePath with the ET_not_found error type set.
static int get_max_search_depth()
Returns the current setting of the search depth limit.
void clear_tex_gen()
Removes the texture coordinate generation mode from all texture stages on this node.
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
size_t add_hash(size_t hash) const
Adds the NodePath into the running hash.
void set_sr(PN_stdfloat sr)
Sets the red component of the color scale.
void clear_effects()
Resets this node to have no render effects.
LVecBase3 get_hpr() const
Retrieves the rotation component of the transform.
PandaNode * get_top_node(Thread *current_thread=Thread::get_current_thread()) const
Returns the top node of the path, or NULL if the path is empty.
void output(std::ostream &out) const
Writes a sensible description of the NodePath to the indicated output stream.
LPoint3 get_pos() const
Retrieves the translation component of the transform.
void look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the transform on this NodePath so that it rotates to face the indicated point in space.
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras.
const RenderEffect * get_effect(TypeHandle type) const
Returns the render effect of the indicated type, if it is defined on the node, or NULL if it is not.
LVecBase3 get_shear() const
Retrieves the shear component of the transform.
set_name
Changes the name of the referenced node.
LVecBase3 get_scale() const
Retrieves the scale component of the transform.
bool has_effect(TypeHandle type) const
Returns true if there is a render effect of the indicated type defined on this node,...
get_net_tag
Returns the tag value that has been defined on this node, or the nearest ancestor node,...
NodePath get_common_ancestor(const NodePath &other, Thread *current_thread=Thread::get_current_thread()) const
Returns the lowest NodePath that both of these two NodePaths have in common: the first ancestor that ...
void adjust_all_priorities(int adjustment)
Adds the indicated adjustment amount (which may be negative) to the priority for all transitions on t...
void set_tex_transform(TextureStage *stage, const TransformState *transform)
Sets the texture matrix on the current node to the indicated transform for the given stage.
void set_sg(PN_stdfloat sg)
Sets the green component of the color scale.
void set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
Completely replaces the transform with new translation, rotation, and scale components.
PN_stdfloat get_sb() const
Gets the blue component of the color scale.
bool operator!=(const NodePath &other) const
Returns true if the two paths are not equivalent.
bool is_empty() const
Returns true if the NodePath contains no nodes.
void clear_tag(const std::string &key)
Removes the value defined for this key on this particular node.
PN_stdfloat get_tex_rotate(TextureStage *stage) const
Returns the rotation set for the UV's for the given stage on the current node.
LVecBase3 get_tex_pos(TextureStage *stage) const
Returns the offset set for the UVW's for the given stage on the current node.
void reverse_ls() const
Lists the hierarchy at and above the referenced node.
LVecBase2 get_tex_scale(TextureStage *stage) const
Returns the scale set for the UV's for the given stage on the current node.
get_error_type
If is_empty() is true, this returns a code that represents the reason why the NodePath is empty.
void set_fluid_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the translation component, without changing the "previous" position, so that the collision syste...
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
int clear_model_nodes()
Recursively walks through the scene graph at this level and below, looking for ModelNodes,...
void set_collide_mask(CollideMask new_mask, CollideMask bits_to_change=CollideMask::all_on(), TypeHandle node_type=TypeHandle::none())
Recursively applies the indicated CollideMask to the into_collide_masks for all nodes at this level a...
bool is_stashed() const
Returns true if the referenced node is stashed either directly, or because some ancestor is stashed.
bool is_ancestor_of(const NodePath &other, Thread *current_thread=Thread::get_current_thread()) const
Returns true if the node represented by this NodePath is a parent or other ancestor of the other Node...
PandaNode * node() const
Returns the referenced node of the path.
void clear_texture()
Completely removes any texture adjustment that may have been set via set_texture() or set_texture_off...
const LVecBase4 & get_color_scale() const
Returns the complete color scale vector that has been applied to this node via a previous call to set...
LVecBase2 get_tex_offset(TextureStage *stage) const
Returns the offset set for the UV's for the given stage on the current node.
NodePath()
This constructs an empty NodePath with no nodes.
PN_stdfloat get_distance(const NodePath &other) const
Returns the straight-line distance between this referenced node's coordinate frame's origin,...
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
CollideMask get_collide_mask() const
Returns the union of all of the into_collide_masks for nodes at this level and below.
void clear_attrib(TypeHandle type)
Removes the render attribute of the given type from this node.
void ls() const
Lists the hierarchy at and below the referenced node.
bool has_mat() const
Returns true if a non-identity transform matrix has been applied to the referenced node,...
int compare_to(const NodePath &other) const
Returns a number less than zero if this NodePath sorts before the other one, greater than zero if it ...
vector_uchar encode_to_bam_stream() const
Converts the NodePath object into a single stream of data using a BamWriter, and returns that data as...
NodePath get_child(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns a NodePath representing the nth child of the referenced node.
NodePath find_net_tag(const std::string &key) const
Returns the lowest ancestor of this node that contains a tag definition with the indicated key,...
bool operator==(const NodePath &other) const
Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the ...
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Changes the complete state object on this node.
bool is_singleton(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the NodePath contains exactly one node.
PN_stdfloat get_sr() const
Gets the red component of the color scale.
void heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Behaves like look_at(), but with a strong preference to keeping the up vector oriented in the indicat...
bool is_hidden(DrawMask camera_mask=PandaNode::get_overall_bit()) const
Returns true if the referenced node is hidden from the indicated camera(s) either directly,...
void set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz)
Sets the shear component of the transform, leaving translation, rotation, and scale untouched.
const RenderAttrib * get_attrib(TypeHandle type) const
Returns the render attribute of the indicated type, if it is defined on the node, or NULL if it is no...
NodePath get_top(Thread *current_thread=Thread::get_current_thread()) const
Returns a singleton NodePath that represents the top of the path, or empty NodePath if this path is e...
bool has_texcoord(const std::string &texcoord_name) const
Returns true if there are at least some vertices at this node and below that use the named texture co...
NodePath attach_new_node(PandaNode *node, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Attaches a new node, with or without existing parents, to the scene graph below the referenced node o...
has_parent
Returns true if the referenced node has a parent; i.e.
void set_billboard_axis(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in two dimensions around the up axis...
get_parent
Returns the NodePath to the parent of the referenced node: that is, this NodePath,...
void set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the translation and rotation component of the transform, leaving scale untouched.
LVecBase3 get_tex_hpr(TextureStage *stage) const
Returns the 3-D HPR set for the UVW's for the given stage on the current node.
void set_tex_pos(TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w)
Sets a texture matrix on the current node to apply the indicated offset to UVW's for the given stage.
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
void set_tex_offset(TextureStage *stage, PN_stdfloat u, PN_stdfloat v)
Sets a texture matrix on the current node to apply the indicated offset to UV's for the given stage.
PN_stdfloat get_sg() const
Gets the green component of the color scale.
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
static NodePath removed()
Creates a NodePath with the ET_removed error type set.
void clear_project_texture(TextureStage *stage)
Undoes the effect of project_texture().
void clear_tex_projector()
Removes the TexProjectorEffect for all stages from this node.
get_name
Returns the name of the referenced node.
void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the rotation component of the transform, leaving translation and scale untouched.
bool has_tag(const std::string &key) const
Returns true if a value has been defined on this node for the particular key (even if that value is t...
void set_billboard_point_world(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
LVecBase3 get_tex_scale_3d(TextureStage *stage) const
Returns the scale set for the UVW's for the given stage on the current node.
void set_tex_scale(TextureStage *stage, PN_stdfloat scale)
Sets a texture matrix on the current node to apply the indicated scale to UVW's for the given stage.
const RenderEffects * get_effects() const
Returns the complete RenderEffects that will be applied to this node.
has_net_tag
Returns true if the indicated tag value has been defined on this node or on any ancestor node,...
bool has_attrib(TypeHandle type) const
Returns true if there is a render attribute of the indicated type defined on this node,...
int get_key() const
Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node i...
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
void clear()
Sets this NodePath to the empty NodePath.
void set_tex_rotate(TextureStage *stage, PN_stdfloat r)
Sets a texture matrix on the current node to apply the indicated rotation, clockwise in degrees,...
void set_color_scale(const LVecBase4 &scale, int priority=0)
Sets the color scale component of the transform, leaving translation and rotation untouched.
void set_effects(const RenderEffects *effects)
Sets the complete RenderEffects that will be applied this node.
PN_stdfloat get_sa() const
Gets the alpha component of the color scale.
NodePath get_stashed_ancestor(Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is stashed, or an empty NodePath if no ance...
NodePath get_hidden_ancestor(DrawMask camera_mask=PandaNode::get_overall_bit(), Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is hidden to the indicated camera(s),...
void set_tag(const std::string &key, const std::string &value)
Associates a user-defined value with a user-defined key which is stored on the node.
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
void show_through()
Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.
std::string get_tag(const std::string &key) const
Retrieves the user-defined value that was previously set on this node for the particular key,...
A basic node of the scene graph or data graph.
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
set_tag
Associates a user-defined value with a user-defined key which is stored on the node.
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
CollideMask get_net_collide_mask(Thread *current_thread=Thread::get_current_thread()) const
Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below.
set_effects
Sets the complete RenderEffects that will be applied this node.
void adjust_draw_mask(DrawMask show_mask, DrawMask hide_mask, DrawMask clear_mask)
Adjusts the hide/show bits of this particular node.
set_state
Sets the complete RenderState that will be applied to all nodes at this level and below.
set_transform
Sets the transform that will be applied to this node and below.
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
void list_tags(std::ostream &out, const std::string &separator="\n") const
Writes a list of all the tag keys assigned to the node to the indicated stream.
clear_tag
Removes the value defined for this key on this particular node.
void set_prev_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Sets the transform that represents this node's "previous" position, one frame ago,...
void set_attrib(const RenderAttrib *attrib, int override=0)
Adds the indicated render attribute to the scene graph on this node.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Represents a set of settings that indicate how a texture is sampled.
This is a generic buffer object that lives in graphics memory.
Defines the properties of a named stage of the multitexture pipeline.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
A thread; that is, a lightweight process.
get_pipeline_stage
Returns the Pipeline stage number associated with this thread.
TypeHandle is the identifier used to differentiate C++ class types.
static size_t add_hash(size_t start, const void *key)
Adds the indicated key into a running hash.