From b0dd18aa3fbbd2a9d6e95d9a0c39ecc389028271 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 8 Jan 2009 03:26:09 +0000 Subject: [PATCH] fix RopeNode and SheetNode (weren't rendering) --- panda/src/parametrics/ropeNode.cxx | 15 +++++++++++++++ panda/src/parametrics/ropeNode.h | 1 + panda/src/parametrics/sheetNode.cxx | 15 +++++++++++++++ panda/src/parametrics/sheetNode.h | 1 + 4 files changed, 32 insertions(+) diff --git a/panda/src/parametrics/ropeNode.cxx b/panda/src/parametrics/ropeNode.cxx index ac02eac62c..87c722b388 100644 --- a/panda/src/parametrics/ropeNode.cxx +++ b/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 diff --git a/panda/src/parametrics/ropeNode.h b/panda/src/parametrics/ropeNode.h index d2679ed0f6..1d5695e814 100644 --- a/panda/src/parametrics/ropeNode.h +++ b/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 { diff --git a/panda/src/parametrics/sheetNode.cxx b/panda/src/parametrics/sheetNode.cxx index a4abc5ba4f..092c2056d7 100644 --- a/panda/src/parametrics/sheetNode.cxx +++ b/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 diff --git a/panda/src/parametrics/sheetNode.h b/panda/src/parametrics/sheetNode.h index 6211679a97..693d35c154 100644 --- a/panda/src/parametrics/sheetNode.h +++ b/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);