00001 // Filename: eggCharacterData.I 00002 // Created by: drose (23Feb01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Function: EggCharacterData::get_num_models 00023 // Access: Public 00024 // Description: Returns the total number of models associated with 00025 // this character. 00026 // 00027 // A "model" here is either a character model (or one 00028 // LOD of a character model), or a character animation 00029 // file: in either case, a hierarchy of joints. 00030 //////////////////////////////////////////////////////////////////// 00031 INLINE int EggCharacterData:: 00032 get_num_models() const { 00033 return _models.size(); 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: EggCharacterData::get_model_index 00038 // Access: Public 00039 // Description: Returns the model_index of the nth model associated 00040 // with this character. This model_index may be used to 00041 // ask questions about the particular model from the 00042 // EggCharacterCollection object, or from the individual 00043 // EggJointData and EggSliderData objects. 00044 // 00045 // A "model" here is either a character model (or one 00046 // LOD of a character model), or a character animation 00047 // file: in either case, a hierarchy of joints. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE int EggCharacterData:: 00050 get_model_index(int n) const { 00051 nassertr(n >= 0 && n < (int)_models.size(), 0); 00052 return _models[n]._model_index; 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: EggCharacterData::get_model_root 00057 // Access: Public 00058 // Description: Returns the model_root of the nth model associated 00059 // with this character. 00060 // 00061 // This is the node at which the character, animation 00062 // bundle, or LOD officially began within its particular 00063 // egg file. 00064 //////////////////////////////////////////////////////////////////// 00065 INLINE EggNode *EggCharacterData:: 00066 get_model_root(int n) const { 00067 nassertr(n >= 0 && n < (int)_models.size(), (EggNode *)NULL); 00068 return _models[n]._model_root; 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: EggCharacterData::get_root_joint 00073 // Access: Public 00074 // Description: Returns the root joint of the character hierarchy. 00075 // This root joint does not represent an actual joint in 00076 // the hierarchy, but instead is a fictitious joint that 00077 // is the parent of all the top joints in the hierarchy 00078 // (since the hierarchy may actually contain zero or 00079 // more top joints). 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE EggJointData *EggCharacterData:: 00082 get_root_joint() const { 00083 return _root_joint; 00084 } 00085 00086 //////////////////////////////////////////////////////////////////// 00087 // Function: EggCharacterData::find_joint 00088 // Access: Public 00089 // Description: Returns the first joint found with the indicated 00090 // name, or NULL if no joint has that name. 00091 //////////////////////////////////////////////////////////////////// 00092 INLINE EggJointData *EggCharacterData:: 00093 find_joint(const string &name) const { 00094 return _root_joint->find_joint(name); 00095 }