|
|
|
Represents a single character, as read and collected from several models and animation files.
More...
#include "eggCharacterData.h"
List of all members.
Classes |
| class | Model |
Public Member Functions |
|
| EggCharacterData (EggCharacterCollection *collection) |
| void | add_model (int model_index, EggNode *model_root, EggData *egg_data) |
| | Indicates that the given model_index (with the indicated model_root) is associated with this character.
|
| bool | check_num_frames (int model_index) |
| | Walks through each component and ensures that all have the same number of frames of animation (except for those that contain 0 or 1 frames, of course).
|
| void | choose_optimal_hierarchy () |
| | Chooses the best possible parent joint for each of the joints in the hierarchy, based on the score computed by EggJointData::score_reparent_to().
|
| bool | do_reparent () |
| | Begins the process of restructuring the joint hierarchy according to the previous calls to reparent_to() on various joints.
|
| size_t | estimate_db_size () const |
| | Returns the estimated amount of memory, in megabytes, that will be required to perform the do_reparent() operation.
|
| EggJointData * | find_joint (const string &name) const |
| | Returns the first joint found with the indicated name, or NULL if no joint has that name.
|
| EggSliderData * | find_slider (const string &name) const |
| | Returns the slider with the indicated name, or NULL if no slider has that name.
|
| EggComponentData * | get_component (int n) const |
| | Returns the nth joint or slider in the character.
|
| EggData * | get_egg_data (int n) const |
| | Returns the EggData representing the egg file that defined this particular model.
|
| double | get_frame_rate (int model_index) const |
| | Returns the stated frame rate of the specified model.
|
| EggJointData * | get_joint (int n) const |
| | Returns the nth joint in the character joint hierarchy.
|
| int | get_model_index (int n) const |
| | Returns the model_index of the nth model associated with this character.
|
| EggNode * | get_model_root (int n) const |
| | Returns the model_root of the nth model associated with this character.
|
| int | get_num_components () const |
| | Returns the total number of joints and sliders in the character.
|
| int | get_num_frames (int model_index) const |
| | Returns the number of frames of animation of the indicated model.
|
| int | get_num_joints () const |
| | Returns the total number of joints in the character joint hierarchy.
|
| int | get_num_models () const |
| | Returns the total number of models associated with this character.
|
| int | get_num_sliders () const |
| | Returns the number of sliders in the character slider list.
|
| EggJointData * | get_root_joint () const |
| | Returns the root joint of the character hierarchy.
|
| EggSliderData * | get_slider (int n) const |
| | Returns the nth slider in the character slider list.
|
| EggJointData * | make_new_joint (const string &name, EggJointData *parent) |
| | Creates a new joint as a child of the indicated joint and returns it.
|
| EggSliderData * | make_slider (const string &name) |
| | Returns the slider matching the indicated name.
|
| void | rename_char (const string &name) |
| | Renames all of the models in the character data to the indicated name.
|
|
virtual void | write (ostream &out, int indent_level=0) const |
Friends |
|
class | EggCharacterCollection |
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 60 of file eggCharacterData.h.
Member Function Documentation
| void EggCharacterData::add_model |
( |
int |
model_index, |
|
|
EggNode * |
model_root, |
|
|
EggData * |
egg_data |
|
) |
| |
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 98 of file eggCharacterData.cxx.
Referenced by EggCharacterCollection::add_egg().
| bool EggCharacterData::check_num_frames |
( |
int |
model_index | ) |
|
| void EggCharacterData::choose_optimal_hierarchy |
( |
| ) |
|
| bool EggCharacterData::do_reparent |
( |
| ) |
|
| size_t EggCharacterData::estimate_db_size |
( |
| ) |
const |
| EggJointData * EggCharacterData::find_joint |
( |
const string & |
name | ) |
const [inline] |
| EggSliderData * EggCharacterData::find_slider |
( |
const string & |
name | ) |
const |
Returns the slider with the indicated name, or NULL if no slider has that name.
Definition at line 380 of file eggCharacterData.cxx.
Returns the nth joint or slider in the character.
This can be used to walk linearly through all joints and sliders in the character when you don't care about making a distinction between the two; it returns the same objects that can also be discovered via get_slider() and get_root_joint().
Definition at line 190 of file eggCharacterData.I.
| EggData * EggCharacterData::get_egg_data |
( |
int |
n | ) |
const [inline] |
| double EggCharacterData::get_frame_rate |
( |
int |
model_index | ) |
const |
| EggJointData * EggCharacterData::get_joint |
( |
int |
n | ) |
const [inline] |
| int EggCharacterData::get_model_index |
( |
int |
n | ) |
const [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 62 of file eggCharacterData.I.
| int EggCharacterData::get_num_components |
( |
| ) |
const [inline] |
Returns the total number of joints and sliders in the character.
Definition at line 175 of file eggCharacterData.I.
| int EggCharacterData::get_num_frames |
( |
int |
model_index | ) |
const |
| int EggCharacterData::get_num_joints |
( |
| ) |
const [inline] |
| 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 28 of file eggCharacterData.I.
Referenced by EggCharacterCollection::check_errors().
| int EggCharacterData::get_num_sliders |
( |
| ) |
const [inline] |
Returns the number of sliders in the character slider list.
Definition at line 153 of file eggCharacterData.I.
| EggJointData * EggCharacterData::get_root_joint |
( |
| ) |
const [inline] |
| EggSliderData * EggCharacterData::get_slider |
( |
int |
n | ) |
const [inline] |
Creates a new joint as a child of the indicated joint and returns it.
The new joint will be initialized to the identity transform, so that in inherits the net transform of the indicated parent joint.
Definition at line 115 of file eggCharacterData.I.
| EggSliderData * EggCharacterData::make_slider |
( |
const string & |
name | ) |
|
| void EggCharacterData::rename_char |
( |
const string & |
name | ) |
|
Renames all of the models in the character data to the indicated name.
This is the name that is used to identify unique skeleton hierarchies; if you set two different models to the same name, they will be loaded together as if they are expected to have the same skeleton hierarchy.
Definition at line 75 of file eggCharacterData.cxx.
The documentation for this class was generated from the following files:
| | |