15 #include "xFileAnimationSet.h" 16 #include "xFileToEggConverter.h" 17 #include "config_xfile.h" 21 #include "eggXfmSAnim.h" 40 ~XFileAnimationSet() {
57 bundle->set_table_type(EggTable::TT_bundle);
65 mirror_table(converter, converter->
get_dart_node(), skeleton);
68 JointData::const_iterator ji;
69 for (ji = _joint_data.begin(); ji != _joint_data.end(); ++ji) {
70 const string &joint_name = (*ji).first;
76 <<
"Frame " << joint_name <<
", named by animation data, not defined.\n";
79 FrameEntries::const_iterator fi;
80 for (fi = table._entries.begin(); fi != table._entries.end(); ++fi) {
81 anim_table->
add_data((*fi).get_mat(table._flags));
89 for (ti = _tables.begin(); ti != _tables.end(); ++ti) {
91 EggGroup *joint = (*ti).second._joint;
92 if (anim_table->empty() && joint != (
EggGroup *)NULL) {
97 if (_frame_rate != 0.0) {
98 anim_table->set_fps(_frame_rate);
113 Tables::const_iterator ti;
114 ti = _tables.find(joint_name);
115 if (ti != _tables.end()) {
116 return (*ti).second._table;
129 return _joint_data[joint_name];
140 void XFileAnimationSet::
143 EggGroupNode::iterator gi;
144 for (gi = model_node->begin(); gi != model_node->end(); ++gi) {
146 if (child->
is_of_type(EggGroup::get_class_type())) {
148 if (group->get_group_type() == EggGroup::GT_joint) {
152 CoordinateSystem cs =
156 xform->set_fps(converter->_frame_rate);
157 TablePair &table_pair = _tables[group->get_name()];
158 table_pair._table = xform;
159 table_pair._joint = group;
162 mirror_table(converter, group, new_table);
166 mirror_table(converter, group, anim_node);
EggGroup * get_dart_node() const
Returns the root of the joint hierarchy, if _make_char is true, or NULL otherwise.
bool add_data(const LMatrix4d &mat)
Adds a new matrix to the table, by adding a new row to each of the subtables.
FrameData & create_frame_data(const string &joint_name)
Returns a reference to a new FrameData table corresponding to the indicated joint.
EggXfmSAnim * get_table(const string &joint_name) const
Returns the table associated with the indicated joint name.
bool create_hierarchy(XFileToEggConverter *converter)
Sets up the hierarchy of EggTables corresponding to this AnimationSet.
CoordinateSystem get_coordinate_system() const
Returns the coordinate system in which the egg file is defined.
EggData * get_egg_data()
Returns the EggData structure.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that...
void optimize()
Optimizes the table by collapsing redundant sub-tables.
EggNode * add_child(EggNode *node)
Adds the indicated child to the group and returns it.
A base class for things that may be directly added into the egg hierarchy.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.