2
0
Эх сурвалжийг харах

fix RopeNode and SheetNode (weren't rendering)

David Rose 17 жил өмнө
parent
commit
b0dd18aa3f

+ 15 - 0
panda/src/parametrics/ropeNode.cxx

@@ -186,6 +186,21 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: RopeNode::is_renderable
+//       Access: Public, Virtual
+//  Description: Returns true if there is some value to visiting this
+//               particular node during the cull traversal for any
+//               camera, false otherwise.  This will be used to
+//               optimize the result of get_net_draw_show_mask(), so
+//               that any subtrees that contain only nodes for which
+//               is_renderable() is false need not be visited.
+////////////////////////////////////////////////////////////////////
+bool RopeNode::
+is_renderable() const {
+  return true;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: RopeNode::output
 //       Access: Public, Virtual

+ 1 - 0
panda/src/parametrics/ropeNode.h

@@ -49,6 +49,7 @@ public:
 
   virtual bool safe_to_transform() const;
   virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
+  virtual bool is_renderable() const;
 
 PUBLISHED:
   enum RenderMode {

+ 15 - 0
panda/src/parametrics/sheetNode.cxx

@@ -163,6 +163,21 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SheetNode::is_renderable
+//       Access: Public, Virtual
+//  Description: Returns true if there is some value to visiting this
+//               particular node during the cull traversal for any
+//               camera, false otherwise.  This will be used to
+//               optimize the result of get_net_draw_show_mask(), so
+//               that any subtrees that contain only nodes for which
+//               is_renderable() is false need not be visited.
+////////////////////////////////////////////////////////////////////
+bool SheetNode::
+is_renderable() const {
+  return true;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: SheetNode::output
 //       Access: Public, Virtual

+ 1 - 0
panda/src/parametrics/sheetNode.h

@@ -47,6 +47,7 @@ public:
 
   virtual bool safe_to_transform() const;
   virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
+  virtual bool is_renderable() const;
 
 PUBLISHED:
   INLINE void set_surface(NurbsSurfaceEvaluator *surface);