Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5057 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Aug 16, 2005, 11:46:55 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: model scaleable

Location:
orxonox/trunk/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/test_bullet.cc

    r5055 r5057  
    3838
    3939  float modelSize = .3;
    40   this->loadModel("models/projectiles/orx-rocket.obj");
     40  this->loadModelWithScale("models/projectiles/orx-rocket.obj", .3);
    4141
    4242  this->energyMin = 1;
  • orxonox/trunk/src/world_entities/world_entity.cc

    r5046 r5057  
    6464 * loads a Model onto a WorldEntity
    6565 * @param fileName the name of the model to load
    66 */
    67 void WorldEntity::loadModel(const char* fileName)
     66 * @param scaling the Scaling of the model
     67*/
     68void WorldEntity::loadModelWithScale(const char* fileName, float scaling)
    6869{
    6970  if (this->model)
     
    7273  {
    7374    PRINTF(4)("loading %s\n", fileName);
    74     this->model = (Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN);
     75    if (scaling == 1.0)
     76      this->model = (Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN);
     77    else
     78      this->model = (Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN, &scaling);
     79
    7580    PRINTF(4)("creating obb tree\n");
    7681    this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
     
    7984    this->model = NULL;
    8085}
     86
     87
    8188
    8289/**
  • orxonox/trunk/src/world_entities/world_entity.h

    r5046 r5057  
    3030
    3131  void loadParams(const TiXmlElement* root);
    32   void loadModel(const char* fileName);
     32
     33  /** @see loadModelWithScale(const char*, float) @param fileName the File to load */
     34  void loadModel(const char* fileName) { this->loadModelWithScale(fileName, 1.0); };
     35  void loadModelWithScale(const char* fileName, float scaling);
    3336
    3437
Note: See TracChangeset for help on using the changeset viewer.