Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2005, 7:52:50 PM (18 years ago)
Author:
bensch
Message:

newModel new static_model class added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/newModel/src/lib/graphics/importer/static_model.cc

    r6020 r6021  
    1818#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1919
    20 #include "model.h"
     20#include "static_model.h"
    2121
    2222#include "stdlibincl.h"
     
    141141   assigns it a Name and a Type
    142142*/
    143 Model::Model(const char* modelName, MODEL_TYPE type)
     143StaticModel::StaticModel(const char* modelName, MODEL_TYPE type)
    144144{
    145145  this->setClassID(CL_MODEL, "Model");
     
    174174   Looks if any from model allocated space is still in use, and if so deleted it.
    175175*/
    176 Model::~Model()
     176StaticModel::~StaticModel()
    177177{
    178178  PRINTF(4)("Deleting Model ");
     
    209209 *  Finalizes an Object. This can be done outside of the Class.
    210210*/
    211 void Model::finalize()
     211void StaticModel::finalize()
    212212{
    213213  // this creates the display List.
     
    236236 * rebuild the Model from the Information we got.
    237237 */
    238 void Model::rebuild()
     238void StaticModel::rebuild()
    239239{
    240240  PRINTF(3)("Rebuilding Model '%s'\n", this->getName());
     
    250250   It does this by just calling the Lists that must have been created earlier.
    251251*/
    252 void Model::draw () const
     252void StaticModel::draw () const
    253253{
    254254
     
    295295   It does this by just calling the List that must have been created earlier.
    296296*/
    297 void Model::draw (int groupNumber) const
     297void StaticModel::draw (int groupNumber) const
    298298{
    299299  if (groupNumber >= this->groupCount)
     
    327327   It does this by just calling the List that must have been created earlier.
    328328*/
    329 void Model::draw (char* groupName) const
     329void StaticModel::draw (char* groupName) const
    330330{
    331331  PRINTF(4)("drawing the requested 3D-Models if found.\n");
     
    351351 *  deletes all the arrays
    352352*/
    353 bool Model::deleteArrays()
     353bool StaticModel::deleteArrays()
    354354{
    355355  if (this->vertices)
     
    375375 * This will be applied at the end of the importing Process.
    376376*/
    377 bool Model::cleanup()
     377bool StaticModel::cleanup()
    378378{
    379379  PRINTF(4)("cleaning up the 3D-Model to save Memory.\n");
     
    393393 * with this option set the Materials will not be deleted with the Model.
    394394 */
    395 Material* Model::addMaterial(Material* material)
     395Material* StaticModel::addMaterial(Material* material)
    396396{
    397397  if (material == NULL)
     
    409409 * @returns the added material
    410410*/
    411 Material* Model::addMaterial(const char* materialName)
     411Material* StaticModel::addMaterial(const char* materialName)
    412412{
    413413  ModelMaterial* modMat = new ModelMaterial;
     
    425425 * @returns the Material if found, NULL otherwise
    426426*/
    427 Material* Model::findMaterialByName(const char* materialName)
     427Material* StaticModel::findMaterialByName(const char* materialName)
    428428{
    429429  list<ModelMaterial*>::iterator modMat;
     
    441441   With it you should be able to create Models with more than one SubModel inside
    442442*/
    443 bool Model::addGroup(const char* groupString)
     443bool StaticModel::addGroup(const char* groupString)
    444444{
    445445  PRINTF(5)("Read Group: %s.\n", groupString);
     
    464464   If a vertex line is found this function will inject it into the vertex-Array
    465465*/
    466 bool Model::addVertex (const char* vertexString)
     466bool StaticModel::addVertex (const char* vertexString)
    467467{
    468468  float subbuffer1;
     
    482482
    483483*/
    484 bool Model::addVertex(float x, float y, float z)
     484bool StaticModel::addVertex(float x, float y, float z)
    485485{
    486486  PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z);
     
    496496   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
    497497*/
    498 bool Model::addVertexNormal (const char* normalString)
     498bool StaticModel::addVertexNormal (const char* normalString)
    499499{
    500500  float subbuffer1;
     
    515515   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
    516516*/
    517 bool Model::addVertexNormal(float x, float y, float z)
     517bool StaticModel::addVertexNormal(float x, float y, float z)
    518518{
    519519  PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z);
     
    532532   !! WARNING THIS IS DIFFERNT FROM addVervexTexture(float, float); because it changes the second entry to 1-v !!
    533533*/
    534 bool Model::addVertexTexture (const char* vTextureString)
     534bool StaticModel::addVertexTexture (const char* vTextureString)
    535535{
    536536  float subbuffer1;
     
    550550   If a TextureCoordinate line is found this function will inject it into the TextureCoordinate-Array
    551551*/
    552 bool Model::addVertexTexture(float u, float v)
     552bool StaticModel::addVertexTexture(float u, float v)
    553553{
    554554  PRINTF(5)("found vertex-Texture %f, %f\n", u, v);
     
    567567   String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0
    568568*/
    569 bool Model::addFace (const char* faceString)
     569bool StaticModel::addFace (const char* faceString)
    570570{
    571571  if (this->currentGroup->faceCount >0)
     
    623623 * @param type The information Passed with each Vertex
    624624*/
    625 bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...)
     625bool StaticModel::addFace(int faceElemCount, VERTEX_FORMAT type, ...)
    626626{
    627627  if (this->currentGroup->faceCount > 0)
     
    655655 * @param matString the Material that will be set.
    656656*/
    657 bool Model::setMaterial(const char* matString)
     657bool StaticModel::setMaterial(const char* matString)
    658658{
    659659  if (this->currentGroup->faceCount > 0)
     
    670670 * @param mtl the Material that will be set.
    671671*/
    672 bool Model::setMaterial(Material* mtl)
     672bool StaticModel::setMaterial(Material* mtl)
    673673{
    674674  if (this->currentGroup->faceCount > 0)
     
    690690   4. It goes through all the normale-Points and calculates the VertexNormale and includes it in the normals-Array.
    691691*/
    692 bool Model::buildVertexNormals ()
     692bool StaticModel::buildVertexNormals ()
    693693{
    694694  PRINTF(4)("Normals are being calculated.\n");
     
    763763 *  reads and includes the Faces/Materials into the openGL state Machine
    764764*/
    765 bool Model::importToDisplayList()
     765bool StaticModel::importToDisplayList()
    766766{
    767767  // finalize the Arrays
     
    855855 *  reads and includes the Faces/Materials into the openGL state Machine
    856856*/
    857 bool Model::importToVertexArray()
     857bool StaticModel::importToVertexArray()
    858858{
    859859  // finalize the Arrays
     
    875875 *  builds an array of triangles, that can later on be used for obb separation and octree separation
    876876 */
    877 bool Model::buildTriangleList()
     877bool StaticModel::buildTriangleList()
    878878{
    879879  if( unlikely(this->triangles != NULL))
     
    10071007   merging this information, the face will be drawn.
    10081008*/
    1009 bool Model::addGLElement (ModelFaceElement* elem)
     1009bool StaticModel::addGLElement (ModelFaceElement* elem)
    10101010{
    10111011  PRINTF(5)("importing grafical Element to openGL.\n");
     
    10431043   This will inject a Cube, because this is the most basic model.
    10441044*/
    1045 void Model::cubeModel()
     1045void StaticModel::cubeModel()
    10461046{
    10471047  this->addVertex (-0.5, -0.5, 0.5);
Note: See TracChangeset for help on using the changeset viewer.