Bläddra i källkod

expose some more stuff

David Rose 24 år sedan
förälder
incheckning
a24a77d19c

+ 1 - 1
panda/src/display/graphicsWindow.h

@@ -221,7 +221,7 @@ protected:
   Callback *_draw_callback;
   Callback *_draw_callback;
   Callback *_idle_callback;
   Callback *_idle_callback;
 
 
-public:
+PUBLISHED:
   virtual GraphicsChannel *get_channel(int index);
   virtual GraphicsChannel *get_channel(int index);
   void remove_channel(int index);
   void remove_channel(int index);
 
 

+ 19 - 0
panda/src/sgmanip/nodePath.cxx

@@ -2346,6 +2346,25 @@ set_material(Material *mat, int priority) {
   arc()->set_transition(mat_trans, priority);
   arc()->set_transition(mat_trans, priority);
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: NodePath::set_material_off
+//       Access: Published
+//  Description: Sets the geometry at this level and below to render
+//               using no material.  This is normally the default, but
+//               it may be useful to use this to contradict
+//               set_material() at a higher node level (or, with a
+//               priority, to override a set_material() at a lower
+//               level).
+////////////////////////////////////////////////////////////////////
+void NodePath::
+set_material_off(int priority) {
+  nassertv_always(has_arcs());
+
+  MaterialTransition *mat_trans =
+    new MaterialTransition(MaterialTransition::off());
+  arc()->set_transition(mat_trans, priority);
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: NodePath::has_material
 //     Function: NodePath::has_material
 //       Access: Published
 //       Access: Published

+ 1 - 0
panda/src/sgmanip/nodePath.h

@@ -470,6 +470,7 @@ PUBLISHED:
   Texture *get_texture() const;
   Texture *get_texture() const;
 
 
   void set_material(Material *tex, int priority = 0);
   void set_material(Material *tex, int priority = 0);
+  void set_material_off(int priority = 0);
   INLINE void clear_material();
   INLINE void clear_material();
   bool has_material() const;
   bool has_material() const;
   PT(Material) get_material() const;
   PT(Material) get_material() const;