00001 // Filename: eggXfmSAnim.I 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 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: EggXfmSAnim::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE EggXfmSAnim:: 00026 EggXfmSAnim(const string &name, CoordinateSystem cs) : EggGroupNode(name) { 00027 _has_fps = false; 00028 _coordsys = cs; 00029 } 00030 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: EggXfmSAnim::Copy constructor 00034 // Access: Public 00035 // Description: 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE EggXfmSAnim:: 00038 EggXfmSAnim(const EggXfmSAnim ©) 00039 : EggGroupNode(copy), 00040 _fps(copy._fps), 00041 _has_fps(copy._has_fps), 00042 _order(copy._order), 00043 _coordsys(copy._coordsys) { 00044 } 00045 00046 00047 //////////////////////////////////////////////////////////////////// 00048 // Function: EggXfmSAnim::Copy assignment operator 00049 // Access: Public 00050 // Description: 00051 //////////////////////////////////////////////////////////////////// 00052 INLINE EggXfmSAnim &EggXfmSAnim:: 00053 operator = (const EggXfmSAnim ©) { 00054 EggGroupNode::operator = (copy); 00055 _fps = copy._fps; 00056 _has_fps = copy._has_fps; 00057 _order = copy._order; 00058 _coordsys = copy._coordsys; 00059 00060 return *this; 00061 } 00062 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: EggXfmSAnim::set_fps 00066 // Access: Public 00067 // Description: 00068 //////////////////////////////////////////////////////////////////// 00069 INLINE void EggXfmSAnim:: 00070 set_fps(double fps) { 00071 _fps = fps; 00072 _has_fps = true; 00073 } 00074 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: EggXfmSAnim::clear_fps 00078 // Access: Public 00079 // Description: 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE void EggXfmSAnim:: 00082 clear_fps() { 00083 _has_fps = false; 00084 } 00085 00086 //////////////////////////////////////////////////////////////////// 00087 // Function: EggXfmSAnim::has_fps 00088 // Access: Public 00089 // Description: 00090 //////////////////////////////////////////////////////////////////// 00091 INLINE bool EggXfmSAnim:: 00092 has_fps() const { 00093 return _has_fps; 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: EggXfmSAnim::get_fps 00098 // Access: Public 00099 // Description: This is only valid if has_fps() returns true. 00100 //////////////////////////////////////////////////////////////////// 00101 INLINE double EggXfmSAnim:: 00102 get_fps() const { 00103 nassertr(has_fps(), 0.0); 00104 return _fps; 00105 } 00106 00107 //////////////////////////////////////////////////////////////////// 00108 // Function: EggXfmSAnim::set_order 00109 // Access: Public 00110 // Description: 00111 //////////////////////////////////////////////////////////////////// 00112 INLINE void EggXfmSAnim:: 00113 set_order(const string &order) { 00114 _order = order; 00115 } 00116 00117 //////////////////////////////////////////////////////////////////// 00118 // Function: EggXfmSAnim::clear_order 00119 // Access: Public 00120 // Description: 00121 //////////////////////////////////////////////////////////////////// 00122 INLINE void EggXfmSAnim:: 00123 clear_order() { 00124 _order = ""; 00125 } 00126 00127 //////////////////////////////////////////////////////////////////// 00128 // Function: EggXfmSAnim::has_order 00129 // Access: Public 00130 // Description: 00131 //////////////////////////////////////////////////////////////////// 00132 INLINE bool EggXfmSAnim:: 00133 has_order() const { 00134 return !_order.empty(); 00135 } 00136 00137 //////////////////////////////////////////////////////////////////// 00138 // Function: EggXfmSAnim::get_order 00139 // Access: Public 00140 // Description: 00141 //////////////////////////////////////////////////////////////////// 00142 INLINE const string &EggXfmSAnim:: 00143 get_order() const { 00144 if (has_order()) { 00145 return _order; 00146 } else { 00147 return get_standard_order(); 00148 } 00149 } 00150 00151 //////////////////////////////////////////////////////////////////// 00152 // Function: EggXfmSAnim::get_standard_order 00153 // Access: Public, Static 00154 // Description: Returns the standard order of matrix component 00155 // composition. This is what the order string must be 00156 // set to in order to use set_value() or add_data() 00157 // successfully. 00158 //////////////////////////////////////////////////////////////////// 00159 INLINE const string &EggXfmSAnim:: 00160 get_standard_order() { 00161 return _standard_order; 00162 } 00163 00164 //////////////////////////////////////////////////////////////////// 00165 // Function: EggXfmSAnim::get_coordinate_system 00166 // Access: Public 00167 // Description: Returns the coordinate system this table believes it 00168 // is defined within. This should always match the 00169 // coordinate system of the EggData structure that owns 00170 // it. It is necessary to store it here because the 00171 // meaning of the h, p, and r columns depends on the 00172 // coordinate system. 00173 //////////////////////////////////////////////////////////////////// 00174 INLINE CoordinateSystem EggXfmSAnim:: 00175 get_coordinate_system() const { 00176 return _coordsys; 00177 } 00178 00179 //////////////////////////////////////////////////////////////////// 00180 // Function: EggXfmSAnim::clear_data 00181 // Access: Public 00182 // Description: Removes all data from the table. It does this by 00183 // removing all of its children. 00184 //////////////////////////////////////////////////////////////////// 00185 INLINE void EggXfmSAnim:: 00186 clear_data() { 00187 EggGroupNode::clear(); 00188 }