Panda3D
|
This is the base class of both EggJointData and EggSliderData. More...
#include "eggComponentData.h"
Public Member Functions | |
EggComponentData (EggCharacterCollection *collection, EggCharacterData *char_data) | |
virtual void | add_back_pointer (int model_index, EggObject *egg_object)=0 |
void | add_name (const string &name, NameUniquifier &uniquifier) |
Adds the indicated name to the set of names that this component can be identified with. | |
void | extend_to (int model_index, int num_frames) const |
Extends the number of frames in the indicated model (presumably an animation table model) to the given number. | |
virtual TypeHandle | force_init_type () |
double | get_frame_rate (int model_index) const |
Returns the number of frames of animation for this particular component in the indicated model. | |
EggBackPointer * | get_model (int model_index) const |
Returns the back pointer to an egg file for the indicated model if it exists, or NULL if it does not. | |
int | get_num_frames (int model_index) const |
Returns the number of frames of animation for this particular component in the indicated model. | |
int | get_num_models () const |
Returns the maximum number of back pointers this component may have. | |
virtual TypeHandle | get_type () const |
bool | has_model (int model_index) const |
Returns true if the component has a back pointer to an egg file somewhere for the indicated model, false otherwise. | |
bool | matches_name (const string &name) const |
Returns true if the indicated name matches any name that was ever matched with this particular joint, false otherwise. | |
void | set_model (int model_index, EggBackPointer *back) |
Sets the back_pointer associated with the given model_index. | |
virtual void | write (ostream &out, int indent_level=0) const =0 |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Protected Types | |
typedef pvector< EggBackPointer * > | BackPointers |
typedef pset< string > | Names |
Protected Attributes | |
BackPointers | _back_pointers |
EggCharacterData * | _char_data |
EggCharacterCollection * | _collection |
Names | _names |
This is the base class of both EggJointData and EggSliderData.
It represents a single component of a character, either a joint or a slider, along with back pointers to the references to this component in all model and animation egg files read.
Definition at line 37 of file eggComponentData.h.
void EggComponentData::add_name | ( | const string & | name, |
NameUniquifier & | uniquifier | ||
) |
Adds the indicated name to the set of names that this component can be identified with.
If this is the first name added, it becomes the primary name of the component; later names added do not replace the primary name, but do get added to the list of names that will be accepted by matched_name().
Definition at line 64 of file eggComponentData.cxx.
References NameUniquifier::add_name(), and Namable::has_name().
void EggComponentData::extend_to | ( | int | model_index, |
int | num_frames | ||
) | const |
Extends the number of frames in the indicated model (presumably an animation table model) to the given number.
Definition at line 115 of file eggComponentData.cxx.
References EggBackPointer::extend_to(), and get_model().
Referenced by EggCharacterData::check_num_frames().
double EggComponentData::get_frame_rate | ( | int | model_index | ) | const |
Returns the number of frames of animation for this particular component in the indicated model.
Definition at line 128 of file eggComponentData.cxx.
References EggBackPointer::get_frame_rate(), and get_model().
Referenced by EggCharacterData::get_frame_rate().
EggBackPointer * EggComponentData::get_model | ( | int | model_index | ) | const [inline] |
Returns the back pointer to an egg file for the indicated model if it exists, or NULL if it does not.
Definition at line 53 of file eggComponentData.I.
Referenced by EggSliderData::add_back_pointer(), EggJointData::do_compute_reparent(), EggJointData::do_finish_reparent(), EggJointData::do_joint_rebuild(), extend_to(), EggJointData::force_initial_rest_frame(), EggSliderData::get_frame(), EggJointData::get_frame(), get_frame_rate(), EggJointData::get_net_frame(), EggJointData::get_net_frame_inv(), get_num_frames(), EggJointData::move_vertices_to(), EggRetargetAnim::retarget_anim(), EggJointData::score_reparent_to(), and EggTopstrip::strip_anim().
int EggComponentData::get_num_frames | ( | int | model_index | ) | const |
Returns the number of frames of animation for this particular component in the indicated model.
Definition at line 99 of file eggComponentData.cxx.
References get_model().
Referenced by EggCharacterData::check_num_frames(), EggCharacterData::get_num_frames(), and EggJointData::score_reparent_to().
int EggComponentData::get_num_models | ( | ) | const [inline] |
Returns the maximum number of back pointers this component may have.
The component may store a back pointer for models indexed 0 .. num_models - 1. You must call has_model() on each model index to confirm whether a particular model in that range has a back pointer.
Definition at line 27 of file eggComponentData.I.
Referenced by EggJointData::do_finish_reparent(), EggJointData::force_initial_rest_frame(), EggJointData::move_vertices_to(), EggRetargetAnim::retarget_anim(), EggJointData::score_reparent_to(), and EggTopstrip::strip_anim().
bool EggComponentData::has_model | ( | int | model_index | ) | const [inline] |
Returns true if the component has a back pointer to an egg file somewhere for the indicated model, false otherwise.
Definition at line 39 of file eggComponentData.I.
Referenced by EggJointData::apply_default_pose(), EggJointData::do_finish_reparent(), EggJointData::do_joint_rebuild(), EggJointData::force_initial_rest_frame(), EggJointData::move_vertices_to(), EggRetargetAnim::retarget_anim(), EggTopstrip::strip_anim(), and EggTopstrip::strip_anim_vertices().
static void EggComponentData::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from EggObject.
Reimplemented in EggJointData, and EggSliderData.
Definition at line 76 of file eggComponentData.h.
bool EggComponentData::matches_name | ( | const string & | name | ) | const |
Returns true if the indicated name matches any name that was ever matched with this particular joint, false otherwise.
Definition at line 85 of file eggComponentData.cxx.
void EggComponentData::set_model | ( | int | model_index, |
EggBackPointer * | back | ||
) |
Sets the back_pointer associated with the given model_index.
Definition at line 143 of file eggComponentData.cxx.
Referenced by EggSliderData::add_back_pointer(), and EggJointData::add_back_pointer().