ソースを参照

a few minor fixes

David Rose 16 年 前
コミット
0d0db0fa16

+ 27 - 0
panda/src/pgraphnodes/sequenceNode.cxx

@@ -118,6 +118,21 @@ cull_callback(CullTraverser *, CullTraverserData &) {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SequenceNode::get_first_visible_child
+//       Access: Public, Virtual
+//  Description: Returns the index number of the first visible child
+//               of this node, or a number >= get_num_children() if
+//               there are no visible children of this node.  This is
+//               called during the cull traversal, but only if
+//               has_selective_visibility() has already returned true.
+//               See has_selective_visibility().
+////////////////////////////////////////////////////////////////////
+int SequenceNode::
+get_first_visible_child() const {
+  return get_frame();
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: SequenceNode::has_single_child_visibility
 //       Access: Public, Virtual
@@ -139,6 +154,18 @@ has_single_child_visibility() const {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SequenceNode::get_visible_child
+//       Access: Public, Virtual
+//  Description: Returns the index number of the currently visible
+//               child of this node.  This is only meaningful if
+//               has_single_child_visibility() has returned true.
+////////////////////////////////////////////////////////////////////
+int SequenceNode::
+get_visible_child() const {
+  return get_frame();
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: SequenceNode::output
 //       Access: Published, Virtual

+ 2 - 0
panda/src/pgraphnodes/sequenceNode.h

@@ -43,7 +43,9 @@ public:
   virtual bool safe_to_combine_children() const;
 
   virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
+  virtual int get_first_visible_child() const;
   virtual bool has_single_child_visibility() const;
+  virtual int get_visible_child() const;
 
   virtual void output(ostream &out) const;
 

+ 15 - 0
panda/src/pgraphnodes/switchNode.cxx

@@ -136,6 +136,21 @@ cull_callback(CullTraverser *, CullTraverserData &) {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SwitchNode::get_first_visible_child
+//       Access: Public, Virtual
+//  Description: Returns the index number of the first visible child
+//               of this node, or a number >= get_num_children() if
+//               there are no visible children of this node.  This is
+//               called during the cull traversal, but only if
+//               has_selective_visibility() has already returned true.
+//               See has_selective_visibility().
+////////////////////////////////////////////////////////////////////
+int SwitchNode::
+get_first_visible_child() const {
+  return get_visible_child();
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: SwitchNode::has_single_child_visibility
 //       Access: Public, Virtual

+ 1 - 0
panda/src/pgraphnodes/switchNode.h

@@ -36,6 +36,7 @@ public:
   virtual bool safe_to_combine_children() const;
 
   virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
+  virtual int get_first_visible_child() const;
   virtual bool has_single_child_visibility() const;
 
 PUBLISHED: