#include <eggCharacterCollection.h>
Public Types | |
typedef pvector< EggInfo > | Eggs |
typedef pvector< EggCharacterData * > | Characters |
Public Member Functions | |
EggCharacterCollection () | |
virtual | ~EggCharacterCollection () |
int | add_egg (EggData *egg) |
Adds a new egg file to the list of models and animation files for this particular character. | |
int | get_num_eggs () const |
Returns the number of egg files that have successfully been added to the Character table. | |
EggData * | get_egg (int i) const |
Returns the ith egg file. | |
int | get_first_model_index (int egg_index) const |
Returns the first model index associated with the indicated egg file. | |
int | get_num_models (int egg_index) const |
Returns the number of different models found in the indicated egg file. | |
int | get_num_characters () const |
Returns the number of separate Characters that have been discovered in the various egg files added to the collection. | |
EggCharacterData * | get_character (int i) const |
Returns the ith character in the collection. | |
EggCharacterData * | get_character_by_name (const string &character_name) const |
Returns the Character with the indicated name, if it exists in the collection, or NULL if it does not. | |
EggCharacterData * | get_character_by_model_index (int model_index) const |
Returns the character associated with the indicated model index. | |
virtual void | write (ostream &out, int indent_level=0) const |
virtual EggCharacterData * | make_character_data () |
Allocates and returns a new EggCharacterData structure. | |
virtual EggJointData * | make_joint_data (EggCharacterData *char_data) |
Allocates and returns a new EggJointData structure for the given character. | |
virtual EggSliderData * | make_slider_data (EggCharacterData *char_data) |
Allocates and returns a new EggSliderData structure for the given character. | |
EggCharacterData * | make_character (const string &character_name) |
Allocates and returns a new EggCharacterData object representing the named character, if there is not already a character by that name. | |
Public Attributes | |
Eggs | _eggs |
Characters | _characters |
Characters | _characters_by_model_index |
Private Types | |
typedef pvector< EggNode * > | EggNodeList |
typedef pmap< EggNode *, EggNodeList > | TopEggNodes |
typedef pmap< string, TopEggNodes > | TopEggNodesByName |
Private Member Functions | |
bool | scan_hierarchy (EggNode *egg_node) |
Walks the given egg data's hierarchy, looking for either the start of an animation channel or the start of a character model. | |
void | scan_for_top_joints (EggNode *egg_node, EggNode *model_root, const string &character_name) |
Once a character model has been found, continue scanning the egg hierarchy to look for the topmost nodes encountered. | |
void | scan_for_top_tables (EggTable *bundle, EggNode *model_root, const string &character_name) |
Once an animation has been found, continue scanning the egg hierarchy to look for the topmost. | |
void | scan_for_morphs (EggNode *egg_node, int model_index, EggCharacterData *char_data) |
Go back through a model's hierarchy and look for morph targets on the vertices and primitives. | |
void | scan_for_sliders (EggNode *egg_node, int model_index, EggCharacterData *char_data) |
Go back to the animation tables and look for morph slider animation channels. | |
void | add_morph_back_pointers (EggAttributes *attrib, EggObject *egg_object, int model_index, EggCharacterData *char_data) |
Adds the back pointers for the kinds of morphs we might find in an EggAttributes object. | |
void | match_egg_nodes (EggCharacterData *char_Data, EggJointData *joint_data, EggNodeList &egg_nodes, int egg_index, int model_index) |
Attempts to match up the indicated list of egg_nodes with the children of the given joint_data, by name if possible. | |
void | found_egg_match (EggCharacterData *char_data, EggJointData *joint_data, EggNode *egg_node, int egg_index, int model_index) |
Marks a one-to-one association between the indicated EggJointData and the indicated EggNode, and then recurses below. | |
Private Attributes | |
TopEggNodesByName | _top_egg_nodes |
int | _next_model_index |
Definition at line 47 of file eggCharacterCollection.h.
|
Definition at line 85 of file eggCharacterCollection.h. |
|
Definition at line 105 of file eggCharacterCollection.h. |
|
Definition at line 82 of file eggCharacterCollection.h. |
|
Definition at line 106 of file eggCharacterCollection.h. |
|
Definition at line 107 of file eggCharacterCollection.h. |
|
Definition at line 48 of file eggCharacterCollection.cxx. References _characters. |
|
Definition at line 60 of file eggCharacterCollection.cxx. References EggCharacterCollection::EggInfo::_egg, _eggs, _top_egg_nodes, and scan_hierarchy(). |
|
Adds a new egg file to the list of models and animation files for this particular character. Returns the new egg_index if the file is successfully added, or -1 if there is some problem (for instance, it does not contain a character model or animation table). If the joint hierarchy does not match the existing joint hierarchy, a best match is attempted. Definition at line 95 of file eggCharacterCollection.cxx. References _next_model_index. |
|
Adds the back pointers for the kinds of morphs we might find in an EggAttributes object.
Definition at line 491 of file eggCharacterCollection.cxx. Referenced by scan_for_top_joints(). |
|
Marks a one-to-one association between the indicated EggJointData and the indicated EggNode, and then recurses below.
Definition at line 682 of file eggCharacterCollection.cxx. Referenced by scan_for_sliders(). |
|
Returns the ith character in the collection.
Definition at line 138 of file eggCharacterCollection.I. |
|
Returns the character associated with the indicated model index.
Definition at line 154 of file eggCharacterCollection.I. |
|
Returns the Character with the indicated name, if it exists in the collection, or NULL if it does not.
Definition at line 154 of file eggCharacterCollection.cxx. |
|
Returns the ith egg file.
Definition at line 47 of file eggCharacterCollection.I. |
|
Returns the first model index associated with the indicated egg file. An egg file may contain multiple models, which will be consecutive integers beginning at get_first_model_index() and continuing for get_num_models(). Each "model" corresponds to a single character model, or one LOD of a multiple-LOD model, or a single animation bundle. Definition at line 77 of file eggCharacterCollection.I. References _eggs. |
|
Returns the number of separate Characters that have been discovered in the various egg files added to the collection.
Definition at line 125 of file eggCharacterCollection.I. |
|
Returns the number of egg files that have successfully been added to the Character table.
Definition at line 34 of file eggCharacterCollection.I. |
|
Returns the number of different models found in the indicated egg file. An egg file may contain multiple models, which will be consecutive integers beginning at get_first_model_index() and continuing for get_num_models(). Each "model" corresponds to a single character model, or one LOD of a multiple-LOD model, or a single animation bundle. Definition at line 107 of file eggCharacterCollection.I. References _characters_by_model_index, INLINE, nassertr, and NULL. |
|
Allocates and returns a new EggCharacterData object representing the named character, if there is not already a character by that name.
Definition at line 243 of file eggCharacterCollection.cxx. References EggGroupNode::begin(), DCAST, EggGroupNode::end(), EggGroupNode::iterator, and scan_hierarchy(). |
|
Allocates and returns a new EggCharacterData structure. This is primarily intended as a hook so derived classes can customize the type of EggCharacterData nodes used to represent the characters in this collection. Definition at line 184 of file eggCharacterCollection.cxx. |
|
Allocates and returns a new EggJointData structure for the given character. This is primarily intended as a hook so derived classes can customize the type of EggJointData nodes used to represent the joint hierarchy. Definition at line 205 of file eggCharacterCollection.cxx. References _characters. Referenced by scan_for_sliders(). |
|
Allocates and returns a new EggSliderData structure for the given character. This is primarily intended as a hook so derived classes can customize the type of EggSliderData nodes used to represent the slider list. Definition at line 226 of file eggCharacterCollection.cxx. References DCAST, EggGroup::DT_none, EggGroup::get_dart_type(), EggGroup::get_name(), and scan_for_top_joints(). |
|
Attempts to match up the indicated list of egg_nodes with the children of the given joint_data, by name if possible. Also recurses on each matched joint to build up the entire joint hierarchy. Definition at line 537 of file eggCharacterCollection.cxx. |
|
Go back through a model's hierarchy and look for morph targets on the vertices and primitives.
Definition at line 403 of file eggCharacterCollection.cxx. References EggAttributes::_dnormals, EggAttributes::_drgbas, EggAttributes::_duvs, EggSliderData::add_back_pointer(), EggMorphColor, EggMorphNormal, EggMorphTexCoord, and EggCharacterData::make_slider(). Referenced by scan_for_top_joints(). |
|
Go back to the animation tables and look for morph slider animation channels.
Definition at line 447 of file eggCharacterCollection.cxx. References EggJointData::_children, EggJointData::_parent, found_egg_match(), Namable::get_name(), EggNode::get_name(), and make_joint_data(). |
|
Once a character model has been found, continue scanning the egg hierarchy to look for the topmost nodes encountered.
Definition at line 329 of file eggCharacterCollection.cxx. References EggVertex::_dxyzs, EggSliderData::add_back_pointer(), add_morph_back_pointers(), EggGroupNode::begin(), EggPrimitive::begin(), EggPrimitive::const_iterator, DCAST, EggMorphVertex, EggGroupNode::end(), EggPrimitive::end(), EggGroupNode::get_class_type(), EggPrimitive::get_class_type(), EggNode::is_of_type(), EggGroupNode::iterator, EggCharacterData::make_slider(), and scan_for_morphs(). Referenced by make_slider_data(). |
|
Once an animation has been found, continue scanning the egg hierarchy to look for the topmost.
Definition at line 367 of file eggCharacterCollection.cxx. References EggSliderData::add_back_pointer(), EggTable::begin(), DCAST, EggTable::end(), EggSAnimData::get_class_type(), EggTable::get_class_type(), EggNode::get_name(), EggTable::get_name(), EggNode::is_of_type(), EggGroupNode::iterator, and EggCharacterData::make_slider(). |
|
Walks the given egg data's hierarchy, looking for either the start of an animation channel or the start of a character model. Returns true if either (or both) is found, false if the model appears to have nothing to do with characters. Fills up the _top_egg_nodes according to the nodes found. Definition at line 284 of file eggCharacterCollection.cxx. Referenced by make_character(), and ~EggCharacterCollection(). |
|
Definition at line 741 of file eggCharacterCollection.cxx. |
|
Definition at line 86 of file eggCharacterCollection.h. Referenced by EggCharacterCollection(), and make_joint_data(). |
|
Definition at line 87 of file eggCharacterCollection.h. Referenced by get_num_models(). |
|
Definition at line 83 of file eggCharacterCollection.h. Referenced by get_egg(), get_first_model_index(), get_num_eggs(), and ~EggCharacterCollection(). |
|
Definition at line 110 of file eggCharacterCollection.h. Referenced by add_egg(). |
|
Definition at line 108 of file eggCharacterCollection.h. Referenced by ~EggCharacterCollection(). |