Panda3D

Loading...
Searching...
No Matches
eggCharacterCollection.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file eggCharacterCollection.I
10 * @author drose
11 * @date 2001-02-26
12 */
13
14/**
15 * Returns the number of egg files that have successfully been added to the
16 * Character table.
17 */
18INLINE int EggCharacterCollection::
19 get_num_eggs() const {
20 return _eggs.size();
21}
22
23/**
24 * Returns the ith egg file.
25 */
26INLINE EggData *EggCharacterCollection::
27 get_egg(int i) const {
28 nassertr(i >= 0 && i < (int)_eggs.size(), nullptr);
29 return _eggs[i]._egg;
30}
31
32/**
33 * Returns the first model index associated with the indicated egg file. An
34 * egg file may contain multiple models, which will be consecutive integers
35 * beginning at get_first_model_index() and continuing for get_num_models().
36 *
37 * Each "model" corresponds to a single character model, or one LOD of a
38 * multiple-LOD model, or a single animation bundle.
39 */
40INLINE int EggCharacterCollection::
41 get_first_model_index(int egg_index) const {
42 nassertr(egg_index >= 0 && egg_index < (int)_eggs.size(), 0);
43 return _eggs[egg_index]._first_model_index;
44}
45
46/**
47 * Returns the number of different models found in the indicated egg file. An
48 * egg file may contain multiple models, which will be consecutive integers
49 * beginning at get_first_model_index() and continuing for get_num_models().
50 *
51 * Each "model" corresponds to a single character model, or one LOD of a
52 * multiple-LOD model, or a single animation bundle.
53 */
54INLINE int EggCharacterCollection::
55 get_num_models(int egg_index) const {
56 nassertr(egg_index >= 0 && egg_index < (int)_eggs.size(), 0);
57 return _eggs[egg_index]._models.size();
58}
59
60/**
61 * Returns the number of separate Characters that have been discovered in the
62 * various egg files added to the collection.
63 */
64INLINE int EggCharacterCollection::
65 get_num_characters() const {
66 return _characters.size();
67}
68
69/**
70 * Returns the ith character in the collection.
71 */
72INLINE EggCharacterData *EggCharacterCollection::
73 get_character(int i) const {
74 nassertr(i >= 0 && i < (int)_characters.size(), nullptr);
75 return _characters[i];
76}
77
78/**
79 * Returns the character associated with the indicated model index.
80 */
81INLINE EggCharacterData *EggCharacterCollection::
82 get_character_by_model_index(int model_index) const {
83 nassertr(model_index >= 0 && model_index < (int)_characters_by_model_index.size(),
84 nullptr);
85 return _characters_by_model_index[model_index];
86}
87
88/**
89 *
90 */
91INLINE EggCharacterCollection::ModelDescription::
92ModelDescription() {
93 _root_node = nullptr;
94}
EggCharacterCollection::get_num_characters
int get_num_characters() const
Returns the number of separate Characters that have been discovered in the various egg files added to...
Definition eggCharacterCollection.I:65
EggCharacterCollection::get_num_models
int get_num_models(int egg_index) const
Returns the number of different models found in the indicated egg file.
Definition eggCharacterCollection.I:55
EggCharacterCollection::get_character_by_model_index
EggCharacterData * get_character_by_model_index(int model_index) const
Returns the character associated with the indicated model index.
Definition eggCharacterCollection.I:82
EggCharacterCollection::get_egg
EggData * get_egg(int i) const
Returns the ith egg file.
Definition eggCharacterCollection.I:27
EggCharacterCollection::get_character
EggCharacterData * get_character(int i) const
Returns the ith character in the collection.
Definition eggCharacterCollection.I:73
EggCharacterCollection::get_num_eggs
int get_num_eggs() const
Returns the number of egg files that have successfully been added to the Character table.
Definition eggCharacterCollection.I:19
EggCharacterCollection::get_first_model_index
int get_first_model_index(int egg_index) const
Returns the first model index associated with the indicated egg file.
Definition eggCharacterCollection.I:41
EggCharacterData
Represents a single character, as read and collected from several models and animation files.
Definition eggCharacterData.h:52
EggData
This is the primary interface into all the egg data, and the root of the egg file structure.
Definition eggData.h:37