Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/egg/eggXfmSAnim.h

Go to the documentation of this file.
00001 // Filename: eggXfmSAnim.h
00002 // Created by:  drose (19Feb99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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 //       Class : EggXfmSAnim
00031 // Description : This corresponds to an <Xfm$Anim_S$> entry, which is
00032 //               a collection of up to nine <S$Anim> entries that
00033 //               specify the nine components of a transformation.
00034 //               It's implemented as a group that can contain
00035 //               any number of EggSAnimData children.
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 &copy);
00044   INLINE EggXfmSAnim &operator = (const EggXfmSAnim &copy);
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 

Generated on Fri May 2 00:38:06 2003 for Panda by doxygen1.3