Changeset 3398 in orxonox.OLD for orxonox/trunk/src/importer/model.cc
- Timestamp:
- Feb 6, 2005, 11:02:45 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/importer/model.cc
r3397 r3398 15 15 16 16 #include "model.h" 17 int verbose = 1; //! \todo should be GLOBAL 17 18 18 using namespace std; 19 19 20 20 /** 21 \brief Creates a 3D-Model, but does not load any 3D-models. 22 23 This Constructor is pretty useless, because why load no model in an model-loader?? 24 */ 25 Model::Model () 26 { 27 21 \brief Creates a 3D-Model. 22 23 This only initializes a 3D-Model, but does not cleanup the Faces. 24 */ 25 Model::Model(void) 26 { 28 27 this->initialize(); 29 30 this->BoxModel(); 28 } 29 30 /** 31 \brief Creates a 3D-Model of Primitive-Type type 32 33 if you want to just display a Cube/Sphere/Cylinder/... without any material. 34 35 \todo implement Cube/Sphere/Cylinder/... 36 */ 37 Model::Model(PRIMITIVE type) 38 { 39 this->initialize(); 40 41 if (type == CUBE) 42 this->BoxModel(); 31 43 32 44 this->importToGL (); … … 36 48 37 49 /** 50 \brief Creates a 3D-Model. and assigns it a Name. 51 */ 52 Model::Model(char* modelName) 53 { 54 this->initialize(); 55 this->setName(modelName); 56 } 57 58 /** 38 59 \brief deletes an Model. 39 60 40 61 Looks if any from model allocated space is still in use, and if so deleted it. 41 62 */ 42 Model::~Model( )63 Model::~Model(void) 43 64 { 44 65 PRINTF(3)("Deleting Model "); … … 64 85 if (this->material) 65 86 delete this->material; 87 } 88 89 /** 90 \brief Finalizes an Object. This can be done outside of the Class. 91 */ 92 void Model::finalize(void) 93 { 94 this->importToGL (); 95 96 this->cleanup(); 97 98 this->finalized = true; 66 99 } 67 100 … … 157 190 158 191 this->name = NULL; 192 this->finalized = false; 159 193 // setting the start group; 160 194 this->firstGroup = new Group; … … 173 207 } 174 208 209 void Model::setName(const char* name) 210 { 211 if (this->name) 212 delete this->name; 213 this->name = new char[strlen(name)+1]; 214 strcpy(this->name, name); 215 } 175 216 /** 176 217 \brief initializes a new Group model
Note: See TracChangeset
for help on using the changeset viewer.