00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EGGXFMSANIM_H
00020 #define EGGXFMSANIM_H
00021
00022
00023 #include <pandabase.h>
00024
00025 #include "eggGroupNode.h"
00026
00027 class EggXfmAnimData;
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_PANDAEGG EggXfmSAnim : public EggGroupNode {
00038 public:
00039 INLINE EggXfmSAnim(const string &name = "",
00040 CoordinateSystem cs = CS_default);
00041 EggXfmSAnim(const EggXfmAnimData &convert_from);
00042
00043 INLINE EggXfmSAnim(const EggXfmSAnim ©);
00044 INLINE EggXfmSAnim &operator = (const EggXfmSAnim ©);
00045
00046 INLINE void set_fps(double type);
00047 INLINE void clear_fps();
00048 INLINE bool has_fps() const;
00049 INLINE double get_fps() const;
00050
00051 INLINE void set_order(const string &order);
00052 INLINE void clear_order();
00053 INLINE bool has_order() const;
00054 INLINE const string &get_order() const;
00055 INLINE static const string &get_standard_order();
00056
00057 INLINE CoordinateSystem get_coordinate_system() const;
00058
00059 void optimize();
00060 void optimize_to_standard_order();
00061 void normalize();
00062
00063 int get_num_rows() const;
00064 void get_value(int row, LMatrix4d &mat) const;
00065 bool set_value(int row, const LMatrix4d &mat);
00066
00067 INLINE void clear_data();
00068 bool add_data(const LMatrix4d &mat);
00069
00070 virtual void write(ostream &out, int indent_level) const;
00071
00072 static void compose_with_order(LMatrix4d &mat,
00073 const LVecBase3d &scale,
00074 const LVecBase3d &hpr,
00075 const LVecBase3d &trans,
00076 const string &order,
00077 CoordinateSystem cs);
00078
00079 protected:
00080 virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
00081 CoordinateSystem to_cs);
00082 virtual void r_mark_coordsys(CoordinateSystem cs);
00083
00084 private:
00085 void normalize_by_rebuilding();
00086 void normalize_by_expanding();
00087
00088
00089 private:
00090 double _fps;
00091 bool _has_fps;
00092 string _order;
00093 CoordinateSystem _coordsys;
00094
00095 static string _standard_order;
00096
00097 public:
00098
00099 static TypeHandle get_class_type() {
00100 return _type_handle;
00101 }
00102 static void init_type() {
00103 EggGroupNode::init_type();
00104 register_type(_type_handle, "EggXfmSAnim",
00105 EggGroupNode::get_class_type());
00106 }
00107 virtual TypeHandle get_type() const {
00108 return get_class_type();
00109 }
00110 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00111
00112 private:
00113 static TypeHandle _type_handle;
00114 };
00115
00116 #include "eggXfmSAnim.I"
00117
00118 #endif
00119
00120