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)
86 INLINE
void NodePath::
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)
107 INLINE
void NodePath::
108 operator = (
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));
205 INLINE NodePath::ErrorType NodePath::
206 get_error_type()
const {
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);
407 ls(std::ostream &out,
int indent_level)
const {
411 node()->ls(out, indent_level);
436 get_net_state(
Thread *current_thread)
const {
437 nassertr(_error_type == ET_ok, RenderState::make_empty());
438 return r_get_net_state(_head, current_thread);
446 INLINE
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);
584 get_net_transform(
Thread *current_thread)
const {
585 nassertr(_error_type == ET_ok, TransformState::make_identity());
586 return r_get_net_transform(_head, current_thread);
594 INLINE
void NodePath::
605 get_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);
616 INLINE
void NodePath::
617 set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
618 set_pos(LPoint3(x, y, z));
631 INLINE PN_stdfloat NodePath::
636 INLINE PN_stdfloat NodePath::
641 INLINE PN_stdfloat NodePath::
651 set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
655 INLINE PN_stdfloat NodePath::
660 INLINE PN_stdfloat NodePath::
665 INLINE PN_stdfloat NodePath::
676 set_scale(LVecBase3(scale, scale, scale));
680 set_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
684 INLINE PN_stdfloat NodePath::
689 INLINE PN_stdfloat NodePath::
694 INLINE PN_stdfloat NodePath::
704 set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
708 INLINE PN_stdfloat NodePath::
713 INLINE PN_stdfloat NodePath::
718 INLINE PN_stdfloat NodePath::
728 set_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));
737 set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
746 set_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();
789 look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
798 heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
806 INLINE
void NodePath::
807 set_pos(
const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
808 set_pos(other, LPoint3(x, y, z));
821 INLINE PN_stdfloat NodePath::
822 get_x(
const NodePath &other)
const {
826 INLINE PN_stdfloat NodePath::
827 get_y(
const NodePath &other)
const {
831 INLINE PN_stdfloat NodePath::
832 get_z(
const NodePath &other)
const {
841 set_hpr(other, LPoint3(h, p, r));
844 INLINE PN_stdfloat NodePath::
845 get_h(
const NodePath &other)
const {
849 INLINE PN_stdfloat NodePath::
850 get_p(
const NodePath &other)
const {
854 INLINE PN_stdfloat NodePath::
855 get_r(
const NodePath &other)
const {
864 set_scale(other, LPoint3(scale, scale, scale));
879 INLINE PN_stdfloat NodePath::
884 INLINE PN_stdfloat NodePath::
885 get_sy(
const NodePath &other)
const {
889 INLINE PN_stdfloat NodePath::
890 get_sz(
const NodePath &other)
const {
899 set_shear(other, LPoint3(shxy, shxz, shyz));
906 INLINE PN_stdfloat NodePath::
911 INLINE PN_stdfloat NodePath::
912 get_shxz(
const NodePath &other)
const {
916 INLINE PN_stdfloat NodePath::
917 get_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));
962 look_at(other, LPoint3(x, y, z));
981 return length(LVector3(pos));
988 set_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa,
int priority) {
1079 INLINE
void NodePath::
1081 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1087 INLINE
void NodePath::
1089 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1095 INLINE
void NodePath::
1097 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1103 INLINE
void NodePath::
1104 set_shader_input(
CPT_InternalName id,
const PTA_LVecBase4 &v,
int priority) {
1105 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1111 INLINE
void NodePath::
1112 set_shader_input(
CPT_InternalName id,
const PTA_LVecBase3 &v,
int priority) {
1113 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1120 INLINE
void NodePath::
1121 set_shader_input(
CPT_InternalName id,
const PTA_LVecBase2 &v,
int priority) {
1122 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1128 INLINE
void NodePath::
1130 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1136 INLINE
void NodePath::
1138 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1144 INLINE
void NodePath::
1146 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1152 INLINE
void NodePath::
1153 set_shader_input(
CPT_InternalName id,
const PTA_LVecBase4i &v,
int priority) {
1154 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1160 INLINE
void NodePath::
1161 set_shader_input(
CPT_InternalName id,
const PTA_LVecBase3i &v,
int priority) {
1162 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1169 INLINE
void NodePath::
1170 set_shader_input(
CPT_InternalName id,
const PTA_LVecBase2i &v,
int priority) {
1171 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1177 INLINE
void NodePath::
1179 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1185 INLINE
void NodePath::
1187 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1193 INLINE
void NodePath::
1195 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1201 INLINE
void NodePath::
1202 set_shader_input(
CPT_InternalName id,
const PTA_LMatrix4 &v,
int priority) {
1203 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1209 INLINE
void NodePath::
1210 set_shader_input(
CPT_InternalName id,
const PTA_LMatrix3 &v,
int priority) {
1211 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1217 INLINE
void NodePath::
1219 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1225 INLINE
void NodePath::
1227 set_shader_input(
ShaderInput(std::move(
id), v, priority));
1233 INLINE
void NodePath::
1235 set_shader_input(
ShaderInput(std::move(
id), tex, priority));
1241 INLINE
void NodePath::
1243 set_shader_input(
ShaderInput(std::move(
id), tex, sampler, priority));
1249 INLINE
void NodePath::
1251 set_shader_input(
ShaderInput(std::move(
id), tex, read, write, z, n, priority));
1257 INLINE
void NodePath::
1259 set_shader_input(
ShaderInput(std::move(
id), buf, priority));
1265 INLINE
void NodePath::
1267 set_shader_input(
ShaderInput(std::move(
id), np, priority));
1273 INLINE
void NodePath::
1274 set_shader_input(
CPT_InternalName id,
int n1,
int n2,
int n3,
int n4,
int priority) {
1275 set_shader_input(
ShaderInput(std::move(
id), LVecBase4i(n1, n2, n3, n4), priority));
1281 INLINE
void NodePath::
1282 set_shader_input(
CPT_InternalName id, PN_stdfloat n1, PN_stdfloat n2, PN_stdfloat n3, PN_stdfloat n4,
int priority) {
1283 set_shader_input(
ShaderInput(std::move(
id), LVecBase4(n1, n2, n3, n4), priority));
1307 get_tex_transform(stage)->set_pos2d(uv));
1320 get_tex_transform(stage)->set_rotate2d(r));
1333 get_tex_transform(stage)->
set_scale(scale));
1357 get_tex_transform(stage)->set_scale2d(scale));
1368 nassertr_always(!
is_empty(), LVecBase2::zero());
1369 return get_tex_transform(stage)->get_pos2d();
1380 nassertr_always(!
is_empty(), 0.0f);
1381 return get_tex_transform(stage)->get_rotate2d();
1391 nassertr_always(!
is_empty(), LVecBase2(1.0f, 1.0f));
1392 return get_tex_transform(stage)->get_scale2d();
1416 get_tex_transform(stage)->set_pos(uvw));
1440 get_tex_transform(stage)->
set_hpr(hpr));
1464 get_tex_transform(stage)->
set_scale(scale));
1475 nassertr_always(!
is_empty(), LVecBase3::zero());
1476 return get_tex_transform(stage)->get_pos();
1487 nassertr_always(!
is_empty(), LVecBase3::zero());
1488 return get_tex_transform(stage)->get_hpr();
1499 nassertr_always(!
is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
1500 return get_tex_transform(stage)->get_scale();
1524 get_tex_transform(other, stage)->set_pos2d(uv));
1537 get_tex_transform(other, stage)->set_rotate2d(r));
1550 get_tex_transform(stage)->
set_scale(scale));
1574 get_tex_transform(stage)->set_scale2d(scale));
1585 nassertr_always(!
is_empty(), LVecBase2::zero());
1586 return get_tex_transform(other, stage)->get_pos2d();
1597 nassertr_always(!
is_empty(), 0.0f);
1598 return get_tex_transform(other, stage)->get_rotate2d();
1608 nassertr_always(!
is_empty(), LVecBase2(1.0f, 1.0f));
1609 return get_tex_transform(other, stage)->get_scale2d();
1633 get_tex_transform(stage)->set_pos(uvw));
1657 get_tex_transform(stage)->
set_hpr(hpr));
1681 get_tex_transform(stage)->
set_scale(scale));
1692 nassertr_always(!
is_empty(), LVecBase3::zero());
1693 return get_tex_transform(stage)->get_pos();
1704 nassertr_always(!
is_empty(), LVecBase3::zero());
1705 return get_tex_transform(stage)->get_hpr();
1716 nassertr_always(!
is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
1717 return get_tex_transform(stage)->get_scale();
1778 r_adjust_all_priorities(
node(), adjustment);
1803 camera_mask &= ~
PandaNode::get_overall_bit();
1832 camera_mask &= ~
PandaNode::get_overall_bit();
1859 camera_mask &= ~
PandaNode::get_overall_bit();
1908 if (node_type == TypeHandle::none()) {
1909 node_type = PandaNode::get_class_type();
1912 r_set_collide_mask(
node(), ~bits_to_change, new_mask & bits_to_change,
1922 return _head == other._head;
1930 return _head != other._head;
1941 return _head < other._head;
1959 if (_head != other._head) {
1960 return _head < other._head ? -1 : 1;
1976 return r_clear_model_nodes(
node());
1989 set_tag(
const std::string &key,
const std::string &value) {
2004 return std::string();
2006 return node()->get_tag(key);
2033 return node()->has_tag(key);
2082 set_name(
const std::string &name) {
2084 node()->set_name(name);
2090 INLINE std::string NodePath::
2092 nassertr_always(!
is_empty(), std::string());
2093 return node()->get_name();
2114 INLINE std::ostream &operator << (std::ostream &out,
const NodePath &node_path) {
int get_num_children(Thread *current_thread=Thread::get_current_thread()) const
Returns the number of children of the referenced node.
clear_tag
Removes the value defined for this key on this particular node.
A basic node of the scene graph or data graph.
void adjust_all_priorities(int adjustment)
Adds the indicated adjustment amount (which may be negative) to the priority for all transitions on t...
static size_t add_hash(size_t start, const void *key)
Adds the indicated key into a running hash.
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...
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,...
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
set_name
Changes the name of the referenced node.
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.
void show_through()
Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.
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...
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...
get_net_tag
Returns the tag value that has been defined on this node, or the nearest ancestor node,...
This is a generic buffer object that lives in graphics memory.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
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.
bool operator !=(const NodePath &other) const
Returns true if the two paths are not equivalent.
NodePath()
This constructs an empty NodePath with no nodes.
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...
set_state
Sets the complete RenderState that will be applied to all nodes at this level and below.
bool is_empty() const
Returns true if the NodePath contains no nodes.
PN_stdfloat get_sb() const
Gets the blue scale component of the transform.
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.
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...
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...
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
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 ...
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
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...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
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 clear_tex_gen()
Removes the texture coordinate generation mode from all texture stages on this node.
PN_stdfloat get_distance(const NodePath &other) const
Returns the straight-line distance between this referenced node's coordinate frame's origin,...
PN_stdfloat get_tex_rotate(TextureStage *stage) const
Returns the rotation set for the UV's for the given stage on the current node.
has_net_tag
Returns true if the indicated tag value has been defined on this node or on any ancestor node,...
const RenderEffects * get_effects() const
Returns the complete RenderEffects that will be applied to this 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 ...
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 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 compose_color_scale(const LVecBase4 &scale, int priority=0)
multiplies the color scale component of the transform, with previous color scale leaving translation ...
get_parent
Returns the NodePath to the parent of the referenced node: that is, this NodePath,...
void adjust_draw_mask(DrawMask show_mask, DrawMask hide_mask, DrawMask clear_mask)
Adjusts the hide/show bits of this particular node.
int clear_model_nodes()
Recursively walks through the scene graph at this level and below, looking for ModelNodes,...
static BitMask< uint32_t, nbits > all_off()
Returns a BitMask whose bits are all off.
This is the base class for a number of special render effects that may be set on scene graph nodes to...
PN_stdfloat get_sg() const
Gets the green scale component of the transform.
get_pipeline_stage
Returns the Pipeline stage number associated with this thread.
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
void clear_transform(Thread *current_thread=Thread::get_current_thread())
Sets the transform object on this node to identity.
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.
bool has_mat() const
Returns true if a non-identity transform matrix has been applied to the referenced node,...
void reverse_ls() const
Lists the hierarchy at and above the referenced node.
void clear_effects()
Resets this node to have no render effects.
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
set_tag
Associates a user-defined value with a user-defined key which is stored on the node.
PandaNode * node() const
Returns the node traversed to so far.
void set_effects(const RenderEffects *effects)
Sets the complete RenderEffects that will be applied this node.
set_transform
Sets the transform that will be applied to this node and below.
bool is_stashed() const
Returns true if the referenced node is stashed either directly, or because some ancestor is stashed.
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.
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...
int count_num_descendants() const
Returns the number of nodes at and below this level.
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 ...
int get_key() const
Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node i...
PN_stdfloat get_sr() const
Gets the red scale component of the transform.
CollideMask get_collide_mask() const
Returns the union of all of the into_collide_masks for nodes at this level and below.
void output(std::ostream &out) const
Writes a sensible description of the NodePath to the indicated output stream.
void set_sr(PN_stdfloat sr)
Sets the red scale component of the transform.
LVecBase3 get_tex_scale_3d(TextureStage *stage) const
Returns the scale set for the UVW's for the given stage on the current node.
bool operator<(const NodePath &other) const
Returns true if this NodePath sorts before the other one, false otherwise.
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 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...
void list_tags() const
Lists the tags to the nout stream, one per line.
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
LVecBase2 get_tex_offset(TextureStage *stage) const
Returns the offset set for the UV's for the given stage on the current node.
static int get_max_search_depth()
Returns the current setting of the search depth limit.
set_effects
Sets the complete RenderEffects that will be applied this node.
bool has_effect(TypeHandle type) const
Returns true if there is a render effect of the indicated type defined on this node,...
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...
LVecBase3 get_tex_pos(TextureStage *stage) const
Returns the offset set for the UVW's for the given stage on the current node.
void clear_project_texture(TextureStage *stage)
Undoes the effect of project_texture().
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.
bool is_singleton(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the NodePath contains exactly one node.
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...
PN_stdfloat get_sa() const
Gets the alpha scale component of the transform.
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.
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...
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,...
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
LVecBase3 get_hpr() const
Retrieves the rotation component of the transform.
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...
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on 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.
void clear_texture()
Completely removes any texture adjustment that may have been set via set_texture() or set_texture_off...
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 clear()
Sets this NodePath to the empty NodePath.
LPoint3 get_pos() const
Retrieves the translation component of the transform.
void set_attrib(const RenderAttrib *attrib, int override=0)
Adds the indicated render attribute to the scene graph on this node.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
static NodePath removed()
Creates a NodePath with the ET_removed error type set.
Represents a set of settings that indicate how a texture is sampled.
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...
CPT(RenderState) NodePath
Returns the net state on this node from the root.
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...
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.
static NodePath not_found()
Creates a NodePath with the ET_not_found error type set.
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_attrib(TypeHandle type) const
Returns true if there is a render attribute of the indicated type defined on this node,...
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,...
PandaNode * node() const
Returns the referenced node of the path.
void clear_attrib(TypeHandle type)
Removes the render attribute of the given type from this node.
void set_sa(PN_stdfloat sa)
Sets the alpha scale component of the transform.
A thread; that is, a lightweight process.
void set_sb(PN_stdfloat sb)
Sets the blue scale component of the transform.
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
LVecBase3 get_scale() const
Retrieves the scale component of the transform.
LVecBase2 get_tex_scale(TextureStage *stage) const
Returns the scale set for the UV's for the given stage on the current node.
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...
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.
void clear_mat()
Completely removes any transform from the referenced node.
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
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.
size_t add_hash(size_t hash) const
Adds the NodePath into the running hash.
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
void set_sg(PN_stdfloat sg)
Sets the alpha scale component of the transform.
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,...
TypeHandle is the identifier used to differentiate C++ class types.
has_parent
Returns true if the referenced node has a parent; i.e.
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.
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras.
void ls() const
Lists the hierarchy at and below the referenced node.
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,...
Defines the properties of a named stage of the multitexture pipeline.
LVecBase3 get_shear() const
Retrieves the shear component of the transform.
void clear_tag(const std::string &key)
Removes the value defined for this key on this particular node.
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,...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Changes the complete state object on this node.
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
NodePath get_child(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns a NodePath representing the nth child of the referenced node.
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 clear_tex_projector()
Removes the TexProjectorEffect for all stages from this node.
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_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...
This is one component of a NodePath.
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.