Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5499 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Nov 7, 2005, 10:56:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Load_Param2 changed, to load Models with, or without scale.

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/loading/load_param.h

    r5332 r5499  
    169169 * @param type1 The type of the first functionParameter
    170170 * @param type2 The type of the second functionParameter
     171 *
     172 * @TODO DEFAULT VALUES HACK
    171173 */
    172174#define LoadParam2(type1, type2) \
     
    178180{ \
    179181          SubString subLoads(loadString); \
    180           if (subLoads.getCount() == 2) \
     182          if (subLoads.getCount() >= 1) \
    181183            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0), default1), type2##_FUNC(subLoads.getString(1), default2)); \
    182184          else \
  • trunk/src/world_entities/npc.cc

    r5458 r5499  
    3434  this->setClassID(CL_NPC, "NPC");
    3535
    36   this->loadModelWithScale("models/ships/bolido.obj", 2);
     36  this->loadModel("models/ships/bolido.obj", 2);
    3737
    3838  this->randomRotAxis =  VECTOR_RAND(1);
  • trunk/src/world_entities/npc2.cc

    r5427 r5499  
    3333  this->setClassID(CL_NPC, "NPC");
    3434
    35   this->loadModelWithScale("models/ships/bolido.obj", 3);
     35  this->loadModel("models/ships/bolido.obj", 3);
    3636  this->shader = NULL;
    3737  if (likely(Shader::checkShaderAbility()))
  • trunk/src/world_entities/power_ups/laser_power_up.cc

    r5458 r5499  
    5050{
    5151  this->setClassID(CL_LASER_POWER_UP, "LaserPowerUp");
    52   this->loadModelWithScale("models/guns/test_gun.obj", 2.0);
     52  this->loadModel("models/guns/test_gun.obj", 2.0);
    5353
    5454  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
  • trunk/src/world_entities/power_ups/turret_power_up.cc

    r5439 r5499  
    5050{
    5151  this->setClassID(CL_TURRET_POWER_UP, "TurretPowerUp");
    52   this->loadModelWithScale("models/guns/turret1.obj", 2.0);
     52  this->loadModel("models/guns/turret1.obj", 2.0);
    5353
    5454  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
  • trunk/src/world_entities/weapons/rocket.cc

    r5497 r5499  
    4141
    4242  float modelSize = .3;
    43   this->loadModelWithScale("models/projectiles/orx-rocket.obj", .3);
     43  this->loadModel("models/projectiles/orx-rocket.obj", .3);
    4444
    4545  this->energyMin = 1;
  • trunk/src/world_entities/weapons/test_bullet.cc

    r5451 r5499  
    4141
    4242  float modelSize = .3;
    43   this->loadModelWithScale("models/projectiles/orx-rocket.obj", .3);
     43  this->loadModel("models/projectiles/orx-rocket.obj", .3);
    4444
    4545  this->energyMin = 1;
  • trunk/src/world_entities/world_entity.cc

    r5498 r5499  
    7575
    7676  // Model Loading
    77   LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel)
     77  LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel, false, NULL, 1.0f)
    7878      .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)") ;
    7979
    80   // HACK
    81   LoadParam<WorldEntity>(root, "scaled-model", this, &WorldEntity::loadModelWithScale)
    82       .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)") ;
    8380}
    8481
     
    9087 * @todo fix this, so it only has one loadModel-Function.
    9188*/
    92 void WorldEntity::loadModelWithScale(const char* fileName, float scaling)
     89void WorldEntity::loadModel(const char* fileName, float scaling)
    9390{
    9491  if (this->model)
  • trunk/src/world_entities/world_entity.h

    r5498 r5499  
    2828
    2929  /** @see loadModelWithScale(const char*, float) @param fileName the File to load */
    30   void loadModel(const char* fileName) { this->loadModelWithScale(fileName, 1.0f); };
    31 
    32   void loadModelWithScale(const char* fileName, float scaling);
     30  void loadModel(const char* fileName, float scaling = 1.0f);
    3331
    3432  bool buildObbTree(unsigned int depth);
Note: See TracChangeset for help on using the changeset viewer.