Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10387 in orxonox.OLD for trunk/src/world_entities/planet.cc


Ignore:
Timestamp:
Jan 26, 2007, 6:22:33 PM (19 years ago)
Author:
patrick
Message:

removed the segfault for npcs, adding clouds to planets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/planet.cc

    r10114 r10387  
    4545  this->toList(OM_GROUP_01);
    4646
    47   //this->material->setIllum(20);
    48   //this->material->setAmbient(0.1, 0.1, 0.1);
     47  //this->materialPlanet->setIllum(20);
     48  //this->materialPlanet->setAmbient(0.1, 0.1, 0.1);
     49
     50  if( root != NULL)
     51    this->loadParams(root);
     52
     53  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
     54  this->setModel(model);
    4955
    5056
    5157
    52       //st float radius, const unsigned int loops, const unsigned int segmentsPerLoop
    53 
    54   this->loadParams(root);
    55 
    56 //   VertexArrayModel* model = new VertexArrayModel();
    57 //   model->spiralSphere(this->size, 10, 10);
    58 //   this->setModel(model);
    59 //   model->debug();
    60 //
    61   PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
    62   this->setModel(model);
    6358}
    6459
     
    7873
    7974  LoadParam(root, "texture", this, Planet, setTexture)
    80       .describe("Sets the material on the Planet. The string must be the path relative to the data-dir, and without a trailing .jpg");
     75      .describe("Sets the materialPlanet on the Planet. The string must be the path relative to the data-dir, and without a trailing .jpg");
     76
     77  LoadParam(root, "cloud-texture", this, Planet, setCloudTexture)
     78      .describe("Sets the cloud texture of the planet");
    8179
    8280  LoadParam(root, "size", this, Planet, setSize)
     
    9189void Planet::setTexture(const std::string& textureName)
    9290{
    93   this->material.setDiffuseMap(textureName);
     91  this->materialPlanet.setDiffuseMap(textureName);
     92}
     93
     94
     95/**
     96 *  Defines which textures should be loaded onto the Planet.
     97 * @param textureName the top texture.
     98*/
     99void Planet::setCloudTexture(const std::string& textureName)
     100{
     101  this->materialCloud.setDiffuseMap(textureName);
    94102}
    95103
     
    109117void Planet::draw() const
    110118{
    111   this->material.select();
     119  this->materialPlanet.select();
    112120
    113121  WorldEntity::draw();
Note: See TracChangeset for help on using the changeset viewer.