Panda3D
nodePath.I
1 // Filename: nodePath.I
2 // Created by: drose (25Feb02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: NodePath::Default Constructor
18 // Access: Published
19 // Description: This constructs an empty NodePath with no nodes.
20 ////////////////////////////////////////////////////////////////////
21 INLINE NodePath::
23  _error_type(ET_ok)
24 {
25  _backup_key = 0;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: NodePath::Constructor
30 // Access: Published
31 // Description: This constructs a new NodePath with a single
32 // node. An ordinary, unattached PandaNode is created
33 // with the indicated name.
34 ////////////////////////////////////////////////////////////////////
35 INLINE NodePath::
36 NodePath(const string &top_node_name, Thread *current_thread) :
37  _error_type(ET_ok)
38 {
39  PandaNode *top_node = new PandaNode(top_node_name);
40  int pipeline_stage = current_thread->get_pipeline_stage();
41  _head = top_node->get_generic_component(false, pipeline_stage, current_thread);
42  _backup_key = 0;
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: NodePath::Constructor
47 // Access: Published
48 // Description: This constructs a NodePath for the indicated node.
49 // If the node does not have any parents, this creates a
50 // singleton NodePath; otherwise, it automatically finds
51 // the path from the node to the root. If the node has
52 // multiple paths to the root, one path is chosen
53 // arbitrarily and a warning message is printed (but see
54 // also NodePath::any_path(), below).
55 ////////////////////////////////////////////////////////////////////
56 INLINE NodePath::
57 NodePath(PandaNode *node, Thread *current_thread) :
58  _error_type(ET_ok)
59 {
60  if (node != (PandaNode *)NULL) {
61  int pipeline_stage = current_thread->get_pipeline_stage();
62  _head = node->get_generic_component(false, pipeline_stage, current_thread);
63  }
64  _backup_key = 0;
65 }
66 
67 ////////////////////////////////////////////////////////////////////
68 // Function: NodePath::any_path named constructor
69 // Access: Published, Static
70 // Description: Returns a new NodePath that represents any arbitrary
71 // path from the root to the indicated node. This is
72 // the same thing that would be returned by
73 // NodePath(node), except that no warning is issued if
74 // the path is ambiguous.
75 ////////////////////////////////////////////////////////////////////
76 INLINE NodePath NodePath::
77 any_path(PandaNode *node, Thread *current_thread) {
78  NodePath result;
79  if (node != (PandaNode *)NULL) {
80  int pipeline_stage = current_thread->get_pipeline_stage();
81  result._head = node->get_generic_component(true, pipeline_stage,
82  current_thread);
83  }
84  return result;
85 }
86 
87 ////////////////////////////////////////////////////////////////////
88 // Function: NodePath::Copy Constructor
89 // Access: Published
90 // Description:
91 ////////////////////////////////////////////////////////////////////
92 INLINE NodePath::
93 NodePath(const NodePath &copy) :
94  _head(copy._head),
95  _backup_key(copy._backup_key),
96  _error_type(copy._error_type)
97 {
98 }
99 
100 ////////////////////////////////////////////////////////////////////
101 // Function: NodePath::Copy Assignment Operator
102 // Access: Published
103 // Description:
104 ////////////////////////////////////////////////////////////////////
105 INLINE void NodePath::
106 operator = (const NodePath &copy) {
107  _head = copy._head;
108  _backup_key = copy._backup_key;
109  _error_type = copy._error_type;
110 }
111 
112 #ifdef USE_MOVE_SEMANTICS
113 ////////////////////////////////////////////////////////////////////
114 // Function: NodePath::Move Constructor
115 // Access: Published
116 // Description:
117 ////////////////////////////////////////////////////////////////////
118 INLINE NodePath::
119 NodePath(NodePath &&from) NOEXCEPT :
120  _head(move(from._head)),
121  _backup_key(from._backup_key),
122  _error_type(from._error_type)
123 {
124 }
125 
126 ////////////////////////////////////////////////////////////////////
127 // Function: NodePath::Move Assignment Operator
128 // Access: Published
129 // Description:
130 ////////////////////////////////////////////////////////////////////
131 INLINE void NodePath::
132 operator = (NodePath &&from) NOEXCEPT {
133  _head = move(from._head);
134  _backup_key = from._backup_key;
135  _error_type = from._error_type;
136 }
137 #endif // USE_MOVE_SEMANTICS
138 
139 ////////////////////////////////////////////////////////////////////
140 // Function: NodePath::clear
141 // Access: Published
142 // Description: Sets this NodePath to the empty NodePath. It will
143 // no longer point to any node.
144 ////////////////////////////////////////////////////////////////////
145 INLINE void NodePath::
146 clear() {
147  _head.clear();
148  _backup_key = 0;
149  _error_type = ET_ok;
150 }
151 
152 ////////////////////////////////////////////////////////////////////
153 // Function: NodePath::not_found named constructor
154 // Access: Published, Static
155 // Description: Creates a NodePath with the ET_not_found error type
156 // set.
157 ////////////////////////////////////////////////////////////////////
158 INLINE NodePath NodePath::
160  NodePath result;
161  result._error_type = ET_not_found;
162  return result;
163 }
164 
165 ////////////////////////////////////////////////////////////////////
166 // Function: NodePath::removed named constructor
167 // Access: Published, Static
168 // Description: Creates a NodePath with the ET_removed error type
169 // set.
170 ////////////////////////////////////////////////////////////////////
171 INLINE NodePath NodePath::
173  NodePath result;
174  result._error_type = ET_removed;
175  return result;
176 }
177 
178 ////////////////////////////////////////////////////////////////////
179 // Function: NodePath::fail named constructor
180 // Access: Published, Static
181 // Description: Creates a NodePath with the ET_fail error type
182 // set.
183 ////////////////////////////////////////////////////////////////////
184 INLINE NodePath NodePath::
185 fail() {
186  NodePath result;
187  result._error_type = ET_fail;
188  return result;
189 }
190 
191 ////////////////////////////////////////////////////////////////////
192 // Function: NodePath::set_max_search_depth
193 // Access: Published, Static
194 // Description: Certain operations, such as find() or
195 // find_all_matches(), require a traversal of the scene
196 // graph to search for the target node or nodes. This
197 // traversal does not attempt to detect cycles, so an
198 // arbitrary cap is set on the depth of the traversal as
199 // a poor man's cycle detection, in the event that a
200 // cycle has inadvertently been introduced into the
201 // scene graph.
202 //
203 // There may be other reasons you'd want to truncate a
204 // search before the bottom of the scene graph has been
205 // reached. In any event, this function sets the limit
206 // on the number of levels that a traversal will
207 // continue, and hence the maximum length of a path that
208 // may be returned by a traversal.
209 //
210 // This is a static method, and so changing this
211 // parameter affects all of the NodePaths in the
212 // universe.
213 ////////////////////////////////////////////////////////////////////
214 INLINE void NodePath::
215 set_max_search_depth(int max_search_depth) {
216  _max_search_depth = max_search_depth;
217 }
218 
219 ////////////////////////////////////////////////////////////////////
220 // Function: NodePath::get_max_search_depth
221 // Access: Published, Static
222 // Description: Returns the current setting of the search depth
223 // limit. See set_max_search_depth.
224 ////////////////////////////////////////////////////////////////////
225 INLINE int NodePath::
227  return _max_search_depth;
228 }
229 
230 ////////////////////////////////////////////////////////////////////
231 // Function: NodePath::is_empty
232 // Access: Published
233 // Description: Returns true if the NodePath contains no nodes.
234 ////////////////////////////////////////////////////////////////////
235 INLINE bool NodePath::
236 is_empty() const {
237  return (_head == (NodePathComponent *)NULL);
238 }
239 
240 ////////////////////////////////////////////////////////////////////
241 // Function: NodePath::is_singleton
242 // Access: Published
243 // Description: Returns true if the NodePath contains exactly one
244 // node.
245 ////////////////////////////////////////////////////////////////////
246 INLINE bool NodePath::
247 is_singleton(Thread *current_thread) const {
248  int pipeline_stage = current_thread->get_pipeline_stage();
249  return (_head != (NodePathComponent *)NULL && _head->is_top_node(pipeline_stage, current_thread));
250 }
251 
252 ////////////////////////////////////////////////////////////////////
253 // Function: NodePath::get_error_type
254 // Access: Published
255 // Description: If is_empty() is true, this returns a code that
256 // represents the reason why the NodePath is empty.
257 ////////////////////////////////////////////////////////////////////
258 INLINE NodePath::ErrorType NodePath::
259 get_error_type() const {
260  return _error_type;
261 }
262 
263 ////////////////////////////////////////////////////////////////////
264 // Function: NodePath::get_top_node
265 // Access: Published
266 // Description: Returns the top node of the path, or NULL if the path
267 // is empty. This requires iterating through the path.
268 ////////////////////////////////////////////////////////////////////
269 INLINE PandaNode *NodePath::
270 get_top_node(Thread *current_thread) const {
271  if (is_empty()) {
272  return (PandaNode *)NULL;
273  }
274 
275  return get_top(current_thread).node();
276 }
277 
278 ////////////////////////////////////////////////////////////////////
279 // Function: NodePath::node
280 // Access: Published
281 // Description: Returns the referenced node of the path.
282 ////////////////////////////////////////////////////////////////////
283 INLINE PandaNode *NodePath::
284 node() const {
285  nassertr_always(!is_empty(), (PandaNode *)NULL);
286  return _head->get_node();
287 }
288 
289 ////////////////////////////////////////////////////////////////////
290 // Function: NodePath::get_key
291 // Access: Published
292 // Description: Returns an integer that is guaranteed to be the same
293 // for all NodePaths that represent the same node
294 // instance, and different for all NodePaths that
295 // represent a different node instance.
296 //
297 // The same key will be returned for a particular
298 // instance as long as at least one NodePath exists that
299 // represents that instance; if all NodePaths for a
300 // particular instance destruct and a new one is later
301 // created, it may have a different index. However, a
302 // given key will never be reused for a different
303 // instance (unless the app has been running long enough
304 // that we overflow the integer key value).
305 ////////////////////////////////////////////////////////////////////
306 INLINE int NodePath::
307 get_key() const {
308  if (is_empty()) {
309  return _backup_key;
310  }
311  return _head->get_key();
312 }
313 
314 ////////////////////////////////////////////////////////////////////
315 // Function: NodePath::add_hash
316 // Access: Published
317 // Description: Adds the NodePath into the running hash. This is
318 // intended to be used by lower-level code that computes
319 // a hash for each NodePath. It modifies the hash value
320 // passed in by a unique adjustment for each NodePath,
321 // and returns the modified hash.
322 //
323 // This is similar to the unique integer returned by
324 // get_key(), but it is not guaranteed to remain unique
325 // beyond the lifetime of this particular NodePath.
326 // Once this NodePath destructs, a different NodePath
327 // may be created which shares the same hash value.
328 ////////////////////////////////////////////////////////////////////
329 INLINE size_t NodePath::
330 add_hash(size_t hash) const {
331  return pointer_hash::add_hash(hash, _head);
332 }
333 
334 ////////////////////////////////////////////////////////////////////
335 // Function: NodePath::is_same_graph
336 // Access: Published
337 // Description: Returns true if the node represented by this NodePath
338 // is parented within the same graph as that of the
339 // other NodePath. This is essentially the same thing
340 // as asking whether get_top() of both NodePaths is the
341 // same (e.g., both "render").
342 ////////////////////////////////////////////////////////////////////
343 INLINE bool NodePath::
344 is_same_graph(const NodePath &other, Thread *current_thread) const {
345  // Actually, it's possible for the top nodes to be the same, but the
346  // NodePaths still to be considered in different graphs. But even
347  // in this case, get_top() will be different for each one. (They'll
348  // be different singleton NodePaths that happen to reference the
349  // same node).
350 
351  // This will happen if one of the top nodes is considered a
352  // different instance--for instance, render.instance_to(NodePath())
353  // returns a different instance of render that appears to have the
354  // same top node. But this is a very rare thing to do.
355  int a_count, b_count;
356  return (find_common_ancestor(*this, other, a_count, b_count, current_thread) != (NodePathComponent *)NULL);
357 }
358 
359 ////////////////////////////////////////////////////////////////////
360 // Function: NodePath::is_ancestor_of
361 // Access: Published
362 // Description: Returns true if the node represented by this NodePath
363 // is a parent or other ancestor of the other NodePath,
364 // or false if it is not.
365 ////////////////////////////////////////////////////////////////////
366 INLINE bool NodePath::
367 is_ancestor_of(const NodePath &other, Thread *current_thread) const {
368  int a_count, b_count;
369  if (find_common_ancestor(*this, other, a_count, b_count, current_thread) == (NodePathComponent *)NULL) {
370  // Not related.
371  return false;
372  }
373 
374  // They are related; now b is descended from a only if a is the
375  // common ancestor (which is to say, a_count == 0).
376  return (a_count == 0);
377 }
378 
379 ////////////////////////////////////////////////////////////////////
380 // Function: NodePath::get_common_ancestor
381 // Access: Published
382 // Description: Returns the lowest NodePath that both of these two
383 // NodePaths have in common: the first ancestor that
384 // both of them share. If the two NodePaths are
385 // unrelated, returns NodePath::not_found().
386 ////////////////////////////////////////////////////////////////////
387 INLINE NodePath NodePath::
388 get_common_ancestor(const NodePath &other, Thread *current_thread) const {
389  int a_count, b_count;
390  NodePathComponent *common = find_common_ancestor(*this, other, a_count, b_count, current_thread);
391  if (common == (NodePathComponent *)NULL) {
392  return NodePath::not_found();
393  }
394 
395  NodePath result;
396  result._head = common;
397  return result;
398 }
399 
400 ////////////////////////////////////////////////////////////////////
401 // Function: NodePath::get_num_children
402 // Access: Published
403 // Description: Returns the number of children of the referenced node.
404 ////////////////////////////////////////////////////////////////////
405 INLINE int NodePath::
406 get_num_children(Thread *current_thread) const {
407  nassertr_always(!is_empty(), 0);
408  return _head->get_node()->get_num_children(current_thread);
409 }
410 
411 ////////////////////////////////////////////////////////////////////
412 // Function: NodePath::get_child
413 // Access: Published
414 // Description: Returns a NodePath representing the nth child of the
415 // referenced node.
416 ////////////////////////////////////////////////////////////////////
417 INLINE NodePath NodePath::
418 get_child(int n, Thread *current_thread) const {
419  nassertr_always(n >= 0 && n < get_num_children(current_thread), NodePath());
420  NodePath child;
421  int pipeline_stage = current_thread->get_pipeline_stage();
422  child._head = PandaNode::get_component(_head, _head->get_node()->get_child(n, current_thread),
423  pipeline_stage, current_thread);
424  return child;
425 }
426 
427 ////////////////////////////////////////////////////////////////////
428 // Function: NodePath::count_num_descendants
429 // Access: Published
430 // Description: Returns the number of nodes at and below this level.
431 ////////////////////////////////////////////////////////////////////
432 INLINE int NodePath::
434  if (is_empty()) {
435  return 0;
436  }
437  return _head->get_node()->count_num_descendants();
438 }
439 
440 ////////////////////////////////////////////////////////////////////
441 // Function: NodePath::has_parent
442 // Access: Published
443 // Description: Returns true if the referenced node has a parent;
444 // i.e. the NodePath chain contains at least two nodes.
445 ////////////////////////////////////////////////////////////////////
446 INLINE bool NodePath::
447 has_parent(Thread *current_thread) const {
448  return !is_empty() && !is_singleton(current_thread);
449 }
450 
451 ////////////////////////////////////////////////////////////////////
452 // Function: NodePath::get_parent
453 // Access: Published
454 // Description: Returns the NodePath to the parent of the referenced
455 // node: that is, this NodePath, shortened by one node.
456 // The parent of a singleton NodePath is defined to be
457 // the empty NodePath.
458 ////////////////////////////////////////////////////////////////////
459 INLINE NodePath NodePath::
460 get_parent(Thread *current_thread) const {
461  if (!has_parent(current_thread)) {
462  return NodePath();
463  }
464 
465  int pipeline_stage = current_thread->get_pipeline_stage();
466 
467  NodePath parent;
468  parent._head = _head->get_next(pipeline_stage, current_thread);
469  return parent;
470 }
471 
472 ////////////////////////////////////////////////////////////////////
473 // Function: NodePath::attach_new_node
474 // Access: Published
475 // Description: Creates an ordinary PandaNode and attaches it below
476 // the current NodePath, returning a new NodePath that
477 // references it.
478 ////////////////////////////////////////////////////////////////////
479 INLINE NodePath NodePath::
480 attach_new_node(const string &name, int sort, Thread *current_thread) const {
481  nassertr(verify_complete(current_thread), NodePath::fail());
482 
483  return attach_new_node(new PandaNode(name), sort, current_thread);
484 }
485 
486 ////////////////////////////////////////////////////////////////////
487 // Function: NodePath::ls
488 // Access: Published
489 // Description: Lists the hierarchy at and below the referenced node.
490 ////////////////////////////////////////////////////////////////////
491 INLINE void NodePath::
492 ls() const {
493  ls(nout);
494 }
495 
496 ////////////////////////////////////////////////////////////////////
497 // Function: NodePath::ls
498 // Access: Published
499 // Description: Lists the hierarchy at and below the referenced node.
500 ////////////////////////////////////////////////////////////////////
501 INLINE void NodePath::
502 ls(ostream &out, int indent_level) const {
503  if (is_empty()) {
504  out << "(empty)\n";
505  } else {
506  node()->ls(out, indent_level);
507  }
508 }
509 
510 ////////////////////////////////////////////////////////////////////
511 // Function: NodePath::reverse_ls
512 // Access: Published
513 // Description: Lists the hierarchy at and above the referenced node.
514 ////////////////////////////////////////////////////////////////////
515 INLINE void NodePath::
516 reverse_ls() const {
517  reverse_ls(nout);
518 }
519 
520 ////////////////////////////////////////////////////////////////////
521 // Function: NodePath::reverse_ls
522 // Access: Published
523 // Description: Lists the hierarchy at and above the referenced node.
524 ////////////////////////////////////////////////////////////////////
525 INLINE int NodePath::
526 reverse_ls(ostream &out, int indent_level) const {
527  if (is_empty()) {
528  out << "(empty)\n";
529  return 0;
530  } else if (has_parent()) {
531  indent_level = get_parent().reverse_ls(out, indent_level);
532  }
533  node()->write(out, indent_level);
534  return indent_level + 2;
535 }
536 
537 ////////////////////////////////////////////////////////////////////
538 // Function: NodePath::set_state
539 // Access: Published
540 // Description: Changes the complete state object on this node.
541 ////////////////////////////////////////////////////////////////////
542 INLINE void NodePath::
543 set_state(const RenderState *state, Thread *current_thread) {
544  nassertv_always(!is_empty());
545  node()->set_state(state, current_thread);
546 }
547 
548 ////////////////////////////////////////////////////////////////////
549 // Function: NodePath::get_net_state
550 // Access: Published
551 // Description: Returns the net state on this node from the root.
552 ////////////////////////////////////////////////////////////////////
553 INLINE CPT(RenderState) NodePath::
554 get_net_state(Thread *current_thread) const {
555  nassertr(_error_type == ET_ok, RenderState::make_empty());
556  return r_get_net_state(_head, current_thread);
557 }
558 
559 ////////////////////////////////////////////////////////////////////
560 // Function: NodePath::set_attrib
561 // Access: Published
562 // Description: Adds the indicated render attribute to the scene
563 // graph on this node. This attribute will now apply to
564 // this node and everything below. If there was already
565 // an attribute of the same type, it is replaced.
566 ////////////////////////////////////////////////////////////////////
567 INLINE void NodePath::
568 set_attrib(const RenderAttrib *attrib, int priority) {
569  nassertv_always(!is_empty());
570  node()->set_attrib(attrib, priority);
571 }
572 
573 ////////////////////////////////////////////////////////////////////
574 // Function: NodePath::get_attrib
575 // Access: Published
576 // Description: Returns the render attribute of the indicated type,
577 // if it is defined on the node, or NULL if it is not.
578 // This checks only what is set on this particular node
579 // level, and has nothing to do with what render
580 // attributes may be inherited from parent nodes.
581 ////////////////////////////////////////////////////////////////////
582 INLINE const RenderAttrib *NodePath::
583 get_attrib(TypeHandle type) const {
584  nassertr_always(!is_empty(), NULL);
585  return node()->get_attrib(type);
586 }
587 
588 ////////////////////////////////////////////////////////////////////
589 // Function: NodePath::has_attrib
590 // Access: Published
591 // Description: Returns true if there is a render attribute of the
592 // indicated type defined on this node, or false if
593 // there is not.
594 ////////////////////////////////////////////////////////////////////
595 INLINE bool NodePath::
596 has_attrib(TypeHandle type) const {
597  nassertr_always(!is_empty(), false);
598  return node()->has_attrib(type);
599 }
600 
601 ////////////////////////////////////////////////////////////////////
602 // Function: NodePath::clear_attrib
603 // Access: Published
604 // Description: Removes the render attribute of the given type from
605 // this node. This node, and the subgraph below, will
606 // now inherit the indicated render attribute from the
607 // nodes above this one.
608 ////////////////////////////////////////////////////////////////////
609 INLINE void NodePath::
611  nassertv_always(!is_empty());
612  node()->clear_attrib(type);
613 }
614 
615 ////////////////////////////////////////////////////////////////////
616 // Function: NodePath::set_effect
617 // Access: Published
618 // Description: Adds the indicated render effect to the scene
619 // graph on this node. If there was already an effect
620 // of the same type, it is replaced.
621 ////////////////////////////////////////////////////////////////////
622 INLINE void NodePath::
623 set_effect(const RenderEffect *effect) {
624  nassertv_always(!is_empty());
625  node()->set_effect(effect);
626 }
627 
628 ////////////////////////////////////////////////////////////////////
629 // Function: NodePath::get_effect
630 // Access: Published
631 // Description: Returns the render effect of the indicated type,
632 // if it is defined on the node, or NULL if it is not.
633 ////////////////////////////////////////////////////////////////////
634 INLINE const RenderEffect *NodePath::
635 get_effect(TypeHandle type) const {
636  nassertr_always(!is_empty(), NULL);
637  return node()->get_effect(type);
638 }
639 
640 ////////////////////////////////////////////////////////////////////
641 // Function: NodePath::has_effect
642 // Access: Published
643 // Description: Returns true if there is a render effect of the
644 // indicated type defined on this node, or false if
645 // there is not.
646 ////////////////////////////////////////////////////////////////////
647 INLINE bool NodePath::
648 has_effect(TypeHandle type) const {
649  nassertr_always(!is_empty(), false);
650  return node()->has_effect(type);
651 }
652 
653 ////////////////////////////////////////////////////////////////////
654 // Function: NodePath::clear_effect
655 // Access: Published
656 // Description: Removes the render effect of the given type from
657 // this node.
658 ////////////////////////////////////////////////////////////////////
659 INLINE void NodePath::
661  nassertv_always(!is_empty());
662  node()->clear_effect(type);
663 }
664 
665 ////////////////////////////////////////////////////////////////////
666 // Function: NodePath::set_effects
667 // Access: Published
668 // Description: Sets the complete RenderEffects that will be applied
669 // this node. This completely replaces whatever has
670 // been set on this node via repeated calls to
671 // set_attrib().
672 ////////////////////////////////////////////////////////////////////
673 INLINE void NodePath::
674 set_effects(const RenderEffects *effects) {
675  nassertv_always(!is_empty());
676  node()->set_effects(effects);
677 }
678 
679 ////////////////////////////////////////////////////////////////////
680 // Function: NodePath::get_effects
681 // Access: Published
682 // Description: Returns the complete RenderEffects that will be
683 // applied to this node.
684 ////////////////////////////////////////////////////////////////////
685 INLINE const RenderEffects *NodePath::
686 get_effects() const {
687  nassertr_always(!is_empty(), RenderEffects::make_empty());
688  return node()->get_effects();
689 }
690 
691 ////////////////////////////////////////////////////////////////////
692 // Function: NodePath::clear_effects
693 // Access: Published
694 // Description: Resets this node to have no render effects.
695 ////////////////////////////////////////////////////////////////////
696 INLINE void NodePath::
698  nassertv_always(!is_empty());
699  node()->clear_effects();
700 }
701 
702 ////////////////////////////////////////////////////////////////////
703 // Function: NodePath::clear_transform
704 // Access: Published
705 // Description: Sets the transform object on this node to identity.
706 ////////////////////////////////////////////////////////////////////
707 INLINE void NodePath::
708 clear_transform(Thread *current_thread) {
709  set_transform(TransformState::make_identity(), current_thread);
710 }
711 
712 ////////////////////////////////////////////////////////////////////
713 // Function: NodePath::set_transform
714 // Access: Published
715 // Description: Changes the complete transform object on this node.
716 ////////////////////////////////////////////////////////////////////
717 INLINE void NodePath::
718 set_transform(const TransformState *transform, Thread *current_thread) {
719  nassertv_always(!is_empty());
720  node()->set_transform(transform, current_thread);
721 }
722 
723 ////////////////////////////////////////////////////////////////////
724 // Function: NodePath::clear_transform
725 // Access: Published
726 // Description: Sets the transform object on this node to identity,
727 // relative to the other node. This effectively places
728 // this node at the same position as the other node.
729 ////////////////////////////////////////////////////////////////////
730 INLINE void NodePath::
731 clear_transform(const NodePath &other, Thread *current_thread) {
732  set_transform(other, TransformState::make_identity(), current_thread);
733 }
734 
735 ////////////////////////////////////////////////////////////////////
736 // Function: NodePath::get_net_transform
737 // Access: Published
738 // Description: Returns the net transform on this node from the root.
739 ////////////////////////////////////////////////////////////////////
740 INLINE CPT(TransformState) NodePath::
741 get_net_transform(Thread *current_thread) const {
742  nassertr(_error_type == ET_ok, TransformState::make_identity());
743  return r_get_net_transform(_head, current_thread);
744 }
745 
746 ////////////////////////////////////////////////////////////////////
747 // Function: NodePath::set_prev_transform
748 // Access: Published
749 // Description: Sets the transform that represents this node's
750 // "previous" position, one frame ago, for the purposes
751 // of detecting motion for accurate collision
752 // calculations.
753 ////////////////////////////////////////////////////////////////////
754 INLINE void NodePath::
755 set_prev_transform(const TransformState *transform, Thread *current_thread) {
756  nassertv_always(!is_empty());
757  node()->set_prev_transform(transform, current_thread);
758 }
759 
760 ////////////////////////////////////////////////////////////////////
761 // Function: NodePath::get_net_prev_transform
762 // Access: Published
763 // Description: Returns the net "previous" transform on this node
764 // from the root. See set_prev_transform().
765 ////////////////////////////////////////////////////////////////////
766 INLINE CPT(TransformState) NodePath::
767 get_net_prev_transform(Thread *current_thread) const {
768  nassertr(_error_type == ET_ok, TransformState::make_identity());
769  return r_get_net_prev_transform(_head, current_thread);
770 }
771 
772 ////////////////////////////////////////////////////////////////////
773 // Function: NodePath::set_pos
774 // Access: Published
775 // Description: Sets the translation component of the transform,
776 // leaving rotation and scale untouched. This also
777 // resets the node's "previous" position, so that the
778 // collision system will see the node as having suddenly
779 // appeared in the new position, without passing any
780 // points in between.
781 ////////////////////////////////////////////////////////////////////
782 INLINE void NodePath::
783 set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
784  set_pos(LPoint3(x, y, z));
785 }
786 
787 ////////////////////////////////////////////////////////////////////
788 // Function: NodePath::set_fluid_pos
789 // Access: Published
790 // Description: Sets the translation component, without changing the
791 // "previous" position, so that the collision system
792 // will see the node as moving fluidly from its previous
793 // position to its new position.
794 ////////////////////////////////////////////////////////////////////
795 INLINE void NodePath::
796 set_fluid_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
797  set_fluid_pos(LPoint3(x, y, z));
798 }
799 
800 INLINE PN_stdfloat NodePath::
801 get_x() const {
802  return get_pos()[0];
803 }
804 
805 INLINE PN_stdfloat NodePath::
806 get_y() const {
807  return get_pos()[1];
808 }
809 
810 INLINE PN_stdfloat NodePath::
811 get_z() const {
812  return get_pos()[2];
813 }
814 
815 ////////////////////////////////////////////////////////////////////
816 // Function: NodePath::set_hpr
817 // Access: Published
818 // Description: Sets the rotation component of the transform,
819 // leaving translation and scale untouched.
820 ////////////////////////////////////////////////////////////////////
821 INLINE void NodePath::
822 set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
823  set_hpr(LVecBase3(h, p, r));
824 }
825 
826 INLINE PN_stdfloat NodePath::
827 get_h() const {
828  return get_hpr()[0];
829 }
830 
831 INLINE PN_stdfloat NodePath::
832 get_p() const {
833  return get_hpr()[1];
834 }
835 
836 INLINE PN_stdfloat NodePath::
837 get_r() const {
838  return get_hpr()[2];
839 }
840 
841 ////////////////////////////////////////////////////////////////////
842 // Function: NodePath::set_scale
843 // Access: Published
844 // Description: Sets the scale component of the transform,
845 // leaving translation and rotation untouched.
846 ////////////////////////////////////////////////////////////////////
847 INLINE void NodePath::
848 set_scale(PN_stdfloat scale) {
849  set_scale(LVecBase3(scale, scale, scale));
850 }
851 
852 INLINE void NodePath::
853 set_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
854  set_scale(LVecBase3(sx, sy, sz));
855 }
856 
857 INLINE PN_stdfloat NodePath::
858 get_sx() const {
859  return get_scale()[0];
860 }
861 
862 INLINE PN_stdfloat NodePath::
863 get_sy() const {
864  return get_scale()[1];
865 }
866 
867 INLINE PN_stdfloat NodePath::
868 get_sz() const {
869  return get_scale()[2];
870 }
871 
872 ////////////////////////////////////////////////////////////////////
873 // Function: NodePath::set_shear
874 // Access: Published
875 // Description: Sets the shear component of the transform,
876 // leaving translation, rotation, and scale untouched.
877 ////////////////////////////////////////////////////////////////////
878 INLINE void NodePath::
879 set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
880  set_shear(LVecBase3(shxy, shxz, shyz));
881 }
882 
883 INLINE PN_stdfloat NodePath::
884 get_shxy() const {
885  return get_shear()[0];
886 }
887 
888 INLINE PN_stdfloat NodePath::
889 get_shxz() const {
890  return get_shear()[1];
891 }
892 
893 INLINE PN_stdfloat NodePath::
894 get_shyz() const {
895  return get_shear()[2];
896 }
897 
898 ////////////////////////////////////////////////////////////////////
899 // Function: NodePath::set_pos_hpr
900 // Access: Published
901 // Description: Sets the translation and rotation component of the
902 // transform, leaving scale untouched.
903 ////////////////////////////////////////////////////////////////////
904 INLINE void NodePath::
905 set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
906  set_pos_hpr(LVecBase3(x, y, z), LVecBase3(h, p, r));
907 }
908 
909 ////////////////////////////////////////////////////////////////////
910 // Function: NodePath::set_hpr_scale
911 // Access: Published
912 // Description: Sets the rotation and scale components of the
913 // transform, leaving translation untouched.
914 ////////////////////////////////////////////////////////////////////
915 INLINE void NodePath::
916 set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
917  set_hpr_scale(LVecBase3(h, p, r), LVecBase3(sx, sy, sz));
918 }
919 
920 ////////////////////////////////////////////////////////////////////
921 // Function: NodePath::set_pos_hpr_scale
922 // Access: Published
923 // Description: Completely replaces the transform with new
924 // translation, rotation, and scale components.
925 ////////////////////////////////////////////////////////////////////
926 INLINE void NodePath::
927 set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
928  PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
929  set_pos_hpr_scale(LVecBase3(x, y, z), LVecBase3(h, p, r),
930  LVecBase3(sx, sy, sz));
931 }
932 
933 ////////////////////////////////////////////////////////////////////
934 // Function: NodePath::clear_mat
935 // Access: Published
936 // Description: Completely removes any transform from the referenced
937 // node.
938 ////////////////////////////////////////////////////////////////////
939 INLINE void NodePath::
941  nassertv_always(!is_empty());
942  node()->clear_transform();
943 }
944 
945 ////////////////////////////////////////////////////////////////////
946 // Function: NodePath::has_mat
947 // Access: Published
948 // Description: Returns true if a non-identity transform matrix has
949 // been applied to the referenced node, false otherwise.
950 ////////////////////////////////////////////////////////////////////
951 INLINE bool NodePath::
952 has_mat() const {
953  nassertr_always(!is_empty(), false);
954  return !node()->get_transform()->is_identity();
955 }
956 
957 ////////////////////////////////////////////////////////////////////
958 // Function: NodePath::get_mat
959 // Access: Published
960 // Description: Returns the transform matrix that has been applied to
961 // the referenced node, or the identity matrix if no
962 // matrix has been applied.
963 ////////////////////////////////////////////////////////////////////
964 INLINE const LMatrix4 &NodePath::
965 get_mat() const {
966  nassertr_always(!is_empty(), LMatrix4::ident_mat());
967 
968  return node()->get_transform()->get_mat();
969 }
970 
971 
972 ////////////////////////////////////////////////////////////////////
973 // Function: NodePath::look_at
974 // Access: Published
975 // Description: Sets the transform on this NodePath so that it
976 // rotates to face the indicated point in space. This
977 // will overwrite any previously existing scale on the
978 // node, although it will preserve any translation.
979 ////////////////////////////////////////////////////////////////////
980 INLINE void NodePath::
981 look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
982  look_at(LPoint3(x, y, z));
983 }
984 
985 ////////////////////////////////////////////////////////////////////
986 // Function: NodePath::heads_up
987 // Access: Published
988 // Description: Behaves like look_at(), but with a strong preference
989 // to keeping the up vector oriented in the indicated
990 // "up" direction.
991 ////////////////////////////////////////////////////////////////////
992 INLINE void NodePath::
993 heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
994  heads_up(LPoint3(x, y, z));
995 }
996 
997 ////////////////////////////////////////////////////////////////////
998 // Function: NodePath::set_pos
999 // Access: Published
1000 // Description: Sets the translation component of the transform,
1001 // relative to the other node.
1002 ////////////////////////////////////////////////////////////////////
1003 INLINE void NodePath::
1004 set_pos(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
1005  set_pos(other, LPoint3(x, y, z));
1006 }
1007 
1008 ////////////////////////////////////////////////////////////////////
1009 // Function: NodePath::set_fluid_pos
1010 // Access: Published
1011 // Description: Sets the translation component, without changing the
1012 // "previous" position, so that the collision system
1013 // will see the node as moving fluidly from its previous
1014 // position to its new position.
1015 ////////////////////////////////////////////////////////////////////
1016 INLINE void NodePath::
1017 set_fluid_pos(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
1018  set_fluid_pos(other, LPoint3(x, y, z));
1019 }
1020 
1021 INLINE PN_stdfloat NodePath::
1022 get_x(const NodePath &other) const {
1023  return get_pos(other)[0];
1024 }
1025 
1026 INLINE PN_stdfloat NodePath::
1027 get_y(const NodePath &other) const {
1028  return get_pos(other)[1];
1029 }
1030 
1031 INLINE PN_stdfloat NodePath::
1032 get_z(const NodePath &other) const {
1033  return get_pos(other)[2];
1034 }
1035 
1036 ////////////////////////////////////////////////////////////////////
1037 // Function: NodePath::set_hpr
1038 // Access: Published
1039 // Description: Sets the rotation component of the transform,
1040 // relative to the other node.
1041 ////////////////////////////////////////////////////////////////////
1042 INLINE void NodePath::
1043 set_hpr(const NodePath &other, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
1044  set_hpr(other, LPoint3(h, p, r));
1045 }
1046 
1047 INLINE PN_stdfloat NodePath::
1048 get_h(const NodePath &other) const {
1049  return get_hpr(other)[0];
1050 }
1051 
1052 INLINE PN_stdfloat NodePath::
1053 get_p(const NodePath &other) const {
1054  return get_hpr(other)[1];
1055 }
1056 
1057 INLINE PN_stdfloat NodePath::
1058 get_r(const NodePath &other) const {
1059  return get_hpr(other)[2];
1060 }
1061 
1062 ////////////////////////////////////////////////////////////////////
1063 // Function: NodePath::set_scale
1064 // Access: Published
1065 // Description: Sets the scale component of the transform,
1066 // relative to the other node.
1067 ////////////////////////////////////////////////////////////////////
1068 INLINE void NodePath::
1069 set_scale(const NodePath &other, PN_stdfloat scale) {
1070  set_scale(other, LPoint3(scale, scale, scale));
1071 }
1072 
1073 ////////////////////////////////////////////////////////////////////
1074 // Function: NodePath::set_scale
1075 // Access: Published
1076 // Description: Sets the scale component of the transform,
1077 // relative to the other node.
1078 ////////////////////////////////////////////////////////////////////
1079 INLINE void NodePath::
1080 set_scale(const NodePath &other, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
1081  set_scale(other, LPoint3(sx, sy, sz));
1082 }
1083 
1084 ////////////////////////////////////////////////////////////////////
1085 // Function: NodePath::get_scale
1086 // Access: Published
1087 // Description: Returns the relative scale of the referenced node
1088 // as seen from the other node.
1089 ////////////////////////////////////////////////////////////////////
1090 INLINE PN_stdfloat NodePath::
1091 get_sx(const NodePath &other) const {
1092  return get_scale(other)[0];
1093 }
1094 
1095 INLINE PN_stdfloat NodePath::
1096 get_sy(const NodePath &other) const {
1097  return get_scale(other)[1];
1098 }
1099 
1100 INLINE PN_stdfloat NodePath::
1101 get_sz(const NodePath &other) const {
1102  return get_scale(other)[2];
1103 }
1104 
1105 ////////////////////////////////////////////////////////////////////
1106 // Function: NodePath::set_shear
1107 // Access: Published
1108 // Description: Sets the shear component of the transform,
1109 // relative to the other node.
1110 ////////////////////////////////////////////////////////////////////
1111 INLINE void NodePath::
1112 set_shear(const NodePath &other, PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz) {
1113  set_shear(other, LPoint3(shxy, shxz, shyz));
1114 }
1115 
1116 ////////////////////////////////////////////////////////////////////
1117 // Function: NodePath::get_shear
1118 // Access: Published
1119 // Description: Returns the relative shear of the referenced node
1120 // as seen from the other node.
1121 ////////////////////////////////////////////////////////////////////
1122 INLINE PN_stdfloat NodePath::
1123 get_shxy(const NodePath &other) const {
1124  return get_shear(other)[0];
1125 }
1126 
1127 INLINE PN_stdfloat NodePath::
1128 get_shxz(const NodePath &other) const {
1129  return get_shear(other)[1];
1130 }
1131 
1132 INLINE PN_stdfloat NodePath::
1133 get_shyz(const NodePath &other) const {
1134  return get_shear(other)[2];
1135 }
1136 
1137 ////////////////////////////////////////////////////////////////////
1138 // Function: NodePath::set_pos_hpr
1139 // Access: Published
1140 // Description: Sets the translation and rotation component of the
1141 // transform, relative to the other node.
1142 ////////////////////////////////////////////////////////////////////
1143 INLINE void NodePath::
1144 set_pos_hpr(const NodePath &other,
1145  PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
1146  PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
1147  set_pos_hpr(other, LVecBase3(x, y, z), LVecBase3(h, p, r));
1148 }
1149 
1150 ////////////////////////////////////////////////////////////////////
1151 // Function: NodePath::set_hpr_scale
1152 // Access: Published
1153 // Description: Sets the rotation and scale components of the
1154 // transform, leaving translation untouched. This, or
1155 // set_pos_hpr_scale, is the preferred way to update a
1156 // transform when both hpr and scale are to be changed.
1157 ////////////////////////////////////////////////////////////////////
1158 INLINE void NodePath::
1160  PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
1161  set_hpr_scale(other, LVecBase3(h, p, r), LVecBase3(sx, sy, sz));
1162 }
1163 
1164 ////////////////////////////////////////////////////////////////////
1165 // Function: NodePath::set_pos_hpr_scale
1166 // Access: Published
1167 // Description: Completely replaces the transform with new
1168 // translation, rotation, and scale components, relative
1169 // to the other node.
1170 ////////////////////////////////////////////////////////////////////
1171 INLINE void NodePath::
1173  PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
1174  PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
1175  PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz) {
1176  set_pos_hpr_scale(other, LVecBase3(x, y, z), LVecBase3(h, p, r),
1177  LVecBase3(sx, sy, sz));
1178 }
1179 
1180 ////////////////////////////////////////////////////////////////////
1181 // Function: NodePath::look_at
1182 // Access: Published
1183 // Description: Sets the hpr on this NodePath so that it rotates to
1184 // face the indicated point in space, which is relative
1185 // to the other NodePath.
1186 ////////////////////////////////////////////////////////////////////
1187 INLINE void NodePath::
1188 look_at(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
1189  look_at(other, LPoint3(x, y, z));
1190 }
1191 
1192 ////////////////////////////////////////////////////////////////////
1193 // Function: NodePath::heads_up
1194 // Access: Published
1195 // Description: Behaves like look_at(), but with a strong preference
1196 // to keeping the up vector oriented in the indicated
1197 // "up" direction.
1198 ////////////////////////////////////////////////////////////////////
1199 INLINE void NodePath::
1200 heads_up(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
1201  heads_up(other, LPoint3(x, y, z));
1202 }
1203 
1204 ////////////////////////////////////////////////////////////////////
1205 // Function: NodePath::get_distance
1206 // Access: Published
1207 // Description: Returns the straight-line distance between this
1208 // referenced node's coordinate frame's origin, and that
1209 // of the other node's origin.
1210 ////////////////////////////////////////////////////////////////////
1211 INLINE PN_stdfloat NodePath::
1212 get_distance(const NodePath &other) const {
1213  LPoint3 pos = get_pos(other);
1214  return length(LVector3(pos));
1215 }
1216 
1217 ////////////////////////////////////////////////////////////////////
1218 // Function: NodePath::set_color_scale
1219 // Access: Published
1220 // Description: Sets the color scale component of the transform
1221 ////////////////////////////////////////////////////////////////////
1222 INLINE void NodePath::
1223 set_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa, int priority) {
1224  set_color_scale(LVecBase4(sr, sg, sb, sa), priority);
1225 }
1226 
1227 ////////////////////////////////////////////////////////////////////
1228 // Function: NodePath::compose_color_scale
1229 // Access: Published
1230 // Description: Sets the color scale component of the transform
1231 ////////////////////////////////////////////////////////////////////
1232 INLINE void NodePath::
1233 compose_color_scale(PN_stdfloat sr, PN_stdfloat sg, PN_stdfloat sb, PN_stdfloat sa, int priority) {
1234  compose_color_scale(LVecBase4(sr, sg, sb, sa), priority);
1235 }
1236 
1237 ////////////////////////////////////////////////////////////////////
1238 // Function: NodePath::set_sr
1239 // Access: Published
1240 // Description: Sets the red scale component of the transform
1241 ////////////////////////////////////////////////////////////////////
1242 INLINE void NodePath::
1243 set_sr(PN_stdfloat sr) {
1244  LVecBase4 new_scale = get_color_scale();
1245  new_scale[0] = sr;
1246 
1247  set_color_scale(new_scale);
1248 }
1249 
1250 ////////////////////////////////////////////////////////////////////
1251 // Function: NodePath::set_sg
1252 // Access: Published
1253 // Description: Sets the alpha scale component of the transform
1254 ////////////////////////////////////////////////////////////////////
1255 INLINE void NodePath::
1256 set_sg(PN_stdfloat sg) {
1257  LVecBase4 new_scale = get_color_scale();
1258  new_scale[1] = sg;
1259 
1260  set_color_scale(new_scale);
1261 }
1262 
1263 ////////////////////////////////////////////////////////////////////
1264 // Function: NodePath::set_sb
1265 // Access: Published
1266 // Description: Sets the blue scale component of the transform
1267 ////////////////////////////////////////////////////////////////////
1268 INLINE void NodePath::
1269 set_sb(PN_stdfloat sb) {
1270  LVecBase4 new_scale = get_color_scale();
1271  new_scale[2] = sb;
1272 
1273  set_color_scale(new_scale);
1274 }
1275 
1276 ////////////////////////////////////////////////////////////////////
1277 // Function: NodePath::set_sa
1278 // Access: Published
1279 // Description: Sets the alpha scale component of the transform
1280 ////////////////////////////////////////////////////////////////////
1281 INLINE void NodePath::
1282 set_sa(PN_stdfloat sa) {
1283  LVecBase4 new_scale = get_color_scale();
1284  new_scale[3] = sa;
1285 
1286  set_color_scale(new_scale);
1287 }
1288 
1289 ////////////////////////////////////////////////////////////////////
1290 // Function: NodePath::get_sr
1291 // Access: Published
1292 // Description: Gets the red scale component of the transform
1293 ////////////////////////////////////////////////////////////////////
1294 INLINE PN_stdfloat NodePath::
1295 get_sr() const {
1296  return get_color_scale()[0];
1297 }
1298 
1299 ////////////////////////////////////////////////////////////////////
1300 // Function: NodePath::get_sg
1301 // Access: Published
1302 // Description: Gets the green scale component of the transform
1303 ////////////////////////////////////////////////////////////////////
1304 INLINE PN_stdfloat NodePath::
1305 get_sg() const {
1306  return get_color_scale()[1];
1307 }
1308 
1309 ////////////////////////////////////////////////////////////////////
1310 // Function: NodePath::get_sb
1311 // Access: Published
1312 // Description: Gets the blue scale component of the transform
1313 ////////////////////////////////////////////////////////////////////
1314 INLINE PN_stdfloat NodePath::
1315 get_sb() const {
1316  return get_color_scale()[2];
1317 }
1318 
1319 ////////////////////////////////////////////////////////////////////
1320 // Function: NodePath::get_sa
1321 // Access: Published
1322 // Description: Gets the alpha scale component of the transform
1323 ////////////////////////////////////////////////////////////////////
1324 INLINE PN_stdfloat NodePath::
1325 get_sa() const {
1326  return get_color_scale()[3];
1327 }
1328 
1329 ////////////////////////////////////////////////////////////////////
1330 // Function: NodePath::set_shader_input
1331 // Access: Published
1332 // Description:
1333 ////////////////////////////////////////////////////////////////////
1334 INLINE void NodePath::
1335 set_shader_input(CPT_InternalName id, const PTA_float &v, int priority) {
1336  set_shader_input(new ShaderInput(id, v, priority));
1337 }
1338 
1339 ////////////////////////////////////////////////////////////////////
1340 // Function: NodePath::set_shader_input
1341 // Access: Published
1342 // Description:
1343 ////////////////////////////////////////////////////////////////////
1344 INLINE void NodePath::
1345 set_shader_input(CPT_InternalName id, const PTA_double &v, int priority) {
1346  set_shader_input(new ShaderInput(id, v, priority));
1347 }
1348 
1349 ////////////////////////////////////////////////////////////////////
1350 // Function: NodePath::set_shader_input
1351 // Access: Published
1352 // Description:
1353 ////////////////////////////////////////////////////////////////////
1354 INLINE void NodePath::
1355 set_shader_input(CPT_InternalName id, const PTA_int &v, int priority) {
1356  set_shader_input(new ShaderInput(id, v, priority));
1357 }
1358 
1359 ////////////////////////////////////////////////////////////////////
1360 // Function: NodePath::set_shader_input
1361 // Access: Published
1362 // Description:
1363 ////////////////////////////////////////////////////////////////////
1364 INLINE void NodePath::
1365 set_shader_input(CPT_InternalName id, const PTA_LVecBase4 &v, int priority) {
1366  set_shader_input(new ShaderInput(id, v, priority));
1367 }
1368 
1369 ////////////////////////////////////////////////////////////////////
1370 // Function: NodePath::set_shader_input
1371 // Access: Published
1372 // Description:
1373 ////////////////////////////////////////////////////////////////////
1374 INLINE void NodePath::
1375 set_shader_input(CPT_InternalName id, const PTA_LVecBase3 &v, int priority) {
1376  set_shader_input(new ShaderInput(id, v, priority));
1377 }
1378 
1379 
1380 ////////////////////////////////////////////////////////////////////
1381 // Function: NodePath::set_shader_input
1382 // Access: Published
1383 // Description:
1384 ////////////////////////////////////////////////////////////////////
1385 INLINE void NodePath::
1386 set_shader_input(CPT_InternalName id, const PTA_LVecBase2 &v, int priority) {
1387  set_shader_input(new ShaderInput(id, v, priority));
1388 }
1389 
1390 ////////////////////////////////////////////////////////////////////
1391 // Function: NodePath::set_shader_input
1392 // Access: Published
1393 // Description:
1394 ////////////////////////////////////////////////////////////////////
1395 INLINE void NodePath::
1396 set_shader_input(CPT_InternalName id, const LVecBase4 &v, int priority) {
1397  set_shader_input(new ShaderInput(id, v, priority));
1398 }
1399 
1400 ////////////////////////////////////////////////////////////////////
1401 // Function: NodePath::set_shader_input
1402 // Access: Published
1403 // Description:
1404 ////////////////////////////////////////////////////////////////////
1405 INLINE void NodePath::
1406 set_shader_input(CPT_InternalName id, const LVecBase3 &v, int priority) {
1407  set_shader_input(new ShaderInput(id, v, priority));
1408 }
1409 
1410 ////////////////////////////////////////////////////////////////////
1411 // Function: NodePath::set_shader_input
1412 // Access: Published
1413 // Description:
1414 ////////////////////////////////////////////////////////////////////
1415 INLINE void NodePath::
1416 set_shader_input(CPT_InternalName id, const LVecBase2 &v, int priority) {
1417  set_shader_input(new ShaderInput(id, v, priority));
1418 }
1419 
1420 ////////////////////////////////////////////////////////////////////
1421 // Function: NodePath::set_shader_input
1422 // Access: Published
1423 // Description:
1424 ////////////////////////////////////////////////////////////////////
1425 INLINE void NodePath::
1426 set_shader_input(CPT_InternalName id, const PTA_LVecBase4i &v, int priority) {
1427  set_shader_input(new ShaderInput(id, v, priority));
1428 }
1429 
1430 ////////////////////////////////////////////////////////////////////
1431 // Function: NodePath::set_shader_input
1432 // Access: Published
1433 // Description:
1434 ////////////////////////////////////////////////////////////////////
1435 INLINE void NodePath::
1436 set_shader_input(CPT_InternalName id, const PTA_LVecBase3i &v, int priority) {
1437  set_shader_input(new ShaderInput(id, v, priority));
1438 }
1439 
1440 
1441 ////////////////////////////////////////////////////////////////////
1442 // Function: NodePath::set_shader_input
1443 // Access: Published
1444 // Description:
1445 ////////////////////////////////////////////////////////////////////
1446 INLINE void NodePath::
1447 set_shader_input(CPT_InternalName id, const PTA_LVecBase2i &v, int priority) {
1448  set_shader_input(new ShaderInput(id, v, priority));
1449 }
1450 
1451 ////////////////////////////////////////////////////////////////////
1452 // Function: NodePath::set_shader_input
1453 // Access: Published
1454 // Description:
1455 ////////////////////////////////////////////////////////////////////
1456 INLINE void NodePath::
1457 set_shader_input(CPT_InternalName id, const LVecBase4i &v, int priority) {
1458  set_shader_input(new ShaderInput(id, v, priority));
1459 }
1460 
1461 ////////////////////////////////////////////////////////////////////
1462 // Function: NodePath::set_shader_input
1463 // Access: Published
1464 // Description:
1465 ////////////////////////////////////////////////////////////////////
1466 INLINE void NodePath::
1467 set_shader_input(CPT_InternalName id, const LVecBase3i &v, int priority) {
1468  set_shader_input(new ShaderInput(id, v, priority));
1469 }
1470 
1471 ////////////////////////////////////////////////////////////////////
1472 // Function: NodePath::set_shader_input
1473 // Access: Published
1474 // Description:
1475 ////////////////////////////////////////////////////////////////////
1476 INLINE void NodePath::
1477 set_shader_input(CPT_InternalName id, const LVecBase2i &v, int priority) {
1478  set_shader_input(new ShaderInput(id, v, priority));
1479 }
1480 
1481 ////////////////////////////////////////////////////////////////////
1482 // Function: NodePath::set_shader_input
1483 // Access: Published
1484 // Description:
1485 ////////////////////////////////////////////////////////////////////
1486 INLINE void NodePath::
1487 set_shader_input(CPT_InternalName id, const PTA_LMatrix4 &v, int priority) {
1488  set_shader_input(new ShaderInput(id, v, priority));
1489 }
1490 
1491 ////////////////////////////////////////////////////////////////////
1492 // Function: NodePath::set_shader_input
1493 // Access: Published
1494 // Description:
1495 ////////////////////////////////////////////////////////////////////
1496 INLINE void NodePath::
1497 set_shader_input(CPT_InternalName id, const PTA_LMatrix3 &v, int priority) {
1498  set_shader_input(new ShaderInput(id, v, priority));
1499 }
1500 
1501 ////////////////////////////////////////////////////////////////////
1502 // Function: NodePath::set_shader_input
1503 // Access: Published
1504 // Description:
1505 ////////////////////////////////////////////////////////////////////
1506 INLINE void NodePath::
1507 set_shader_input(CPT_InternalName id, const LMatrix4 &v, int priority) {
1508  set_shader_input(new ShaderInput(id, v, priority));
1509 }
1510 
1511 ////////////////////////////////////////////////////////////////////
1512 // Function: NodePath::set_shader_input
1513 // Access: Published
1514 // Description:
1515 ////////////////////////////////////////////////////////////////////
1516 INLINE void NodePath::
1517 set_shader_input(CPT_InternalName id, const LMatrix3 &v, int priority) {
1518  set_shader_input(new ShaderInput(id, v, priority));
1519 }
1520 
1521 ////////////////////////////////////////////////////////////////////
1522 // Function: NodePath::set_shader_input
1523 // Access: Published
1524 // Description:
1525 ////////////////////////////////////////////////////////////////////
1526 INLINE void NodePath::
1527 set_shader_input(CPT_InternalName id, Texture *tex, int priority) {
1528  set_shader_input(new ShaderInput(id, tex, priority));
1529 }
1530 
1531 ////////////////////////////////////////////////////////////////////
1532 // Function: NodePath::set_shader_input
1533 // Access: Published
1534 // Description:
1535 ////////////////////////////////////////////////////////////////////
1536 INLINE void NodePath::
1537 set_shader_input(CPT_InternalName id, Texture *tex, const SamplerState &sampler, int priority) {
1538  set_shader_input(new ShaderInput(id, tex, sampler, priority));
1539 }
1540 
1541 ////////////////////////////////////////////////////////////////////
1542 // Function: NodePath::set_shader_input
1543 // Access: Published
1544 // Description:
1545 ////////////////////////////////////////////////////////////////////
1546 INLINE void NodePath::
1547 set_shader_input(CPT_InternalName id, Texture *tex, bool read, bool write, int z, int n, int priority) {
1548  set_shader_input(new ShaderInput(id, tex, read, write, z, n, priority));
1549 }
1550 
1551 ////////////////////////////////////////////////////////////////////
1552 // Function: NodePath::set_shader_input
1553 // Access: Published
1554 // Description:
1555 ////////////////////////////////////////////////////////////////////
1556 INLINE void NodePath::
1557 set_shader_input(CPT_InternalName id, const NodePath &np, int priority) {
1558  set_shader_input(new ShaderInput(id, np, priority));
1559 }
1560 
1561 ////////////////////////////////////////////////////////////////////
1562 // Function: NodePath::set_shader_input
1563 // Access: Published
1564 // Description:
1565 ////////////////////////////////////////////////////////////////////
1566 INLINE void NodePath::
1567 set_shader_input(CPT_InternalName id, int n1, int n2, int n3, int n4, int priority) {
1568  set_shader_input(new ShaderInput(id, LVecBase4i(n1, n2, n3, n4), priority));
1569 }
1570 
1571 ////////////////////////////////////////////////////////////////////
1572 // Function: NodePath::set_shader_input
1573 // Access: Published
1574 // Description:
1575 ////////////////////////////////////////////////////////////////////
1576 INLINE void NodePath::
1577 set_shader_input(CPT_InternalName id, PN_stdfloat n1, PN_stdfloat n2, PN_stdfloat n3, PN_stdfloat n4, int priority) {
1578  set_shader_input(new ShaderInput(id, LVecBase4(n1, n2, n3, n4), priority));
1579 }
1580 
1581 ////////////////////////////////////////////////////////////////////
1582 // Function: NodePath::set_tex_offset
1583 // Access: Published
1584 // Description: Sets a texture matrix on the current node to apply
1585 // the indicated offset to UV's for the given stage.
1586 //
1587 // This call is appropriate for ordinary 2-d texture
1588 // coordinates.
1589 ////////////////////////////////////////////////////////////////////
1590 INLINE void NodePath::
1591 set_tex_offset(TextureStage *stage, PN_stdfloat u, PN_stdfloat v) {
1592  set_tex_offset(stage, LVecBase2(u, v));
1593 }
1594 
1595 ////////////////////////////////////////////////////////////////////
1596 // Function: NodePath::set_tex_offset
1597 // Access: Published
1598 // Description: Sets a texture matrix on the current node to apply
1599 // the indicated offset to UV's for the given stage.
1600 //
1601 // This call is appropriate for ordinary 2-d texture
1602 // coordinates.
1603 ////////////////////////////////////////////////////////////////////
1604 INLINE void NodePath::
1606  nassertv_always(!is_empty());
1607  set_tex_transform(stage,
1608  get_tex_transform(stage)->set_pos2d(uv));
1609 }
1610 
1611 ////////////////////////////////////////////////////////////////////
1612 // Function: NodePath::set_tex_rotate
1613 // Access: Published
1614 // Description: Sets a texture matrix on the current node to apply
1615 // the indicated rotation, clockwise in degrees, to UV's
1616 // for the given stage.
1617 //
1618 // This call is appropriate for ordinary 2-d texture
1619 // coordinates.
1620 ////////////////////////////////////////////////////////////////////
1621 INLINE void NodePath::
1622 set_tex_rotate(TextureStage *stage, PN_stdfloat r) {
1623  nassertv_always(!is_empty());
1624  set_tex_transform(stage,
1625  get_tex_transform(stage)->set_rotate2d(r));
1626 }
1627 
1628 ////////////////////////////////////////////////////////////////////
1629 // Function: NodePath::set_tex_scale
1630 // Access: Published
1631 // Description: Sets a texture matrix on the current node to apply
1632 // the indicated scale to UVW's for the given stage.
1633 //
1634 // This call is appropriate for 2-d or 3-d texture
1635 // coordinates.
1636 ////////////////////////////////////////////////////////////////////
1637 INLINE void NodePath::
1638 set_tex_scale(TextureStage *stage, PN_stdfloat scale) {
1639  nassertv_always(!is_empty());
1640  set_tex_transform(stage,
1641  get_tex_transform(stage)->set_scale(scale));
1642 }
1643 
1644 ////////////////////////////////////////////////////////////////////
1645 // Function: NodePath::set_tex_scale
1646 // Access: Published
1647 // Description: Sets a texture matrix on the current node to apply
1648 // the indicated scale to UV's for the given stage.
1649 //
1650 // This call is appropriate for ordinary 2-d texture
1651 // coordinates.
1652 ////////////////////////////////////////////////////////////////////
1653 INLINE void NodePath::
1654 set_tex_scale(TextureStage *stage, PN_stdfloat su, PN_stdfloat sv) {
1655  set_tex_scale(stage, LVecBase2(su, sv));
1656 }
1657 
1658 ////////////////////////////////////////////////////////////////////
1659 // Function: NodePath::set_tex_scale
1660 // Access: Published
1661 // Description: Sets a texture matrix on the current node to apply
1662 // the indicated scale to UV's for the given stage.
1663 //
1664 // This call is appropriate for ordinary 2-d texture
1665 // coordinates.
1666 ////////////////////////////////////////////////////////////////////
1667 INLINE void NodePath::
1668 set_tex_scale(TextureStage *stage, const LVecBase2 &scale) {
1669  nassertv_always(!is_empty());
1670  set_tex_transform(stage,
1671  get_tex_transform(stage)->set_scale2d(scale));
1672 }
1673 
1674 ////////////////////////////////////////////////////////////////////
1675 // Function: NodePath::get_tex_offset
1676 // Access: Published
1677 // Description: Returns the offset set for the UV's for the given
1678 // stage on the current node.
1679 //
1680 // This call is appropriate for ordinary 2-d texture
1681 // coordinates.
1682 ////////////////////////////////////////////////////////////////////
1683 INLINE LVecBase2 NodePath::
1685  nassertr_always(!is_empty(), LVecBase2::zero());
1686  return get_tex_transform(stage)->get_pos2d();
1687 }
1688 
1689 ////////////////////////////////////////////////////////////////////
1690 // Function: NodePath::get_tex_rotate
1691 // Access: Published
1692 // Description: Returns the rotation set for the UV's for the given
1693 // stage on the current node.
1694 //
1695 // This call is appropriate for ordinary 2-d texture
1696 // coordinates.
1697 ////////////////////////////////////////////////////////////////////
1698 INLINE PN_stdfloat NodePath::
1700  nassertr_always(!is_empty(), 0.0f);
1701  return get_tex_transform(stage)->get_rotate2d();
1702 }
1703 
1704 ////////////////////////////////////////////////////////////////////
1705 // Function: NodePath::get_tex_scale
1706 // Access: Published
1707 // Description: Returns the scale set for the UV's for the given
1708 // stage on the current node.
1709 //
1710 // This call is appropriate for ordinary 2-d texture
1711 // coordinates.
1712 ////////////////////////////////////////////////////////////////////
1713 INLINE LVecBase2 NodePath::
1715  nassertr_always(!is_empty(), LVecBase2(1.0f, 1.0f));
1716  return get_tex_transform(stage)->get_scale2d();
1717 }
1718 
1719 ////////////////////////////////////////////////////////////////////
1720 // Function: NodePath::set_tex_pos
1721 // Access: Published
1722 // Description: Sets a texture matrix on the current node to apply
1723 // the indicated offset to UVW's for the given stage.
1724 //
1725 // This call is appropriate for 3-d texture coordinates.
1726 ////////////////////////////////////////////////////////////////////
1727 INLINE void NodePath::
1728 set_tex_pos(TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) {
1729  set_tex_pos(stage, LVecBase3(u, v, w));
1730 }
1731 
1732 ////////////////////////////////////////////////////////////////////
1733 // Function: NodePath::set_tex_pos
1734 // Access: Published
1735 // Description: Sets a texture matrix on the current node to apply
1736 // the indicated offset to UVW's for the given stage.
1737 //
1738 // This call is appropriate for 3-d texture coordinates.
1739 ////////////////////////////////////////////////////////////////////
1740 INLINE void NodePath::
1741 set_tex_pos(TextureStage *stage, const LVecBase3 &uvw) {
1742  nassertv_always(!is_empty());
1743  set_tex_transform(stage,
1744  get_tex_transform(stage)->set_pos(uvw));
1745 }
1746 
1747 ////////////////////////////////////////////////////////////////////
1748 // Function: NodePath::set_tex_hpr
1749 // Access: Published
1750 // Description: Sets a texture matrix on the current node to apply
1751 // the indicated rotation, as a 3-D HPR, to UVW's
1752 // for the given stage.
1753 //
1754 // This call is appropriate for 3-d texture coordinates.
1755 ////////////////////////////////////////////////////////////////////
1756 INLINE void NodePath::
1757 set_tex_hpr(TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
1758  set_tex_hpr(stage, LVecBase3(h, p, r));
1759 }
1760 
1761 ////////////////////////////////////////////////////////////////////
1762 // Function: NodePath::set_tex_hpr
1763 // Access: Published
1764 // Description: Sets a texture matrix on the current node to apply
1765 // the indicated rotation, as a 3-D HPR, to UVW's
1766 // for the given stage.
1767 //
1768 // This call is appropriate for 3-d texture coordinates.
1769 ////////////////////////////////////////////////////////////////////
1770 INLINE void NodePath::
1771 set_tex_hpr(TextureStage *stage, const LVecBase3 &hpr) {
1772  nassertv_always(!is_empty());
1773  set_tex_transform(stage,
1774  get_tex_transform(stage)->set_hpr(hpr));
1775 }
1776 
1777 ////////////////////////////////////////////////////////////////////
1778 // Function: NodePath::set_tex_scale
1779 // Access: Published
1780 // Description: Sets a texture matrix on the current node to apply
1781 // the indicated scale to UVW's for the given stage.
1782 //
1783 // This call is appropriate for 3-d texture coordinates.
1784 ////////////////////////////////////////////////////////////////////
1785 INLINE void NodePath::
1786 set_tex_scale(TextureStage *stage, PN_stdfloat su, PN_stdfloat sv, PN_stdfloat sw) {
1787  set_tex_scale(stage, LVecBase3(su, sv, sw));
1788 }
1789 
1790 ////////////////////////////////////////////////////////////////////
1791 // Function: NodePath::set_tex_scale
1792 // Access: Published
1793 // Description: Sets a texture matrix on the current node to apply
1794 // the indicated scale to UVW's for the given stage.
1795 //
1796 // This call is appropriate for 3-d texture coordinates.
1797 ////////////////////////////////////////////////////////////////////
1798 INLINE void NodePath::
1799 set_tex_scale(TextureStage *stage, const LVecBase3 &scale) {
1800  nassertv_always(!is_empty());
1801  set_tex_transform(stage,
1802  get_tex_transform(stage)->set_scale(scale));
1803 }
1804 
1805 ////////////////////////////////////////////////////////////////////
1806 // Function: NodePath::get_tex_pos
1807 // Access: Published
1808 // Description: Returns the offset set for the UVW's for the given
1809 // stage on the current node.
1810 //
1811 // This call is appropriate for 3-d texture coordinates.
1812 ////////////////////////////////////////////////////////////////////
1813 INLINE LVecBase3 NodePath::
1814 get_tex_pos(TextureStage *stage) const {
1815  nassertr_always(!is_empty(), LVecBase3::zero());
1816  return get_tex_transform(stage)->get_pos();
1817 }
1818 
1819 ////////////////////////////////////////////////////////////////////
1820 // Function: NodePath::get_tex_hpr
1821 // Access: Published
1822 // Description: Returns the 3-D HPR set for the UVW's for the given
1823 // stage on the current node.
1824 //
1825 // This call is appropriate for 3-d texture coordinates.
1826 ////////////////////////////////////////////////////////////////////
1827 INLINE LVecBase3 NodePath::
1828 get_tex_hpr(TextureStage *stage) const {
1829  nassertr_always(!is_empty(), LVecBase3::zero());
1830  return get_tex_transform(stage)->get_hpr();
1831 }
1832 
1833 ////////////////////////////////////////////////////////////////////
1834 // Function: NodePath::get_tex_scale_3d
1835 // Access: Published
1836 // Description: Returns the scale set for the UVW's for the given
1837 // stage on the current node.
1838 //
1839 // This call is appropriate for 3-d texture coordinates.
1840 ////////////////////////////////////////////////////////////////////
1841 INLINE LVecBase3 NodePath::
1843  nassertr_always(!is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
1844  return get_tex_transform(stage)->get_scale();
1845 }
1846 
1847 ////////////////////////////////////////////////////////////////////
1848 // Function: NodePath::set_tex_offset
1849 // Access: Published
1850 // Description: Sets a texture matrix on the current node to apply
1851 // the indicated offset to UV's for the given stage.
1852 //
1853 // This call is appropriate for ordinary 2-d texture
1854 // coordinates.
1855 ////////////////////////////////////////////////////////////////////
1856 INLINE void NodePath::
1857 set_tex_offset(const NodePath &other, TextureStage *stage, PN_stdfloat u, PN_stdfloat v) {
1858  set_tex_offset(other, stage, LVecBase2(u, v));
1859 }
1860 
1861 ////////////////////////////////////////////////////////////////////
1862 // Function: NodePath::set_tex_offset
1863 // Access: Published
1864 // Description: Sets a texture matrix on the current node to apply
1865 // the indicated offset to UV's for the given stage.
1866 //
1867 // This call is appropriate for ordinary 2-d texture
1868 // coordinates.
1869 ////////////////////////////////////////////////////////////////////
1870 INLINE void NodePath::
1871 set_tex_offset(const NodePath &other, TextureStage *stage, const LVecBase2 &uv) {
1872  nassertv_always(!is_empty());
1873  set_tex_transform(other, stage,
1874  get_tex_transform(other, stage)->set_pos2d(uv));
1875 }
1876 
1877 ////////////////////////////////////////////////////////////////////
1878 // Function: NodePath::set_tex_rotate
1879 // Access: Published
1880 // Description: Sets a texture matrix on the current node to apply
1881 // the indicated rotation, clockwise in degrees, to UV's
1882 // for the given stage.
1883 //
1884 // This call is appropriate for ordinary 2-d texture
1885 // coordinates.
1886 ////////////////////////////////////////////////////////////////////
1887 INLINE void NodePath::
1888 set_tex_rotate(const NodePath &other, TextureStage *stage, PN_stdfloat r) {
1889  nassertv_always(!is_empty());
1890  set_tex_transform(other, stage,
1891  get_tex_transform(other, stage)->set_rotate2d(r));
1892 }
1893 
1894 ////////////////////////////////////////////////////////////////////
1895 // Function: NodePath::set_tex_scale
1896 // Access: Published
1897 // Description: Sets a texture matrix on the current node to apply
1898 // the indicated scale to UV's for the given stage.
1899 //
1900 // This call is appropriate for 2-d or 3-d texture
1901 // coordinates.
1902 ////////////////////////////////////////////////////////////////////
1903 INLINE void NodePath::
1904 set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat scale) {
1905  nassertv_always(!is_empty());
1906  set_tex_transform(other, stage,
1907  get_tex_transform(stage)->set_scale(scale));
1908 }
1909 
1910 ////////////////////////////////////////////////////////////////////
1911 // Function: NodePath::set_tex_scale
1912 // Access: Published
1913 // Description: Sets a texture matrix on the current node to apply
1914 // the indicated scale to UV's for the given stage.
1915 //
1916 // This call is appropriate for ordinary 2-d texture
1917 // coordinates.
1918 ////////////////////////////////////////////////////////////////////
1919 INLINE void NodePath::
1920 set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat su, PN_stdfloat sv) {
1921  set_tex_scale(other, stage, LVecBase2(su, sv));
1922 }
1923 
1924 ////////////////////////////////////////////////////////////////////
1925 // Function: NodePath::set_tex_scale
1926 // Access: Published
1927 // Description: Sets a texture matrix on the current node to apply
1928 // the indicated scale to UV's for the given stage.
1929 //
1930 // This call is appropriate for ordinary 2-d texture
1931 // coordinates.
1932 ////////////////////////////////////////////////////////////////////
1933 INLINE void NodePath::
1934 set_tex_scale(const NodePath &other, TextureStage *stage, const LVecBase2 &scale) {
1935  nassertv_always(!is_empty());
1936  set_tex_transform(other, stage,
1937  get_tex_transform(stage)->set_scale2d(scale));
1938 }
1939 
1940 ////////////////////////////////////////////////////////////////////
1941 // Function: NodePath::get_tex_offset
1942 // Access: Published
1943 // Description: Returns the offset set for the UV's for the given
1944 // stage on the current node.
1945 //
1946 // This call is appropriate for ordinary 2-d texture
1947 // coordinates.
1948 ////////////////////////////////////////////////////////////////////
1949 INLINE LVecBase2 NodePath::
1950 get_tex_offset(const NodePath &other, TextureStage *stage) const {
1951  nassertr_always(!is_empty(), LVecBase2::zero());
1952  return get_tex_transform(other, stage)->get_pos2d();
1953 }
1954 
1955 ////////////////////////////////////////////////////////////////////
1956 // Function: NodePath::get_tex_rotate
1957 // Access: Published
1958 // Description: Returns the rotation set for the UV's for the given
1959 // stage on the current node.
1960 //
1961 // This call is appropriate for ordinary 2-d texture
1962 // coordinates.
1963 ////////////////////////////////////////////////////////////////////
1964 INLINE PN_stdfloat NodePath::
1965 get_tex_rotate(const NodePath &other, TextureStage *stage) const {
1966  nassertr_always(!is_empty(), 0.0f);
1967  return get_tex_transform(other, stage)->get_rotate2d();
1968 }
1969 
1970 ////////////////////////////////////////////////////////////////////
1971 // Function: NodePath::get_tex_scale
1972 // Access: Published
1973 // Description: Returns the scale set for the UV's for the given
1974 // stage on the current node.
1975 //
1976 // This call is appropriate for ordinary 2-d texture
1977 // coordinates.
1978 ////////////////////////////////////////////////////////////////////
1979 INLINE LVecBase2 NodePath::
1980 get_tex_scale(const NodePath &other, TextureStage *stage) const {
1981  nassertr_always(!is_empty(), LVecBase2(1.0f, 1.0f));
1982  return get_tex_transform(other, stage)->get_scale2d();
1983 }
1984 
1985 ////////////////////////////////////////////////////////////////////
1986 // Function: NodePath::set_tex_pos
1987 // Access: Published
1988 // Description: Sets a texture matrix on the current node to apply
1989 // the indicated offset to UVW's for the given stage.
1990 //
1991 // This call is appropriate for 3-d texture coordinates.
1992 ////////////////////////////////////////////////////////////////////
1993 INLINE void NodePath::
1994 set_tex_pos(const NodePath &other, TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) {
1995  set_tex_pos(other, stage, LVecBase3(u, v, w));
1996 }
1997 
1998 ////////////////////////////////////////////////////////////////////
1999 // Function: NodePath::set_tex_pos
2000 // Access: Published
2001 // Description: Sets a texture matrix on the current node to apply
2002 // the indicated offset to UVW's for the given stage.
2003 //
2004 // This call is appropriate for 3-d texture coordinates.
2005 ////////////////////////////////////////////////////////////////////
2006 INLINE void NodePath::
2007 set_tex_pos(const NodePath &other, TextureStage *stage, const LVecBase3 &uvw) {
2008  nassertv_always(!is_empty());
2009  set_tex_transform(other, stage,
2010  get_tex_transform(stage)->set_pos(uvw));
2011 }
2012 
2013 ////////////////////////////////////////////////////////////////////
2014 // Function: NodePath::set_tex_hpr
2015 // Access: Published
2016 // Description: Sets a texture matrix on the current node to apply
2017 // the indicated rotation, as a 3-D HPR, to UVW's
2018 // for the given stage.
2019 //
2020 // This call is appropriate for 3-d texture coordinates.
2021 ////////////////////////////////////////////////////////////////////
2022 INLINE void NodePath::
2023 set_tex_hpr(const NodePath &other, TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
2024  set_tex_hpr(other, stage, LVecBase3(h, p, r));
2025 }
2026 
2027 ////////////////////////////////////////////////////////////////////
2028 // Function: NodePath::set_tex_hpr
2029 // Access: Published
2030 // Description: Sets a texture matrix on the current node to apply
2031 // the indicated rotation, as a 3-D HPR, to UVW's
2032 // for the given stage.
2033 //
2034 // This call is appropriate for 3-d texture coordinates.
2035 ////////////////////////////////////////////////////////////////////
2036 INLINE void NodePath::
2037 set_tex_hpr(const NodePath &other, TextureStage *stage, const LVecBase3 &hpr) {
2038  nassertv_always(!is_empty());
2039  set_tex_transform(other, stage,
2040  get_tex_transform(stage)->set_hpr(hpr));
2041 }
2042 
2043 ////////////////////////////////////////////////////////////////////
2044 // Function: NodePath::set_tex_scale
2045 // Access: Published
2046 // Description: Sets a texture matrix on the current node to apply
2047 // the indicated scale to UVW's for the given stage.
2048 //
2049 // This call is appropriate for 3-d texture coordinates.
2050 ////////////////////////////////////////////////////////////////////
2051 INLINE void NodePath::
2052 set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat su, PN_stdfloat sv, PN_stdfloat sw) {
2053  set_tex_scale(other, stage, LVecBase3(su, sv, sw));
2054 }
2055 
2056 ////////////////////////////////////////////////////////////////////
2057 // Function: NodePath::set_tex_scale
2058 // Access: Published
2059 // Description: Sets a texture matrix on the current node to apply
2060 // the indicated scale to UVW's for the given stage.
2061 //
2062 // This call is appropriate for 3-d texture coordinates.
2063 ////////////////////////////////////////////////////////////////////
2064 INLINE void NodePath::
2065 set_tex_scale(const NodePath &other, TextureStage *stage, const LVecBase3 &scale) {
2066  nassertv_always(!is_empty());
2067  set_tex_transform(other, stage,
2068  get_tex_transform(stage)->set_scale(scale));
2069 }
2070 
2071 ////////////////////////////////////////////////////////////////////
2072 // Function: NodePath::get_tex_pos
2073 // Access: Published
2074 // Description: Returns the offset set for the UVW's for the given
2075 // stage on the current node.
2076 //
2077 // This call is appropriate for 3-d texture coordinates.
2078 ////////////////////////////////////////////////////////////////////
2079 INLINE LVecBase3 NodePath::
2080 get_tex_pos(const NodePath &other, TextureStage *stage) const {
2081  nassertr_always(!is_empty(), LVecBase3::zero());
2082  return get_tex_transform(stage)->get_pos();
2083 }
2084 
2085 ////////////////////////////////////////////////////////////////////
2086 // Function: NodePath::get_tex_hpr
2087 // Access: Published
2088 // Description: Returns the 3-D HPR set for the UVW's for the given
2089 // stage on the current node.
2090 //
2091 // This call is appropriate for 3-d texture coordinates.
2092 ////////////////////////////////////////////////////////////////////
2093 INLINE LVecBase3 NodePath::
2094 get_tex_hpr(const NodePath &other, TextureStage *stage) const {
2095  nassertr_always(!is_empty(), LVecBase3::zero());
2096  return get_tex_transform(stage)->get_hpr();
2097 }
2098 
2099 ////////////////////////////////////////////////////////////////////
2100 // Function: NodePath::get_tex_scale_3d
2101 // Access: Published
2102 // Description: Returns the scale set for the UVW's for the given
2103 // stage on the current node.
2104 //
2105 // This call is appropriate for 3-d texture coordinates.
2106 ////////////////////////////////////////////////////////////////////
2107 INLINE LVecBase3 NodePath::
2108 get_tex_scale_3d(const NodePath &other, TextureStage *stage) const {
2109  nassertr_always(!is_empty(), LVecBase3(1.0f, 1.0f, 1.0f));
2110  return get_tex_transform(stage)->get_scale();
2111 }
2112 
2113 ////////////////////////////////////////////////////////////////////
2114 // Function: NodePath::clear_project_texture
2115 // Access: Published
2116 // Description: Undoes the effect of project_texture().
2117 ////////////////////////////////////////////////////////////////////
2118 INLINE void NodePath::
2120  clear_texture(stage);
2121  clear_tex_gen(stage);
2122  clear_tex_projector(stage);
2123 }
2124 
2125 ////////////////////////////////////////////////////////////////////
2126 // Function: NodePath::has_texcoord
2127 // Access: Published
2128 // Description: Returns true if there are at least some vertices at
2129 // this node and below that use the named texture
2130 // coordinate set, false otherwise. Pass the empty
2131 // string for the default texture coordinate set.
2132 ////////////////////////////////////////////////////////////////////
2133 INLINE bool NodePath::
2134 has_texcoord(const string &texcoord_name) const {
2135  return has_vertex_column(InternalName::get_texcoord_name(texcoord_name));
2136 }
2137 
2138 ////////////////////////////////////////////////////////////////////
2139 // Function: NodePath::set_billboard_axis
2140 // Access: Published
2141 // Description: Puts a billboard transition on the node such that it
2142 // will rotate in two dimensions around the up axis.
2143 ////////////////////////////////////////////////////////////////////
2144 INLINE void NodePath::
2145 set_billboard_axis(PN_stdfloat offset) {
2146  set_billboard_axis(NodePath(), offset);
2147 }
2148 
2149 ////////////////////////////////////////////////////////////////////
2150 // Function: NodePath::set_billboard_point_eye
2151 // Access: Published
2152 // Description: Puts a billboard transition on the node such that it
2153 // will rotate in three dimensions about the origin,
2154 // keeping its up vector oriented to the top of the
2155 // camera.
2156 ////////////////////////////////////////////////////////////////////
2157 INLINE void NodePath::
2158 set_billboard_point_eye(PN_stdfloat offset) {
2159  set_billboard_point_eye(NodePath(), offset);
2160 }
2161 
2162 ////////////////////////////////////////////////////////////////////
2163 // Function: NodePath::set_billboard_point_world
2164 // Access: Published
2165 // Description: Puts a billboard transition on the node such that it
2166 // will rotate in three dimensions about the origin,
2167 // keeping its up vector oriented to the sky.
2168 ////////////////////////////////////////////////////////////////////
2169 INLINE void NodePath::
2170 set_billboard_point_world(PN_stdfloat offset) {
2172 }
2173 
2174 ////////////////////////////////////////////////////////////////////
2175 // Function: NodePath::adjust_all_priorities
2176 // Access: Published
2177 // Description: Adds the indicated adjustment amount (which may be
2178 // negative) to the priority for all transitions on the
2179 // referenced node, and for all nodes in the subgraph
2180 // below. This can be used to force these nodes not to
2181 // be overridden by a high-level state change above. If
2182 // the priority would drop below zero, it is set to
2183 // zero.
2184 ////////////////////////////////////////////////////////////////////
2185 INLINE void NodePath::
2186 adjust_all_priorities(int adjustment) {
2187  nassertv_always(!is_empty());
2188  r_adjust_all_priorities(node(), adjustment);
2189 }
2190 
2191 ////////////////////////////////////////////////////////////////////
2192 // Function: NodePath::show
2193 // Access: Published
2194 // Description: Undoes the effect of a previous hide() on this node:
2195 // makes the referenced node (and the entire subgraph
2196 // below this node) visible to all cameras.
2197 //
2198 // This will not reveal the node if a parent node has
2199 // been hidden.
2200 ////////////////////////////////////////////////////////////////////
2201 INLINE void NodePath::
2202 show() {
2203  nassertv_always(!is_empty());
2204  node()->adjust_draw_mask(DrawMask::all_off(), DrawMask::all_off(), PandaNode::get_overall_bit());
2205 }
2206 
2207 ////////////////////////////////////////////////////////////////////
2208 // Function: NodePath::show
2209 // Access: Published
2210 // Description: Makes the referenced node visible just to the
2211 // cameras whose camera_mask shares the indicated bits.
2212 //
2213 // This undoes the effect of a previous hide() call. It
2214 // will not reveal the node if a parent node has been
2215 // hidden. However, see show_through().
2216 ////////////////////////////////////////////////////////////////////
2217 INLINE void NodePath::
2218 show(DrawMask camera_mask) {
2219  nassertv_always(!is_empty());
2220  camera_mask &= ~PandaNode::get_overall_bit();
2222 }
2223 
2224 ////////////////////////////////////////////////////////////////////
2225 // Function: NodePath::show_through
2226 // Access: Published
2227 // Description: Makes the referenced node visible just to the
2228 // cameras whose camera_mask shares the indicated bits.
2229 //
2230 // Unlike show(), this will reveal the node even if a
2231 // parent node has been hidden, thus "showing through" a
2232 // parent's hide().
2233 ////////////////////////////////////////////////////////////////////
2234 INLINE void NodePath::
2236  nassertv_always(!is_empty());
2237  node()->adjust_draw_mask(PandaNode::get_overall_bit(), DrawMask::all_off(), DrawMask::all_off());
2238 }
2239 
2240 ////////////////////////////////////////////////////////////////////
2241 // Function: NodePath::show_through
2242 // Access: Published
2243 // Description: Makes the referenced node visible just to the
2244 // cameras whose camera_mask shares the indicated bits.
2245 //
2246 // Unlike show(), this will reveal the node even if a
2247 // parent node has been hidden via the one-parameter
2248 // hide() method, thus "showing through" a parent's
2249 // hide(). (However, it will not show through a
2250 // parent's hide() call if the no-parameter form of
2251 // hide() was used.)
2252 ////////////////////////////////////////////////////////////////////
2253 INLINE void NodePath::
2254 show_through(DrawMask camera_mask) {
2255  nassertv_always(!is_empty());
2256  camera_mask &= ~PandaNode::get_overall_bit();
2258 }
2259 
2260 ////////////////////////////////////////////////////////////////////
2261 // Function: NodePath::hide
2262 // Access: Published
2263 // Description: Makes the referenced node (and the entire subgraph
2264 // below this node) invisible to all cameras. It
2265 // remains part of the scene graph, its bounding volume
2266 // still contributes to its parent's bounding volume,
2267 // and it will still be involved in collision tests.
2268 ////////////////////////////////////////////////////////////////////
2269 INLINE void NodePath::
2270 hide() {
2271  nassertv_always(!is_empty());
2272  node()->adjust_draw_mask(DrawMask::all_off(), PandaNode::get_overall_bit(), DrawMask::all_off());
2273 }
2274 
2275 ////////////////////////////////////////////////////////////////////
2276 // Function: NodePath::hide
2277 // Access: Published
2278 // Description: Makes the referenced node invisible just to the
2279 // cameras whose camera_mask shares the indicated bits.
2280 //
2281 // This will also hide any nodes below this node in the
2282 // scene graph, including those nodes for which show()
2283 // has been called, but it will not hide descendent
2284 // nodes for which show_through() has been called.
2285 ////////////////////////////////////////////////////////////////////
2286 INLINE void NodePath::
2287 hide(DrawMask camera_mask) {
2288  nassertv_always(!is_empty());
2289  camera_mask &= ~PandaNode::get_overall_bit();
2291 }
2292 
2293 ////////////////////////////////////////////////////////////////////
2294 // Function: NodePath::is_hidden
2295 // Access: Published
2296 // Description: Returns true if the referenced node is hidden from
2297 // the indicated camera(s) either directly, or because
2298 // some ancestor is hidden.
2299 ////////////////////////////////////////////////////////////////////
2300 INLINE bool NodePath::
2301 is_hidden(DrawMask camera_mask) const {
2302  return !get_hidden_ancestor(camera_mask).is_empty();
2303 }
2304 
2305 ////////////////////////////////////////////////////////////////////
2306 // Function: NodePath::is_stashed
2307 // Access: Published
2308 // Description: Returns true if the referenced node is stashed either
2309 // directly, or because some ancestor is stashed.
2310 ////////////////////////////////////////////////////////////////////
2311 INLINE bool NodePath::
2312 is_stashed() const {
2313  return !get_stashed_ancestor().is_empty();
2314 }
2315 
2316 ////////////////////////////////////////////////////////////////////
2317 // Function: NodePath::get_collide_mask
2318 // Access: Published
2319 // Description: Returns the union of all of the into_collide_masks
2320 // for nodes at this level and below. This is the same
2321 // thing as node()->get_net_collide_mask().
2322 //
2323 // If you want to return what the into_collide_mask of
2324 // this node itself is, without regard to its children,
2325 // use node()->get_into_collide_mask().
2326 ////////////////////////////////////////////////////////////////////
2327 INLINE CollideMask NodePath::
2329  nassertr_always(!is_empty(), CollideMask::all_off());
2330  return node()->get_net_collide_mask();
2331 }
2332 
2333 ////////////////////////////////////////////////////////////////////
2334 // Function: NodePath::set_collide_mask
2335 // Access: Published
2336 // Description: Recursively applies the indicated CollideMask to the
2337 // into_collide_masks for all nodes at this level and
2338 // below. If node_type is not TypeHandle::none(), then
2339 // only nodes matching (or inheriting from) the
2340 // indicated PandaNode subclass are modified.
2341 //
2342 // The default is to change all bits, but if
2343 // bits_to_change is not all bits on, then only the bits
2344 // that are set in bits_to_change are modified, allowing
2345 // this call to change only a subset of the bits in the
2346 // subgraph.
2347 ////////////////////////////////////////////////////////////////////
2348 INLINE void NodePath::
2349 set_collide_mask(CollideMask new_mask, CollideMask bits_to_change,
2350  TypeHandle node_type) {
2351  nassertv_always(!is_empty());
2352  if (node_type == TypeHandle::none()) {
2353  node_type = PandaNode::get_class_type();
2354  }
2355 
2356  r_set_collide_mask(node(), ~bits_to_change, new_mask & bits_to_change,
2357  node_type);
2358 }
2359 
2360 ////////////////////////////////////////////////////////////////////
2361 // Function: NodePath::operator ==
2362 // Access: Published
2363 // Description: Returns true if the two paths are equivalent; that
2364 // is, if they contain the same list of nodes in the same
2365 // order.
2366 ////////////////////////////////////////////////////////////////////
2367 INLINE bool NodePath::
2368 operator == (const NodePath &other) const {
2369  return _head == other._head;
2370 }
2371 
2372 ////////////////////////////////////////////////////////////////////
2373 // Function: NodePath::operator !=
2374 // Access: Published
2375 // Description: Returns true if the two paths are not equivalent.
2376 ////////////////////////////////////////////////////////////////////
2377 INLINE bool NodePath::
2378 operator != (const NodePath &other) const {
2379  return _head != other._head;
2380 }
2381 
2382 ////////////////////////////////////////////////////////////////////
2383 // Function: NodePath::operator <
2384 // Access: Published
2385 // Description: Returns true if this NodePath sorts before the other
2386 // one, false otherwise. The sorting order of two
2387 // nonequivalent NodePaths is consistent but undefined,
2388 // and is useful only for storing NodePaths in a sorted
2389 // container like an STL set.
2390 ////////////////////////////////////////////////////////////////////
2391 INLINE bool NodePath::
2392 operator < (const NodePath &other) const {
2393  return _head < other._head;
2394 }
2395 
2396 ////////////////////////////////////////////////////////////////////
2397 // Function: NodePath::compare_to
2398 // Access: Published
2399 // Description: Returns a number less than zero if this NodePath
2400 // sorts before the other one, greater than zero if it
2401 // sorts after, or zero if they are equivalent.
2402 //
2403 // Two NodePaths are considered equivalent if they
2404 // consist of exactly the same list of nodes in the same
2405 // order. Otherwise, they are different; different
2406 // NodePaths will be ranked in a consistent but
2407 // undefined ordering; the ordering is useful only for
2408 // placing the NodePaths in a sorted container like an
2409 // STL set.
2410 ////////////////////////////////////////////////////////////////////
2411 INLINE int NodePath::
2412 compare_to(const NodePath &other) const {
2413  // Nowadays, the NodePathComponents at the head are pointerwise
2414  // equivalent if and only if the NodePaths are equivalent. So we
2415  // only have to compare pointers.
2416  if (_head != other._head) {
2417  return _head < other._head ? -1 : 1;
2418  }
2419  return 0;
2420 }
2421 
2422 ////////////////////////////////////////////////////////////////////
2423 // Function: NodePath::clear_model_nodes
2424 // Access: Published
2425 // Description: Recursively walks through the scene graph at this
2426 // level and below, looking for ModelNodes, and calls
2427 // model_node->set_preserve_transform(PT_drop_node) on
2428 // each one. This allows a subsequent call to
2429 // flatten_strong() to eliminate all of the ModelNodes.
2430 //
2431 // Returns the number of ModelNodes found.
2432 ////////////////////////////////////////////////////////////////////
2433 INLINE int NodePath::
2435  nassertr_always(!is_empty(), 0);
2436  return r_clear_model_nodes(node());
2437 }
2438 
2439 ////////////////////////////////////////////////////////////////////
2440 // Function: NodePath::set_tag
2441 // Access: Published
2442 // Description: Associates a user-defined value with a user-defined
2443 // key which is stored on the node. This value has no
2444 // meaning to Panda; but it is stored indefinitely on
2445 // the node until it is requested again.
2446 //
2447 // Each unique key stores a different string value.
2448 // There is no effective limit on the number of
2449 // different keys that may be stored or on the length of
2450 // any one key's value.
2451 ////////////////////////////////////////////////////////////////////
2452 INLINE void NodePath::
2453 set_tag(const string &key, const string &value) {
2454  nassertv_always(!is_empty());
2455  node()->set_tag(key, value);
2456 }
2457 
2458 ////////////////////////////////////////////////////////////////////
2459 // Function: NodePath::get_tag
2460 // Access: Published
2461 // Description: Retrieves the user-defined value that was previously
2462 // set on this node for the particular key, if any. If
2463 // no value has been previously set, returns the empty
2464 // string. See also get_net_tag().
2465 ////////////////////////////////////////////////////////////////////
2466 INLINE string NodePath::
2467 get_tag(const string &key) const {
2468  // An empty NodePath quietly returns no tags. This makes
2469  // get_net_tag() easier to implement.
2470  if (is_empty()) {
2471  return string();
2472  }
2473  return node()->get_tag(key);
2474 }
2475 
2476 ////////////////////////////////////////////////////////////////////
2477 // Function: NodePath::get_tag_keys
2478 // Access: Published
2479 // Description: Fills the given vector up with the
2480 // list of tags on this PandaNode.
2481 //
2482 // It is the user's responsibility to ensure that the
2483 // keys vector is empty before making this call;
2484 // otherwise, the new files will be appended to it.
2485 ////////////////////////////////////////////////////////////////////
2486 INLINE void NodePath::
2487 get_tag_keys(vector_string &keys) const {
2488  nassertv_always(!is_empty());
2489  node()->get_tag_keys(keys);
2490 }
2491 
2492 ////////////////////////////////////////////////////////////////////
2493 // Function: NodePath::has_tag
2494 // Access: Published
2495 // Description: Returns true if a value has been defined on this node
2496 // for the particular key (even if that value is the
2497 // empty string), or false if no value has been set.
2498 // See also has_net_tag().
2499 ////////////////////////////////////////////////////////////////////
2500 INLINE bool NodePath::
2501 has_tag(const string &key) const {
2502  // An empty NodePath quietly has no tags. This makes has_net_tag()
2503  // easier to implement.
2504  if (is_empty()) {
2505  return false;
2506  }
2507  return node()->has_tag(key);
2508 }
2509 
2510 ////////////////////////////////////////////////////////////////////
2511 // Function: NodePath::clear_tag
2512 // Access: Published
2513 // Description: Removes the value defined for this key on this
2514 // particular node. After a call to clear_tag(),
2515 // has_tag() will return false for the indicated key.
2516 ////////////////////////////////////////////////////////////////////
2517 INLINE void NodePath::
2518 clear_tag(const string &key) {
2519  nassertv_always(!is_empty());
2520  node()->clear_tag(key);
2521 }
2522 
2523 ////////////////////////////////////////////////////////////////////
2524 // Function: NodePath::get_net_tag
2525 // Access: Published
2526 // Description: Returns the tag value that has been defined on this
2527 // node, or the nearest ancestor node, for the indicated
2528 // key. If no value has been defined for the indicated
2529 // key on any ancestor node, returns the empty string.
2530 // See also get_tag().
2531 ////////////////////////////////////////////////////////////////////
2532 INLINE string NodePath::
2533 get_net_tag(const string &key) const {
2534  return find_net_tag(key).get_tag(key);
2535 }
2536 
2537 ////////////////////////////////////////////////////////////////////
2538 // Function: NodePath::has_net_tag
2539 // Access: Published
2540 // Description: Returns true if the indicated tag value has been
2541 // defined on this node or on any ancestor node, or
2542 // false otherwise. See also has_tag().
2543 ////////////////////////////////////////////////////////////////////
2544 INLINE bool NodePath::
2545 has_net_tag(const string &key) const {
2546  return !find_net_tag(key).is_empty();
2547 }
2548 
2549 ////////////////////////////////////////////////////////////////////
2550 // Function: NodePath::list_tags
2551 // Access: Published
2552 // Description: Lists the tags to the nout stream, one per line. See
2553 // PandaNode::list_tags() for a variant that allows you
2554 // to specify the output stream.
2555 ////////////////////////////////////////////////////////////////////
2556 INLINE void NodePath::
2557 list_tags() const {
2558  nassertv_always(!is_empty());
2559  node()->list_tags(nout);
2560  nout << "\n";
2561 }
2562 
2563 ////////////////////////////////////////////////////////////////////
2564 // Function: NodePath::set_name
2565 // Access: Published
2566 // Description: Changes the name of the referenced node.
2567 ////////////////////////////////////////////////////////////////////
2568 INLINE void NodePath::
2569 set_name(const string &name) {
2570  nassertv_always(!is_empty());
2571  node()->set_name(name);
2572 }
2573 
2574 ////////////////////////////////////////////////////////////////////
2575 // Function: NodePath::get_name
2576 // Access: Published
2577 // Description: Returns the name of the referenced node.
2578 ////////////////////////////////////////////////////////////////////
2579 INLINE string NodePath::
2580 get_name() const {
2581  nassertr_always(!is_empty(), string());
2582  return node()->get_name();
2583 }
2584 
2585 ////////////////////////////////////////////////////////////////////
2586 // Function: NodePath::encode_to_bam_stream
2587 // Access: Published
2588 // Description: Converts the NodePath object into a single
2589 // stream of data using a BamWriter, and returns that
2590 // data as a string string. Returns empty string on
2591 // failure. This is similar to write_bam_stream().
2592 //
2593 // This method is used by __reduce__ to handle streaming
2594 // of NodePaths to a pickle file.
2595 ////////////////////////////////////////////////////////////////////
2596 INLINE string NodePath::
2598  string data;
2599  if (!encode_to_bam_stream(data)) {
2600  return string();
2601  }
2602  return data;
2603 }
2604 
2605 
2606 INLINE ostream &operator << (ostream &out, const NodePath &node_path) {
2607  node_path.output(out);
2608  return out;
2609 }
2610 
void set_tag(const string &key, const string &value, Thread *current_thread=Thread::get_current_thread())
Associates a user-defined value with a user-defined key which is stored on the node.
Definition: pandaNode.cxx:1403
int get_num_children(Thread *current_thread=Thread::get_current_thread()) const
Returns the number of children of the referenced node.
Definition: nodePath.I:406
static const LMatrix4f & ident_mat()
Returns an identity matrix.
Definition: lmatrix.h:903
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
void adjust_all_priorities(int adjustment)
Adds the indicated adjustment amount (which may be negative) to the priority for all transitions on t...
Definition: nodePath.I:2186
static size_t add_hash(size_t start, const void *key)
Adds the indicated key into a running hash.
Definition: stl_compares.I:133
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...
Definition: nodePath.cxx:4384
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
Definition: internalName.h:197
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.
Definition: nodePath.I:916
void show_through()
Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits...
Definition: nodePath.I:2235
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...
Definition: nodePath.I:215
This is the base class for a number of render attributes (other than transform) that may be set on sc...
Definition: renderAttrib.h:60
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.
Definition: nodePath.I:905
static TypeHandle none()
Returns a special zero-valued TypeHandle that is used to indicate no type.
Definition: typeHandle.I:274
NodePath()
This constructs an empty NodePath with no nodes.
Definition: nodePath.I:22
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...
Definition: nodePath.I:2349
int get_pipeline_stage() const
Returns the Pipeline stage number associated with this thread.
Definition: thread.I:84
bool is_empty() const
Returns true if the NodePath contains no nodes.
Definition: nodePath.I:236
PN_stdfloat get_sb() const
Gets the blue scale component of the transform.
Definition: nodePath.I:1315
void set_effects(const RenderEffects *effects, Thread *current_thread=Thread::get_current_thread())
Sets the complete RenderEffects that will be applied this node.
Definition: pandaNode.cxx:1247
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...
Definition: nodePath.cxx:2536
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...
Definition: nodePath.cxx:5959
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
Definition: pandaNode.cxx:1544
void clear_tag(const string &key, Thread *current_thread=Thread::get_current_thread())
Removes the value defined for this key on this particular node.
Definition: pandaNode.cxx:1423
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 ...
Definition: nodePath.I:2412
bool has_tag(const string &key) const
Returns true if a value has been defined on this node for the particular key (even if that value is t...
Definition: nodePath.I:2501
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
Definition: nodePath.I:848
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...
Definition: nodePath.I:367
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition: texture.h:75
bool has_net_tag(const string &key) const
Returns true if the indicated tag value has been defined on this node or on any ancestor node...
Definition: nodePath.I:2545
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)...
Definition: nodePath.cxx:5872
void clear_tex_gen()
Removes the texture coordinate generation mode from all texture stages on this node.
Definition: nodePath.cxx:4146
PN_stdfloat get_distance(const NodePath &other) const
Returns the straight-line distance between this referenced node&#39;s coordinate frame&#39;s origin...
Definition: nodePath.I:1212
PN_stdfloat get_tex_rotate(TextureStage *stage) const
Returns the rotation set for the UV&#39;s for the given stage on the current node.
Definition: nodePath.I:1699
This is the base class for all two-component vectors and points.
Definition: lvecBase2.h:2360
const RenderEffects * get_effects() const
Returns the complete RenderEffects that will be applied to this node.
Definition: nodePath.I:686
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 ...
Definition: nodePath.I:388
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.
Definition: nodePath.I:270
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
void compose_color_scale(const LVecBase4 &scale, int priority=0)
multiplies the color scale component of the transform, with previous color scale leaving translation ...
Definition: nodePath.cxx:2392
void adjust_draw_mask(DrawMask show_mask, DrawMask hide_mask, DrawMask clear_mask)
Adjusts the hide/show bits of this particular node.
Definition: pandaNode.cxx:1932
int clear_model_nodes()
Recursively walks through the scene graph at this level and below, looking for ModelNodes, and calls model_node->set_preserve_transform(PT_drop_node) on each one.
Definition: nodePath.I:2434
static BitMask< PN_uint32, nbits > all_off()
Returns a BitMask whose bits are all off.
Definition: bitMask.I:86
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
This is a small container class that can hold any one of the value types that can be passed as input ...
Definition: shaderInput.h:41
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Definition: renderEffect.h:56
static const LVecBase2f & zero()
Returns a zero-length vector.
Definition: lvecBase2.h:359
PN_stdfloat get_sg() const
Gets the green scale component of the transform.
Definition: nodePath.I:1305
static const LVecBase3f & zero()
Returns a zero-length vector.
Definition: lvecBase3.h:382
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
Definition: nodePath.I:2202
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
Definition: nodePath.I:2487
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:3194
void clear_transform(Thread *current_thread=Thread::get_current_thread())
Sets the transform object on this node to identity.
Definition: nodePath.I:708
void set_tex_scale(TextureStage *stage, PN_stdfloat scale)
Sets a texture matrix on the current node to apply the indicated scale to UVW&#39;s for the given stage...
Definition: nodePath.I:1638
bool has_mat() const
Returns true if a non-identity transform matrix has been applied to the referenced node...
Definition: nodePath.I:952
NodePath find_net_tag(const string &key) const
Returns the lowest ancestor of this node that contains a tag definition with the indicated key...
Definition: nodePath.cxx:6388
void reverse_ls() const
Lists the hierarchy at and above the referenced node.
Definition: nodePath.I:516
void clear_effects()
Resets this node to have no render effects.
Definition: nodePath.I:697
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
Definition: nodePath.I:718
void set_effects(const RenderEffects *effects)
Sets the complete RenderEffects that will be applied this node.
Definition: nodePath.I:674
void set_tag(const string &key, const string &value)
Associates a user-defined value with a user-defined key which is stored on the node.
Definition: nodePath.I:2453
bool is_stashed() const
Returns true if the referenced node is stashed either directly, or because some ancestor is stashed...
Definition: nodePath.I:2312
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...
Definition: nodePath.I:77
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...
Definition: nodePath.I:583
void output(ostream &out) const
Writes a sensible description of the NodePath to the indicated output stream.
Definition: nodePath.cxx:820
int count_num_descendants() const
Returns the number of nodes at and below this level.
Definition: nodePath.I:433
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 ...
Definition: nodePath.I:2368
string get_tag(const string &key) const
Retrieves the user-defined value that was previously set on this node for the particular key...
Definition: nodePath.I:2467
int get_key() const
Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node i...
Definition: nodePath.I:307
PN_stdfloat get_sr() const
Gets the red scale component of the transform.
Definition: nodePath.I:1295
CollideMask get_collide_mask() const
Returns the union of all of the into_collide_masks for nodes at this level and below.
Definition: nodePath.I:2328
void set_sr(PN_stdfloat sr)
Sets the red scale component of the transform.
Definition: nodePath.I:1243
LVecBase3 get_tex_scale_3d(TextureStage *stage) const
Returns the scale set for the UVW&#39;s for the given stage on the current node.
Definition: nodePath.I:1842
bool operator<(const NodePath &other) const
Returns true if this NodePath sorts before the other one, false otherwise.
Definition: nodePath.I:2392
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...
Definition: nodePath.cxx:5990
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...
Definition: nodePath.I:993
void list_tags() const
Lists the tags to the nout stream, one per line.
Definition: nodePath.I:2557
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
Definition: nodePath.I:185
LVecBase2 get_tex_offset(TextureStage *stage) const
Returns the offset set for the UV&#39;s for the given stage on the current node.
Definition: nodePath.I:1684
static int get_max_search_depth()
Returns the current setting of the search depth limit.
Definition: nodePath.I:226
ErrorType get_error_type() const
If is_empty() is true, this returns a code that represents the reason why the NodePath is empty...
Definition: nodePath.I:259
bool has_effect(TypeHandle type) const
Returns true if there is a render effect of the indicated type defined on this node, or false if there is not.
Definition: nodePath.I:648
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...
Definition: nodePath.cxx:723
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
LVecBase3 get_tex_pos(TextureStage *stage) const
Returns the offset set for the UVW&#39;s for the given stage on the current node.
Definition: nodePath.I:1814
void clear_project_texture(TextureStage *stage)
Undoes the effect of project_texture().
Definition: nodePath.I:2119
void set_name(const string &name)
Changes the name of the referenced node.
Definition: nodePath.I:2569
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&#39;s for the given stage...
Definition: nodePath.I:1591
string get_name() const
Returns the name of the referenced node.
Definition: nodePath.I:2580
void clear_tag(const string &key)
Removes the value defined for this key on this particular node.
Definition: nodePath.I:2518
bool is_singleton(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the NodePath contains exactly one node.
Definition: nodePath.I:247
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Sets the complete RenderState that will be applied to all nodes at this level and below...
Definition: pandaNode.cxx:1216
PN_stdfloat get_sa() const
Gets the alpha scale component of the transform.
Definition: nodePath.I:1325
LVecBase3 get_tex_hpr(TextureStage *stage) const
Returns the 3-D HPR set for the UVW&#39;s for the given stage on the current node.
Definition: nodePath.I:1828
This is the base class for all two-component vectors and points.
Definition: lvecBase2.h:105
string get_net_tag(const string &key) const
Returns the tag value that has been defined on this node, or the nearest ancestor node...
Definition: nodePath.I:2533
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
Definition: pandaNode.cxx:1174
LVecBase3 get_hpr() const
Retrieves the rotation component of the transform.
Definition: nodePath.cxx:1253
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...
Definition: nodePath.I:796
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
Definition: nodePath.I:623
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...
Definition: pandaNode.cxx:2080
void clear_texture()
Completely removes any texture adjustment that may have been set via set_texture() or set_texture_off...
Definition: nodePath.cxx:3505
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...
Definition: nodePath.cxx:3926
void set_billboard_point_eye(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
Definition: nodePath.I:2158
void clear()
Sets this NodePath to the empty NodePath.
Definition: nodePath.I:146
LPoint3 get_pos() const
Retrieves the translation component of the transform.
Definition: nodePath.cxx:1178
void set_attrib(const RenderAttrib *attrib, int override=0)
Adds the indicated render attribute to the scene graph on this node.
Definition: pandaNode.cxx:1107
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:53
static NodePath removed()
Creates a NodePath with the ET_removed error type set.
Definition: nodePath.I:172
Represents a set of settings that indicate how a texture is sampled.
Definition: samplerState.h:39
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...
Definition: nodePath.I:344
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:2788
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...
Definition: nodePath.I:2145
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...
Definition: nodePath.I:879
static NodePath not_found()
Creates a NodePath with the ET_not_found error type set.
Definition: nodePath.I:159
void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the rotation component of the transform, leaving translation and scale untouched.
Definition: nodePath.I:822
bool has_texcoord(const string &texcoord_name) const
Returns true if there are at least some vertices at this node and below that use the named texture co...
Definition: nodePath.I:2134
bool has_attrib(TypeHandle type) const
Returns true if there is a render attribute of the indicated type defined on this node...
Definition: nodePath.I:596
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...
Definition: nodePath.I:2301
PandaNode * node() const
Returns the referenced node of the path.
Definition: nodePath.I:284
void clear_attrib(TypeHandle type)
Removes the render attribute of the given type from this node.
Definition: nodePath.I:610
void set_sa(PN_stdfloat sa)
Sets the alpha scale component of the transform.
Definition: nodePath.I:1282
bool operator!=(const NodePath &other) const
Returns true if the two paths are not equivalent.
Definition: nodePath.I:2378
A thread; that is, a lightweight process.
Definition: thread.h:51
bool has_parent(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the referenced node has a parent; i.e.
Definition: nodePath.I:447
void set_sb(PN_stdfloat sb)
Sets the blue scale component of the transform.
Definition: nodePath.I:1269
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
Definition: nodePath.I:660
LVecBase3 get_scale() const
Retrieves the scale component of the transform.
Definition: nodePath.cxx:1331
NodePath get_parent(Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath to the parent of the referenced node: that is, this NodePath, shortened by one node.
Definition: nodePath.I:460
LVecBase2 get_tex_scale(TextureStage *stage) const
Returns the scale set for the UV&#39;s for the given stage on the current node.
Definition: nodePath.I:1714
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...
Definition: nodePath.cxx:317
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&#39;s for the given stage...
Definition: nodePath.I:1728
string encode_to_bam_stream() const
Converts the NodePath object into a single stream of data using a BamWriter, and returns that data as...
Definition: nodePath.I:2597
void clear_mat()
Completely removes any transform from the referenced node.
Definition: nodePath.I:940
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
Definition: nodePath.I:965
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.
Definition: nodePath.I:927
size_t add_hash(size_t hash) const
Adds the NodePath into the running hash.
Definition: nodePath.I:330
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
Definition: pandaNode.cxx:1194
void set_sg(PN_stdfloat sg)
Sets the alpha scale component of the transform.
Definition: nodePath.I:1256
void set_prev_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Sets the transform that represents this node&#39;s "previous" position, one frame ago, for the purposes of detecting motion for accurate collision calculations.
Definition: pandaNode.cxx:1306
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
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...
Definition: nodePath.I:635
This is a 3-by-3 transform matrix.
Definition: lmatrix.h:110
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras...
Definition: nodePath.I:2270
void ls() const
Lists the hierarchy at and below the referenced node.
Definition: nodePath.I:492
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...
Definition: nodePath.I:1757
Defines the properties of a named stage of the multitexture pipeline.
Definition: textureStage.h:38
LVecBase3 get_shear() const
Retrieves the shear component of the transform.
Definition: nodePath.cxx:1383
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...
Definition: nodePath.I:1622
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Changes the complete state object on this node.
Definition: nodePath.I:543
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
Definition: renderEffects.h:46
NodePath get_child(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns a NodePath representing the nth child of the referenced node.
Definition: nodePath.I:418
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Sets the transform that will be applied to this node and below.
Definition: pandaNode.cxx:1267
void clear_tex_projector()
Removes the TexProjectorEffect for all stages from this node.
Definition: nodePath.cxx:4285
void set_color_scale(const LVecBase4 &scale, int priority=0)
Sets the color scale component of the transform, leaving translation and rotation untouched...
Definition: nodePath.cxx:2424
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...
Definition: nodePath.I:2170
This is one component of a NodePath.
void list_tags(ostream &out, const string &separator="\) const
Writes a list of all the tag keys assigned to the node to the indicated stream.
Definition: pandaNode.cxx:1505
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...
Definition: nodePath.I:981