Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7055 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Feb 6, 2006, 2:52:14 PM (19 years ago)
Author:
patrick
Message:

trunk: md2 scaling patch

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/md2Model.cc

    r6645 r7055  
    7575  \brief simple constructor initializing all variables
    7676*/
    77 MD2Model::MD2Model(const char* modelFileName, const char* skinFileName)
     77MD2Model::MD2Model(const char* modelFileName, const char* skinFileName, float scale)
    7878{
    7979  /* this creates the data container via ressource manager */
     
    8282    PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n");
    8383
     84  this->data->scaleFactor = scaleFactor;
    8485  this->scaleFactor = this->data->scaleFactor;
    8586
  • trunk/src/lib/graphics/importer/md2Model.h

    r6222 r7055  
    178178{
    179179 public:
    180   MD2Data(const char* modelFileName, const char* skinFileName);
     180   MD2Data(const char* modelFileName, const char* skinFileName);
    181181  virtual ~MD2Data();
    182182
     
    212212
    213213public:
    214   MD2Model(const char* modelFileName, const char* skinFileName = NULL);
     214  MD2Model(const char* modelFileName, const char* skinFileName = NULL, float scale = 1.0f);
    215215  virtual ~MD2Model();
    216216
  • trunk/src/world_entities/terrain.cc

    r7046 r7055  
    4343{
    4444  this->init();
     45
     46
    4547  if( root != NULL)
    4648    this->loadParams(root);
    47 
    48    this->heightMapMaterial = new Material();
    49    heightMapMaterial->setTransparency(1.0);
    50 
    51    heightMapMaterial->setDiffuse(0.4,0.4,0.4);
    52    heightMapMaterial->setAmbient(0.4,0.4,0.4 );
    53    heightMapMaterial->setSpecular(0.4,0.4,0.4);
    54    heightMapMaterial->setShininess(.5);
    55    heightMapMaterial->setTransparency(1.0);
    5649
    5750//  if (this->model != NULL)
     
    119112
    120113  this->heightMap = NULL;
    121   this->heightMapMaterial = NULL;
     114
     115  this->heightMapMaterial = new Material();
    122116}
    123117
     
    169163void Terrain::loadTexture(const char* textureName)
    170164{
    171   if (this->heightMapMaterial != NULL)
    172       delete this->heightMapMaterial;
    173 
    174    this->heightMapMaterial = new Material();
    175 
    176165   PRINTF(0)("Load texture: %s\n", textureName);
    177166
     
    183172
    184173   heightMapMaterial->setDiffuseMap(textureName);
    185 //    heightMapMaterial->setAmbientMap(textureName);
    186 //    heightMapMaterial->setSpecularMap(t extureName);
     174   heightMapMaterial->setAmbientMap(textureName);
     175   heightMapMaterial->setSpecularMap(textureName);
    187176}
    188177
  • trunk/src/world_entities/world_entity.cc

    r7015 r7055  
    163163    {
    164164      PRINTF(4)("fetching MD2 file: %s\n", fileName);
    165       Model* m = new MD2Model(fileName, this->md2TextureFileName);
     165      Model* m = new MD2Model(fileName, this->md2TextureFileName, this->scaling);
    166166      //this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0);
    167167      this->setModel(m, 0);
Note: See TracChangeset for help on using the changeset viewer.