00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ANIMCHANNELMATRIXXFMTABLE_H
00020 #define ANIMCHANNELMATRIXXFMTABLE_H
00021
00022 #include <pandabase.h>
00023
00024 #include "animChannel.h"
00025
00026 #include <pointerToArray.h>
00027 #include <pta_float.h>
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_PANDA AnimChannelMatrixXfmTable : public AnimChannelMatrix {
00038 public:
00039 AnimChannelMatrixXfmTable(AnimGroup *parent, const string &name);
00040
00041 virtual bool has_changed(int last_frame, int this_frame);
00042 virtual void get_value(int frame, LMatrix4f &mat);
00043 virtual void get_value_no_scale(int frame, LMatrix4f &value);
00044 virtual void get_scale(int frame, float scale[3]);
00045
00046 static INLINE bool is_valid_id(char table_id);
00047
00048 void clear_all_tables();
00049 void set_table(char table_id, const CPTA_float &table);
00050 INLINE bool has_table(char table_id) const;
00051 INLINE CPTA_float get_table(char table_id) const;
00052 INLINE void clear_table(char table_id);
00053
00054 virtual void write(ostream &out, int indent_level) const;
00055
00056 protected:
00057 AnimChannelMatrixXfmTable(void);
00058 INLINE static char get_table_id(int table_index);
00059 static int get_table_index(char table_id);
00060 INLINE static float get_default_value(int table_index);
00061
00062 enum { num_tables = 9 };
00063
00064 CPTA_float _tables[num_tables];
00065
00066 private:
00067 static const char _table_ids[num_tables];
00068 static const float _default_values[num_tables];
00069
00070 public:
00071 static void register_with_read_factory(void);
00072 virtual void write_datagram(BamWriter* manager, Datagram &me);
00073
00074 static TypedWritable *make_AnimChannelMatrixXfmTable(const FactoryParams ¶ms);
00075
00076 protected:
00077 void fillin(DatagramIterator& scan, BamReader* manager);
00078
00079 public:
00080 virtual TypeHandle get_type() const {
00081 return get_class_type();
00082 }
00083 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00084 static TypeHandle get_class_type() {
00085 return _type_handle;
00086 }
00087 static void init_type() {
00088 AnimChannelMatrix::init_type();
00089 register_type(_type_handle, "AnimChannelMatrixXfmTable",
00090 AnimChannelMatrix::get_class_type());
00091 }
00092
00093 private:
00094 static TypeHandle _type_handle;
00095 };
00096
00097 #include "animChannelMatrixXfmTable.I"
00098
00099 #endif