00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ANIMCHANNELMATRIXDYNAMIC_H
00016 #define ANIMCHANNELMATRIXDYNAMIC_H
00017
00018 #include "pandabase.h"
00019
00020 #include "animChannel.h"
00021 #include "transformState.h"
00022 #include "pandaNode.h"
00023 #include "pointerTo.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_PANDA_CHAN AnimChannelMatrixDynamic : public AnimChannelMatrix {
00038 protected:
00039 AnimChannelMatrixDynamic();
00040 AnimChannelMatrixDynamic(AnimGroup *parent, const AnimChannelMatrixDynamic ©);
00041
00042 public:
00043 AnimChannelMatrixDynamic(const string &name);
00044
00045 virtual bool has_changed(int last_frame, double last_frac,
00046 int this_frame, double this_frac);
00047 virtual void get_value(int frame, LMatrix4 &mat);
00048
00049 virtual void get_value_no_scale_shear(int frame, LMatrix4 &value);
00050 virtual void get_scale(int frame, LVecBase3 &scale);
00051 virtual void get_hpr(int frame, LVecBase3 &hpr);
00052 virtual void get_quat(int frame, LQuaternion &quat);
00053 virtual void get_pos(int frame, LVecBase3 &pos);
00054 virtual void get_shear(int frame, LVecBase3 &shear);
00055
00056 PUBLISHED:
00057 void set_value(const LMatrix4 &value);
00058 void set_value(const TransformState *value);
00059 void set_value_node(PandaNode *node);
00060
00061 INLINE const TransformState *get_value_transform() const;
00062 INLINE PandaNode *get_value_node() const;
00063
00064 protected:
00065 virtual AnimGroup *make_copy(AnimGroup *parent) const;
00066
00067
00068 private:
00069
00070
00071
00072 PT(PandaNode) _value_node;
00073
00074 CPT(TransformState) _value;
00075 CPT(TransformState) _last_value;
00076
00077 public:
00078 static void register_with_read_factory();
00079 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00080 virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
00081 void fillin(DatagramIterator &scan, BamReader *manager);
00082
00083 static TypedWritable *make_AnimChannelMatrixDynamic(const FactoryParams ¶ms);
00084
00085 public:
00086 virtual TypeHandle get_type() const {
00087 return get_class_type();
00088 }
00089 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00090 static TypeHandle get_class_type() {
00091 return _type_handle;
00092 }
00093 static void init_type() {
00094 AnimChannelMatrix::init_type();
00095 register_type(_type_handle, "AnimChannelMatrixDynamic",
00096 AnimChannelMatrix::get_class_type());
00097 }
00098
00099 private:
00100 static TypeHandle _type_handle;
00101 };
00102
00103 #include "animChannelMatrixDynamic.I"
00104
00105 #endif