Panda3D
 All Classes Functions Variables Enumerations
uvScrollNode.h
00001 // Filename: modelNode.h
00002 // Created by:  drose (16Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef UVSCROLLNODE_H
00016 #define UVSCROLLNODE_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "animInterface.h"
00021 #include "pandaNode.h"
00022 
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : UvScrollNode
00026 // Description : This node is placed at key points within the scene
00027 //               graph to animate uvs. 
00028 ////////////////////////////////////////////////////////////////////
00029 class EXPCL_PANDA_PGRAPH UvScrollNode : public PandaNode {
00030 PUBLISHED:
00031   INLINE UvScrollNode(const string &name, PN_stdfloat u_speed, PN_stdfloat v_speed, PN_stdfloat r_speed);
00032   INLINE UvScrollNode(const string &name);
00033 
00034 protected:
00035   INLINE UvScrollNode(const UvScrollNode &copy);
00036 
00037 public:
00038   virtual PandaNode *make_copy() const;
00039   virtual bool safe_to_flatten() const;
00040   virtual bool safe_to_combine() const;
00041   virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
00042 
00043 PUBLISHED:
00044   INLINE void set_u_speed(PN_stdfloat u_speed);
00045   INLINE void set_v_speed(PN_stdfloat v_speed);
00046   INLINE void set_r_speed(PN_stdfloat r_speed);
00047   INLINE PN_stdfloat get_u_speed() const;
00048   INLINE PN_stdfloat get_v_speed() const;
00049   INLINE PN_stdfloat get_r_speed() const;
00050   
00051 private:
00052   PN_stdfloat _u_speed;
00053   PN_stdfloat _v_speed;
00054   PN_stdfloat _r_speed;
00055 
00056   double _start_time;
00057 
00058 public:
00059   static void register_with_read_factory();
00060   virtual void write_datagram(BamWriter *manager, Datagram &dg);
00061 
00062 protected:
00063   static TypedWritable *make_from_bam(const FactoryParams &params);
00064   void fillin(DatagramIterator &scan, BamReader *manager);
00065 
00066 public:
00067   static TypeHandle get_class_type() {
00068     return _type_handle;
00069   }
00070   static void init_type() {
00071     PandaNode::init_type();
00072     register_type(_type_handle, "UvScrollNode",
00073                   PandaNode::get_class_type());
00074   }
00075   virtual TypeHandle get_type() const {
00076     return get_class_type();
00077   }
00078   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00079 
00080 private:
00081   static TypeHandle _type_handle;
00082 };
00083 
00084 #include "uvScrollNode.I"
00085 
00086 #endif
00087 
00088 
 All Classes Functions Variables Enumerations