00001 // Filename: animBundle.h 00002 // Created by: drose (21Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef ANIMBUNDLE_H 00020 #define ANIMBUNDLE_H 00021 00022 #include "pandabase.h" 00023 00024 #include "animGroup.h" 00025 #include "pointerTo.h" 00026 00027 class FactoryParams; 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : AnimBundle 00031 // Description : This is the root of an AnimChannel hierarchy. It 00032 // knows the frame rate and number of frames of all the 00033 // channels in the hierarchy (which must all match). 00034 //////////////////////////////////////////////////////////////////// 00035 class EXPCL_PANDA AnimBundle : public AnimGroup { 00036 PUBLISHED: 00037 INLINE AnimBundle(const string &name, float fps, int num_frames); 00038 00039 INLINE double get_base_frame_rate() const; 00040 INLINE int get_num_frames() const; 00041 00042 virtual void output(ostream &out) const; 00043 00044 protected: 00045 INLINE AnimBundle(void); 00046 00047 float _fps; 00048 int _num_frames; 00049 00050 public: 00051 static void register_with_read_factory(void); 00052 virtual void write_datagram(BamWriter* manager, Datagram &me); 00053 00054 static TypedWritable *make_AnimBundle(const FactoryParams ¶ms); 00055 00056 protected: 00057 void fillin(DatagramIterator& scan, BamReader* manager); 00058 00059 public: 00060 00061 virtual TypeHandle get_type() const { 00062 return get_class_type(); 00063 } 00064 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00065 static TypeHandle get_class_type() { 00066 return _type_handle; 00067 } 00068 static void init_type() { 00069 AnimGroup::init_type(); 00070 register_type(_type_handle, "AnimBundle", 00071 AnimGroup::get_class_type()); 00072 } 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 inline ostream &operator <<(ostream &out, const AnimBundle &bundle) { 00079 bundle.output(out); 00080 return out; 00081 } 00082 00083 00084 #include "animBundle.I" 00085 00086 #endif