Changeset 6021 in orxonox.OLD for branches/newModel
- Timestamp:
- Dec 10, 2005, 7:52:50 PM (19 years ago)
- Location:
- branches/newModel/src
- Files:
-
- 24 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/newModel/src/lib/collision_detection/bounding_volume.h
r5688 r6021 9 9 10 10 #include "base_object.h" 11 #include " abstract_model.h"11 #include "model.h" 12 12 13 13 class Vector; -
branches/newModel/src/lib/collision_detection/bv_tree.h
r5684 r6021 10 10 11 11 #include "base_object.h" 12 #include " abstract_model.h"12 #include "model.h" 13 13 14 14 // FORWARD DECLARATION -
branches/newModel/src/lib/collision_detection/bv_tree_node.h
r5688 r6021 9 9 10 10 #include "base_object.h" 11 #include " abstract_model.h"11 #include "model.h" 12 12 #include "vector.h" 13 13 -
branches/newModel/src/lib/collision_detection/cd_engine.cc
r5915 r6021 21 21 #include "list.h" 22 22 23 #include " abstract_model.h"23 #include "model.h" 24 24 #include "world_entity.h" 25 25 #include "terrain.h" -
branches/newModel/src/lib/collision_detection/cd_engine.h
r5915 r6021 10 10 #include "base_object.h" 11 11 #include "collision_defs.h" 12 #include " abstract_model.h"12 #include "model.h" 13 13 14 14 -
branches/newModel/src/lib/collision_detection/obb_tree.h
r5684 r6021 9 9 10 10 #include "bv_tree.h" 11 #include " abstract_model.h"11 #include "model.h" 12 12 #include "material.h" 13 13 -
branches/newModel/src/lib/collision_detection/obb_tree_node.cc
r5694 r6021 21 21 #include "obb_tree.h" 22 22 #include "matrix.h" 23 #include " abstract_model.h"23 #include "model.h" 24 24 #include "world_entity.h" 25 25 -
branches/newModel/src/lib/graphics/importer/Makefile.am
r6010 r6021 4 4 noinst_LIBRARIES = libORXimporter.a 5 5 6 libORXimporter_a_SOURCES = abstract_model.cc \6 libORXimporter_a_SOURCES = model.cc \ 7 7 vertex_array_model.cc \ 8 model.cc \8 static_model.cc \ 9 9 objModel.cc \ 10 10 primitive_model.cc \ … … 16 16 17 17 18 noinst_HEADERS = abstract_model.h \18 noinst_HEADERS = model.h \ 19 19 vertex_array_model.h \ 20 model.h \20 static_model.h \ 21 21 objModel.h \ 22 22 primitive_model.h \ -
branches/newModel/src/lib/graphics/importer/md2Model.cc
r5284 r6021 160 160 161 161 /** 162 \brief draws the model: interface for all other classes out in the world 163 */ 162 * @brief draws the model: interface for all other classes out in the world 163 * @todo make it const and virtual 164 * FIXME 165 */ 164 166 void MD2Model::draw() 165 167 { -
branches/newModel/src/lib/graphics/importer/md2Model.h
r5304 r6021 19 19 #define _MD2MODEL_H 20 20 21 #include " abstract_model.h"21 #include "model.h" 22 22 #include "base_object.h" 23 23 #include "stdincl.h" … … 137 137 138 138 //! This is a MD2 Model class 139 class MD2Model : public AbstractModel {139 class MD2Model : public Model { 140 140 141 141 public: -
branches/newModel/src/lib/graphics/importer/model.cc
r6016 r6021 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MODEL 17 17 18 #include " abstract_model.h"18 #include "model.h" 19 19 20 20 using namespace std; 21 22 21 23 22 /** … … 25 24 * @todo this constructor is not jet implemented - do it 26 25 */ 27 AbstractModel::AbstractModel()26 Model::Model() 28 27 { 29 28 // this->setClassID(CL_PROTO_ID, "ProtoClass"); … … 42 41 * standard deconstructor 43 42 */ 44 AbstractModel::~AbstractModel()43 Model::~Model() 45 44 { 46 45 // delete what has to be deleted here -
branches/newModel/src/lib/graphics/importer/model.h
r6016 r6021 15 15 16 16 /*! 17 * @file abstract_model.h 18 * Definition of an abstract model. containing all needed for other model 17 * @file model.h 18 * Definition of an abstract model. 19 * containing all needed for other models 19 20 */ 20 21 21 #ifndef _ ABSTRACT_MODEL_H22 #define _ ABSTRACT_MODEL_H22 #ifndef _MODEL_H 23 #define _MODEL_H 23 24 24 25 #include "base_object.h" … … 125 126 126 127 //! This class defines the basic components of a model 127 class AbstractModel : public BaseObject {128 class Model : public BaseObject { 128 129 129 130 public: 130 AbstractModel(); 131 virtual ~AbstractModel(); 131 Model(); 132 virtual ~Model(); 133 134 virtual void draw() const { } 132 135 133 136 inline const modelInfo* getModelInfo() const { return &this->pModelInfo; } … … 158 161 }; 159 162 160 #endif /* _ ABSTRACT_MODEL_H */163 #endif /* _MODEL_H */ -
branches/newModel/src/lib/graphics/importer/objModel.cc
r5319 r6021 32 32 * @param scaling The factor that the model will be scaled with. 33 33 */ 34 OBJModel::OBJModel(const char* fileName, float scaling) : Model(fileName)34 OBJModel::OBJModel(const char* fileName, float scaling) : StaticModel(fileName) 35 35 { 36 36 this->objPath = "./"; -
branches/newModel/src/lib/graphics/importer/objModel.h
r4468 r6021 7 7 #define _OBJMODEL_H 8 8 9 #include " model.h"9 #include "static_model.h" 10 10 11 11 //! A Class, that handles the parsing of an obj-file, and inclusion as a Model. 12 class OBJModel : public Model12 class OBJModel : public StaticModel 13 13 { 14 14 public: -
branches/newModel/src/lib/graphics/importer/primitive_model.h
r5039 r6021 8 8 #define _PRIMITIVE_MODEL_H 9 9 10 #include " model.h"10 #include "static_model.h" 11 11 12 12 //! Specification of different primitives the Model knows … … 18 18 19 19 //! A Class to create some default Models 20 class PrimitiveModel : public Model {20 class PrimitiveModel : public StaticModel { 21 21 22 22 public: -
branches/newModel/src/lib/graphics/importer/static_model.cc
r6020 r6021 18 18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER 19 19 20 #include " model.h"20 #include "static_model.h" 21 21 22 22 #include "stdlibincl.h" … … 141 141 assigns it a Name and a Type 142 142 */ 143 Model::Model(const char* modelName, MODEL_TYPE type)143 StaticModel::StaticModel(const char* modelName, MODEL_TYPE type) 144 144 { 145 145 this->setClassID(CL_MODEL, "Model"); … … 174 174 Looks if any from model allocated space is still in use, and if so deleted it. 175 175 */ 176 Model::~Model()176 StaticModel::~StaticModel() 177 177 { 178 178 PRINTF(4)("Deleting Model "); … … 209 209 * Finalizes an Object. This can be done outside of the Class. 210 210 */ 211 void Model::finalize()211 void StaticModel::finalize() 212 212 { 213 213 // this creates the display List. … … 236 236 * rebuild the Model from the Information we got. 237 237 */ 238 void Model::rebuild()238 void StaticModel::rebuild() 239 239 { 240 240 PRINTF(3)("Rebuilding Model '%s'\n", this->getName()); … … 250 250 It does this by just calling the Lists that must have been created earlier. 251 251 */ 252 void Model::draw () const252 void StaticModel::draw () const 253 253 { 254 254 … … 295 295 It does this by just calling the List that must have been created earlier. 296 296 */ 297 void Model::draw (int groupNumber) const297 void StaticModel::draw (int groupNumber) const 298 298 { 299 299 if (groupNumber >= this->groupCount) … … 327 327 It does this by just calling the List that must have been created earlier. 328 328 */ 329 void Model::draw (char* groupName) const329 void StaticModel::draw (char* groupName) const 330 330 { 331 331 PRINTF(4)("drawing the requested 3D-Models if found.\n"); … … 351 351 * deletes all the arrays 352 352 */ 353 bool Model::deleteArrays()353 bool StaticModel::deleteArrays() 354 354 { 355 355 if (this->vertices) … … 375 375 * This will be applied at the end of the importing Process. 376 376 */ 377 bool Model::cleanup()377 bool StaticModel::cleanup() 378 378 { 379 379 PRINTF(4)("cleaning up the 3D-Model to save Memory.\n"); … … 393 393 * with this option set the Materials will not be deleted with the Model. 394 394 */ 395 Material* Model::addMaterial(Material* material)395 Material* StaticModel::addMaterial(Material* material) 396 396 { 397 397 if (material == NULL) … … 409 409 * @returns the added material 410 410 */ 411 Material* Model::addMaterial(const char* materialName)411 Material* StaticModel::addMaterial(const char* materialName) 412 412 { 413 413 ModelMaterial* modMat = new ModelMaterial; … … 425 425 * @returns the Material if found, NULL otherwise 426 426 */ 427 Material* Model::findMaterialByName(const char* materialName)427 Material* StaticModel::findMaterialByName(const char* materialName) 428 428 { 429 429 list<ModelMaterial*>::iterator modMat; … … 441 441 With it you should be able to create Models with more than one SubModel inside 442 442 */ 443 bool Model::addGroup(const char* groupString)443 bool StaticModel::addGroup(const char* groupString) 444 444 { 445 445 PRINTF(5)("Read Group: %s.\n", groupString); … … 464 464 If a vertex line is found this function will inject it into the vertex-Array 465 465 */ 466 bool Model::addVertex (const char* vertexString)466 bool StaticModel::addVertex (const char* vertexString) 467 467 { 468 468 float subbuffer1; … … 482 482 483 483 */ 484 bool Model::addVertex(float x, float y, float z)484 bool StaticModel::addVertex(float x, float y, float z) 485 485 { 486 486 PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z); … … 496 496 If a vertexNormal line is found this function will inject it into the vertexNormal-Array 497 497 */ 498 bool Model::addVertexNormal (const char* normalString)498 bool StaticModel::addVertexNormal (const char* normalString) 499 499 { 500 500 float subbuffer1; … … 515 515 If a vertexNormal line is found this function will inject it into the vertexNormal-Array 516 516 */ 517 bool Model::addVertexNormal(float x, float y, float z)517 bool StaticModel::addVertexNormal(float x, float y, float z) 518 518 { 519 519 PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z); … … 532 532 !! WARNING THIS IS DIFFERNT FROM addVervexTexture(float, float); because it changes the second entry to 1-v !! 533 533 */ 534 bool Model::addVertexTexture (const char* vTextureString)534 bool StaticModel::addVertexTexture (const char* vTextureString) 535 535 { 536 536 float subbuffer1; … … 550 550 If a TextureCoordinate line is found this function will inject it into the TextureCoordinate-Array 551 551 */ 552 bool Model::addVertexTexture(float u, float v)552 bool StaticModel::addVertexTexture(float u, float v) 553 553 { 554 554 PRINTF(5)("found vertex-Texture %f, %f\n", u, v); … … 567 567 String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0 568 568 */ 569 bool Model::addFace (const char* faceString)569 bool StaticModel::addFace (const char* faceString) 570 570 { 571 571 if (this->currentGroup->faceCount >0) … … 623 623 * @param type The information Passed with each Vertex 624 624 */ 625 bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...)625 bool StaticModel::addFace(int faceElemCount, VERTEX_FORMAT type, ...) 626 626 { 627 627 if (this->currentGroup->faceCount > 0) … … 655 655 * @param matString the Material that will be set. 656 656 */ 657 bool Model::setMaterial(const char* matString)657 bool StaticModel::setMaterial(const char* matString) 658 658 { 659 659 if (this->currentGroup->faceCount > 0) … … 670 670 * @param mtl the Material that will be set. 671 671 */ 672 bool Model::setMaterial(Material* mtl)672 bool StaticModel::setMaterial(Material* mtl) 673 673 { 674 674 if (this->currentGroup->faceCount > 0) … … 690 690 4. It goes through all the normale-Points and calculates the VertexNormale and includes it in the normals-Array. 691 691 */ 692 bool Model::buildVertexNormals ()692 bool StaticModel::buildVertexNormals () 693 693 { 694 694 PRINTF(4)("Normals are being calculated.\n"); … … 763 763 * reads and includes the Faces/Materials into the openGL state Machine 764 764 */ 765 bool Model::importToDisplayList()765 bool StaticModel::importToDisplayList() 766 766 { 767 767 // finalize the Arrays … … 855 855 * reads and includes the Faces/Materials into the openGL state Machine 856 856 */ 857 bool Model::importToVertexArray()857 bool StaticModel::importToVertexArray() 858 858 { 859 859 // finalize the Arrays … … 875 875 * builds an array of triangles, that can later on be used for obb separation and octree separation 876 876 */ 877 bool Model::buildTriangleList()877 bool StaticModel::buildTriangleList() 878 878 { 879 879 if( unlikely(this->triangles != NULL)) … … 1007 1007 merging this information, the face will be drawn. 1008 1008 */ 1009 bool Model::addGLElement (ModelFaceElement* elem)1009 bool StaticModel::addGLElement (ModelFaceElement* elem) 1010 1010 { 1011 1011 PRINTF(5)("importing grafical Element to openGL.\n"); … … 1043 1043 This will inject a Cube, because this is the most basic model. 1044 1044 */ 1045 void Model::cubeModel()1045 void StaticModel::cubeModel() 1046 1046 { 1047 1047 this->addVertex (-0.5, -0.5, 0.5); -
branches/newModel/src/lib/graphics/importer/static_model.h
r6020 r6021 1 1 /*! 2 \filemodel.h3 \brief Contains the Model Class that handles 3D-Models4 */5 6 #ifndef _ MODEL_H7 #define _ MODEL_H8 9 #include " abstract_model.h"2 * @file static_model.h 3 * @brief Contains the Model Class that handles Static 3D-Models rendered with glList's 4 */ 5 6 #ifndef _STATIC_MODEL_H 7 #define _STATIC_MODEL_H 8 9 #include "model.h" 10 10 11 11 #include "material.h" … … 103 103 /// MODEL /// 104 104 ///////////// 105 //! Class that handles 3D-Models. it can also read them in and display them. 106 class Model : public AbstractModel 107 { 108 public: 109 Model(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST); 110 virtual ~Model(); 111 112 void draw() const; 105 //! Class that handles static 3D-Models. 106 /** 107 * it can also read them in and display them. 108 * All the objects are rendered with glLists 109 */ 110 class StaticModel : public Model 111 { 112 public: 113 StaticModel(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST); 114 virtual ~StaticModel(); 115 116 virtual void draw() const; 113 117 void draw(int groupNumber) const; 114 118 void draw(char* groupName) const; … … 188 192 tArray<GLfloat>* normals; //!< The Array that handles the Normals. 189 193 tArray<GLfloat>* vTexture; //!< The Array that handles the VertexTextureCoordinates. 190 sTriangleExt* triangles; //!< The Array of triangles in the abstract_model.h style194 sTriangleExt* triangles; //!< The Array of triangles in the model.h style 191 195 192 196 ModelGroup* firstGroup; //!< The first of all groups. -
branches/newModel/src/lib/graphics/importer/vertex_array_model.h
r6012 r6021 7 7 #define _VERTEX_ARRAY_MODEL_H 8 8 9 #include " abstract_model.h"9 #include "model.h" 10 10 11 11 #include "glincl.h" … … 22 22 ///////////// 23 23 //! Class that handles 3D-Models. it can also read them in and display them. 24 class VertexArrayModel : public AbstractModel24 class VertexArrayModel : public Model 25 25 { 26 26 public: -
branches/newModel/src/lib/graphics/spatial_separation/quadtree.h
r5430 r6021 12 12 13 13 #include "base_object.h" 14 #include " abstract_model.h"14 #include "model.h" 15 15 16 16 -
branches/newModel/src/lib/graphics/spatial_separation/quadtree_node.cc
r5819 r6021 21 21 #include "quadtree.h" 22 22 #include "material.h" 23 #include " abstract_model.h"23 #include "model.h" 24 24 #include "debug.h" 25 25 … … 346 346 /** 347 347 * gets the maximal dimension of a model 348 * @return the dimension of the AbstractModel as a Rectangle348 * @return the dimension of the Model as a Rectangle 349 349 350 350 The rectangle is x-z axis aligned. ATTENTION: if there are any vertices in the model, that exceed the -
branches/newModel/src/lib/graphics/spatial_separation/quadtree_node.h
r5819 r6021 17 17 #include "base_object.h" 18 18 19 #include " abstract_model.h"19 #include "model.h" 20 20 21 21 // FORWARD DECLARATION -
branches/newModel/src/lib/graphics/spatial_separation/spatial_separation.cc
r5427 r6021 18 18 #include "spatial_separation.h" 19 19 20 #include " abstract_model.h"20 #include "model.h" 21 21 #include "quadtree.h" 22 22 #include "debug.h" … … 34 34 35 35 */ 36 SpatialSeparation::SpatialSeparation ( AbstractModel* model, float overlapSize)36 SpatialSeparation::SpatialSeparation (Model* model, float overlapSize) 37 37 { 38 38 PRINT(3)("+---------Debug Information SpatialSeparation----------\n"); … … 52 52 The boxes are overlaping because this makes collision detection a lot simpler 53 53 */ 54 SpatialSeparation::SpatialSeparation ( AbstractModel* model, AbstractModel* playerModel)54 SpatialSeparation::SpatialSeparation (Model* model, Model* playerModel) 55 55 { 56 56 this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation"); … … 75 75 * @return the new quadtree 76 76 */ 77 Quadtree* SpatialSeparation::createQuadtree( AbstractModel* model, float minLength)77 Quadtree* SpatialSeparation::createQuadtree(Model* model, float minLength) 78 78 { 79 79 this->minLength = minLength; … … 88 88 * @return the new quadtree 89 89 */ 90 Quadtree* SpatialSeparation::createQuadtree( AbstractModel* model, int treeDepth)90 Quadtree* SpatialSeparation::createQuadtree(Model* model, int treeDepth) 91 91 { 92 92 this->treeDepth = treeDepth; … … 100 100 * @return the new quadtree 101 101 */ 102 Quadtree* SpatialSeparation::createQuadtree( AbstractModel* model)102 Quadtree* SpatialSeparation::createQuadtree(Model* model) 103 103 { 104 104 this->quadtree = new Quadtree(model->getModelInfo(), 4); -
branches/newModel/src/lib/graphics/spatial_separation/spatial_separation.h
r5356 r6021 9 9 10 10 11 class AbstractModel;11 class Model; 12 12 class Quadtree; 13 13 … … 21 21 22 22 public: 23 SpatialSeparation( AbstractModel* model, float overlapSize);24 SpatialSeparation( AbstractModel* model, AbstractModel* playerModel);23 SpatialSeparation(Model* model, float overlapSize); 24 SpatialSeparation(Model* model, Model* playerModel); 25 25 virtual ~SpatialSeparation(); 26 26 … … 28 28 void setMinLength(int minLength) { this->minLength = minLength; } 29 29 30 Quadtree* createQuadtree( AbstractModel* model, float minLength);31 Quadtree* createQuadtree( AbstractModel* model, int treeDepth);32 Quadtree* createQuadtree( AbstractModel* model);30 Quadtree* createQuadtree(Model* model, float minLength); 31 Quadtree* createQuadtree(Model* model, int treeDepth); 32 Quadtree* createQuadtree(Model* model); 33 33 34 34 inline Quadtree* getQuadtree() { return this->quadtree; } … … 41 41 42 42 private: 43 AbstractModel* model; //!< the reference to the model that has to be handled43 Model* model; //!< the reference to the model that has to be handled 44 44 Quadtree* quadtree; //!< the reference to the created quadtree 45 45 46 AbstractModel* playerModel; //!< referece to the player model, if needed for overlap calculations46 Model* playerModel; //!< referece to the player model, if needed for overlap calculations 47 47 float overlapSize; //!< the size of overlaping 48 48 -
branches/newModel/src/world_entities/skybox.cc
r5994 r6021 20 20 #include "load_param.h" 21 21 #include "factory.h" 22 #include " model.h"23 22 #include "static_model.h" 23 #include "material.h" 24 24 25 25 using namespace std; … … 170 170 void SkyBox::rebuild() 171 171 { 172 Model* model = newModel();172 StaticModel* model = new StaticModel(); 173 173 174 174 model->addVertex (-0.5*size, -0.5*size, 0.5*size); -
branches/newModel/src/world_entities/terrain.cc
r5994 r6021 40 40 41 41 // if (this->model != NULL) 42 //this->ssp = new SpatialSeparation(( AbstractModel*)this->model, 10.0f);42 //this->ssp = new SpatialSeparation((Model*)this->model, 10.0f); 43 43 } 44 44 -
branches/newModel/src/world_entities/weapons/test_gun.cc
r5994 r6021 24 24 25 25 #include "world_entity.h" 26 #include " model.h"26 #include "static_model.h" 27 27 #include "test_bullet.h" 28 28 #include "weapon_manager.h" … … 219 219 if( this->leftRight == W_RIGHT) 220 220 glScalef(1.0, 1.0, -1.0); 221 this->getModel()->draw(1);221 static_cast<StaticModel*>(this->getModel())->draw(1); 222 222 glPopMatrix(); 223 223 … … 230 230 tmpRot = this->objectComponent1->getAbsDir().getSpacialAxis(); 231 231 glRotatef (this->objectComponent1->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 232 this->getModel()->draw(0);232 static_cast<StaticModel*>(this->getModel())->draw(0); 233 233 glPopMatrix(); 234 234 }
Note: See TracChangeset
for help on using the changeset viewer.