Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jan 26, 2007, 7:12:37 PM (17 years ago)
Author:
patrick
Message:

more on camera loading and many planet properties

File:
1 edited

Legend:

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

    r10387 r10391  
    4545  this->toList(OM_GROUP_01);
    4646
     47  this->rotSpeedPlanet = 0.0;
     48  this->rotSpeedCloud = 0.0;
     49
    4750  //this->materialPlanet->setIllum(20);
    4851  //this->materialPlanet->setAmbient(0.1, 0.1, 0.1);
     
    5457  this->setModel(model);
    5558
    56 
    57 
     59  this->cloudModel = new PrimitiveModel(PRIM_SPHERE, this->size + 10, 50);
    5860}
    5961
     
    7779  LoadParam(root, "cloud-texture", this, Planet, setCloudTexture)
    7880      .describe("Sets the cloud texture of the planet");
     81
     82  LoadParam(root, "cloud-rotation", this, Planet, setCloudRotation)
     83      .describe("Sets the cloud rotation speed");
    7984
    8085  LoadParam(root, "size", this, Planet, setSize)
     
    103108
    104109
     110void Planet::setCloudRotation(float rotationSpeed)
     111{
     112  this->rotSpeedCloud = rotationSpeed;
     113}
     114
    105115/**
    106116 * @param size The new size of the Planet
     
    114124
    115125
     126void Planet::tick( float dt)
     127{
     128  if( dt != 0.)
     129    this->shiftDir( Quaternion( this->rotSpeedPlanet * dt, Vector(1,0,0)));
     130}
    116131
     132
     133/**
     134 * draws the planet
     135 */
    117136void Planet::draw() const
    118137{
     138  // draw the clouds
    119139  this->materialPlanet.select();
     140  WorldEntity::draw();
    120141
    121   WorldEntity::draw();
     142  this->materialCloud.select();
     143  WorldEntity::draw(this->cloudModel);
     144
    122145}
    123146
Note: See TracChangeset for help on using the changeset viewer.