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

EggCharacterData Class Reference

Represents a single character, as read and collected from several models and animation files. More...

#include <eggCharacterData.h>

Inheritance diagram for EggCharacterData:

Namable List of all members.

Public Member Functions

 EggCharacterData (EggCharacterCollection *collection)
virtual ~EggCharacterData ()
void add_model (int model_index, EggNode *model_root)
 Indicates that the given model_index (with the indicated model_root) is associated with this character.

int get_num_models () const
 Returns the total number of models associated with this character.

int get_model_index (int n) const
 Returns the model_index of the nth model associated with this character.

EggNodeget_model_root (int n) const
 Returns the model_root of the nth model associated with this character.

EggJointDataget_root_joint () const
 Returns the root joint of the character hierarchy.

EggJointDatafind_joint (const string &name) const
 Returns the first joint found with the indicated name, or NULL if no joint has that name.

EggSliderDatamake_slider (const string &name)
 Returns the slider matching the indicated name.

virtual void write (ostream &out, int indent_level=0) const
void set_name (const string &name)
void clear_name ()
bool has_name () const
const string & get_name () const
void output (ostream &out) const

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Types

typedef pvector< ModelModels
typedef pmap< string, EggSliderData * > Sliders

Protected Attributes

Models _models
EggCharacterCollection_collection
EggJointData_root_joint
Sliders _sliders
string _name

Static Protected Attributes

TypeHandle _type_handle

Detailed Description

Represents a single character, as read and collected from several models and animation files.

This contains a hierarchy of EggJointData nodes representing the skeleton, as well as a list of EggSliderData nodes representing the morph channels for the character.

This is very similar to the Character class from Panda, in that it's capable of associating skeleton-morph animation channels with models and calculating the vertex position for each frame. To some degree, it duplicates the functionality of Character. However, it differs in one fundamental principle: it is designed to be a non-real-time operation, working directly on the Egg structures as they are, instead of first boiling the Egg data into native Panda Geom tables for real-time animation. Because of this, it is (a) double-precision instead of single precision, (b) capable of generating modified Egg files, and (c) about a hundred times slower than the Panda Character class.

The data in this structure is normally filled in by the EggCharacterCollection class.

Definition at line 91 of file eggCharacterData.h.


Member Typedef Documentation

typedef pvector<Model> EggCharacterData::Models [protected]
 

Definition at line 114 of file eggCharacterData.h.

typedef pmap<string, EggSliderData *> EggCharacterData::Sliders [protected]
 

Definition at line 120 of file eggCharacterData.h.


Constructor & Destructor Documentation

EggCharacterData::EggCharacterData EggCharacterCollection collection  ) 
 

Definition at line 37 of file eggCharacterData.cxx.

References _root_joint, and _sliders.

EggCharacterData::~EggCharacterData  )  [virtual]
 

Definition at line 50 of file eggCharacterData.cxx.


Member Function Documentation

void EggCharacterData::add_model int  model_index,
EggNode model_root
 

Indicates that the given model_index (with the indicated model_root) is associated with this character.

This is normally called by the EggCharacterCollection class as new models are discovered.

A "model" here is either a character model (or one LOD of a character model), or a character animation file: in either case, a hierarchy of joints.

Definition at line 85 of file eggCharacterData.cxx.

EggJointData * EggCharacterData::find_joint const string &  name  )  const [inline]
 

Returns the first joint found with the indicated name, or NULL if no joint has that name.

Definition at line 135 of file eggCharacterData.I.

int EggCharacterData::get_model_index int  n  )  const [inline]
 

Returns the model_index of the nth model associated with this character.

This model_index may be used to ask questions about the particular model from the EggCharacterCollection object, or from the individual EggJointData and EggSliderData objects.

A "model" here is either a character model (or one LOD of a character model), or a character animation file: in either case, a hierarchy of joints.

Definition at line 72 of file eggCharacterData.I.

References _root_joint, and INLINE.

EggNode * EggCharacterData::get_model_root int  n  )  const [inline]
 

Returns the model_root of the nth model associated with this character.

This is the node at which the character, animation bundle, or LOD officially began within its particular egg file.

Definition at line 96 of file eggCharacterData.I.

int EggCharacterData::get_num_models  )  const [inline]
 

Returns the total number of models associated with this character.

A "model" here is either a character model (or one LOD of a character model), or a character animation file: in either case, a hierarchy of joints.

Definition at line 43 of file eggCharacterData.I.

References _models, INLINE, and nassertr.

EggJointData * EggCharacterData::get_root_joint  )  const [inline]
 

Returns the root joint of the character hierarchy.

This root joint does not represent an actual joint in the hierarchy, but instead is a fictitious joint that is the parent of all the top joints in the hierarchy (since the hierarchy may actually contain zero or more top joints).

Definition at line 120 of file eggCharacterData.I.

EggSliderData * EggCharacterData::make_slider const string &  name  ) 
 

Returns the slider matching the indicated name.

If no such slider exists already, creates a new one.

Definition at line 103 of file eggCharacterData.cxx.

References _sliders.

Referenced by EggCharacterCollection::scan_for_morphs(), EggCharacterCollection::scan_for_top_joints(), and EggCharacterCollection::scan_for_top_tables().

void EggCharacterData::write ostream &  out,
int  indent_level = 0
const [virtual]
 

Definition at line 124 of file eggCharacterData.cxx.


Member Data Documentation

EggCharacterCollection* EggCharacterData::_collection [protected]
 

Definition at line 117 of file eggCharacterData.h.

Models EggCharacterData::_models [protected]
 

Definition at line 115 of file eggCharacterData.h.

Referenced by get_num_models().

EggJointData* EggCharacterData::_root_joint [protected]
 

Definition at line 118 of file eggCharacterData.h.

Referenced by EggCharacterData(), and get_model_index().

Sliders EggCharacterData::_sliders [protected]
 

Definition at line 121 of file eggCharacterData.h.

Referenced by EggCharacterData(), and make_slider().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:26:08 2003 for Panda-Tool by doxygen1.3