00001 // Filename: eggMatrixTablePointer.h 00002 // Created by: drose (26Feb01) 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 EGGMATRIXTABLEPOINTER_H 00016 #define EGGMATRIXTABLEPOINTER_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "eggJointPointer.h" 00021 00022 #include "eggTable.h" 00023 #include "eggXfmSAnim.h" 00024 #include "pointerTo.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : EggMatrixTablePointer 00028 // Description : This stores a pointer back to an EggXfmSAnim table 00029 // (i.e. an <Xfm$Anim_S$> entry in an egg file), 00030 // corresponding to the animation data from a single 00031 // bundle for this joint. 00032 //////////////////////////////////////////////////////////////////// 00033 class EggMatrixTablePointer : public EggJointPointer { 00034 public: 00035 EggMatrixTablePointer(EggObject *object); 00036 00037 virtual double get_frame_rate() const; 00038 virtual int get_num_frames() const; 00039 virtual void extend_to(int num_frames); 00040 virtual LMatrix4d get_frame(int n) const; 00041 virtual void set_frame(int n, const LMatrix4d &mat); 00042 virtual bool add_frame(const LMatrix4d &mat); 00043 00044 virtual void do_finish_reparent(EggJointPointer *new_parent); 00045 00046 virtual bool do_rebuild(EggCharacterDb &db); 00047 00048 virtual void optimize(); 00049 virtual void zero_channels(const string &components); 00050 virtual void quantize_channels(const string &components, double quantum); 00051 00052 virtual EggJointPointer *make_new_joint(const string &name); 00053 00054 virtual void set_name(const string &name); 00055 00056 private: 00057 PT(EggTable) _table; 00058 PT(EggXfmSAnim) _xform; 00059 00060 public: 00061 static TypeHandle get_class_type() { 00062 return _type_handle; 00063 } 00064 static void init_type() { 00065 EggJointPointer::init_type(); 00066 register_type(_type_handle, "EggMatrixTablePointer", 00067 EggJointPointer::get_class_type()); 00068 } 00069 virtual TypeHandle get_type() const { 00070 return get_class_type(); 00071 } 00072 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #endif 00079 00080