Panda3D
|
00001 // Filename: animChannelMatrixFixed.h 00002 // Created by: drose (19Jan06) 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 ANIMCHANNELMATRIXFIXED_H 00016 #define ANIMCHANNELMATRIXFIXED_H 00017 00018 #include "pandabase.h" 00019 00020 #include "animChannel.h" 00021 #include "luse.h" 00022 00023 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, AnimChannel<ACMatrixSwitchType>); 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : AnimChannelMatrixFixed 00027 // Description : A specialization on AnimChannel to add all the 00028 // special matrix component operations. 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDA_CHAN AnimChannelMatrixFixed : public AnimChannel<ACMatrixSwitchType> { 00031 protected: 00032 AnimChannelMatrixFixed(AnimGroup *parent, const AnimChannelMatrixFixed ©); 00033 00034 public: 00035 AnimChannelMatrixFixed(const string &name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale); 00036 00037 virtual bool has_changed(int last_frame, double last_frac, 00038 int this_frame, double this_frac); 00039 virtual void get_value(int frame, LMatrix4 &value); 00040 virtual void get_value_no_scale_shear(int frame, LMatrix4 &value); 00041 virtual void get_scale(int frame, LVecBase3 &scale); 00042 virtual void get_hpr(int frame, LVecBase3 &hpr); 00043 virtual void get_quat(int frame, LQuaternion &quat); 00044 virtual void get_pos(int frame, LVecBase3 &pos); 00045 virtual void get_shear(int frame, LVecBase3 &shear); 00046 00047 virtual void output(ostream &out) const; 00048 00049 private: 00050 LVecBase3 _pos, _hpr, _scale; 00051 00052 public: 00053 static void register_with_read_factory(); 00054 virtual void write_datagram(BamWriter *manager, Datagram &dg); 00055 00056 protected: 00057 static TypedWritable *make_from_bam(const FactoryParams ¶ms); 00058 void fillin(DatagramIterator &scan, BamReader *manager); 00059 00060 public: 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 AnimChannel<ACMatrixSwitchType>::init_type(); 00070 register_type(_type_handle, "AnimChannelMatrixFixed", 00071 AnimChannel<ACMatrixSwitchType>::get_class_type()); 00072 } 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #include "animChannelMatrixFixed.I" 00079 00080 #endif 00081 00082 00083