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

pandatool/src/eggcharbase/eggCharacterCollection.I

Go to the documentation of this file.
00001 // Filename: eggCharacterCollection.I
00002 // Created by:  drose (26Feb01)
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 //     Function: EggCharacterCollection::get_num_eggs
00022 //       Access: Public
00023 //  Description: Returns the number of egg files that have
00024 //               successfully been added to the Character table.
00025 ////////////////////////////////////////////////////////////////////
00026 INLINE int EggCharacterCollection::
00027 get_num_eggs() const {
00028   return _eggs.size();
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: EggCharacterCollection::get_egg
00033 //       Access: Public
00034 //  Description: Returns the ith egg file.
00035 ////////////////////////////////////////////////////////////////////
00036 INLINE EggData *EggCharacterCollection::
00037 get_egg(int i) const {
00038   nassertr(i >= 0 && i < (int)_eggs.size(), (EggData *)NULL);
00039   return _eggs[i]._egg;
00040 }
00041 
00042 ////////////////////////////////////////////////////////////////////
00043 //     Function: EggCharacterCollection::get_first_model_index
00044 //       Access: Public
00045 //  Description: Returns the first model index associated with the
00046 //               indicated egg file.  An egg file may contain multiple
00047 //               models, which will be consecutive integers beginning
00048 //               at get_first_model_index() and continuing for
00049 //               get_num_models().
00050 //
00051 //               Each "model" corresponds to a single character model,
00052 //               or one LOD of a multiple-LOD model, or a single
00053 //               animation bundle.
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE int EggCharacterCollection::
00056 get_first_model_index(int egg_index) const {
00057   nassertr(egg_index >= 0 && egg_index < (int)_eggs.size(), 0);
00058   return _eggs[egg_index]._first_model_index;
00059 }
00060 
00061 ////////////////////////////////////////////////////////////////////
00062 //     Function: EggCharacterCollection::get_num_models
00063 //       Access: Public
00064 //  Description: Returns the number of different models found in the
00065 //               indicated egg file.  An egg file may contain multiple
00066 //               models, which will be consecutive integers beginning
00067 //               at get_first_model_index() and continuing for
00068 //               get_num_models().
00069 //
00070 //               Each "model" corresponds to a single character model,
00071 //               or one LOD of a multiple-LOD model, or a single
00072 //               animation bundle.
00073 ////////////////////////////////////////////////////////////////////
00074 INLINE int EggCharacterCollection::
00075 get_num_models(int egg_index) const {
00076   nassertr(egg_index >= 0 && egg_index < (int)_eggs.size(), 0);
00077   return _eggs[egg_index]._models.size();
00078 }
00079 
00080 ////////////////////////////////////////////////////////////////////
00081 //     Function: EggCharacterCollection::get_num_characters
00082 //       Access: Public
00083 //  Description: Returns the number of separate Characters that have
00084 //               been discovered in the various egg files added to the
00085 //               collection.
00086 ////////////////////////////////////////////////////////////////////
00087 INLINE int EggCharacterCollection::
00088 get_num_characters() const {
00089   return _characters.size();
00090 }
00091 
00092 ////////////////////////////////////////////////////////////////////
00093 //     Function: EggCharacterCollection::get_character
00094 //       Access: Public
00095 //  Description: Returns the ith character in the collection.
00096 ////////////////////////////////////////////////////////////////////
00097 INLINE EggCharacterData *EggCharacterCollection::
00098 get_character(int i) const {
00099   nassertr(i >= 0 && i < (int)_characters.size(), (EggCharacterData *)NULL);
00100   return _characters[i];
00101 }
00102 
00103 ////////////////////////////////////////////////////////////////////
00104 //     Function: EggCharacterCollection::get_character_by_model_index
00105 //       Access: Public
00106 //  Description: Returns the character associated with the indicated
00107 //               model index.
00108 ////////////////////////////////////////////////////////////////////
00109 INLINE EggCharacterData *EggCharacterCollection::
00110 get_character_by_model_index(int model_index) const {
00111   nassertr(model_index >= 0 && model_index < (int)_characters_by_model_index.size(),
00112            (EggCharacterData *)NULL);
00113   return _characters_by_model_index[model_index];
00114 }

Generated on Fri May 2 03:18:42 2003 for Panda-Tool by doxygen1.3