Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10653 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
May 10, 2007, 5:42:26 PM (18 years ago)
Author:
snellen
Message:

planet rotation now xml-loadable

Location:
trunk/src/world_entities/environments
Files:
2 edited

Legend:

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

    r10618 r10653  
    4747
    4848  this->rotSpeedPlanet = 0.0;
     49  this->rotVecPlanet = Vector(0,1,0);
    4950  this->rotSpeedCloud = 0.0;
    5051  this->bClouds = false;
     
    8586  LoadParam(root, "cloud-rotation", this, Planet, setCloudRotation)
    8687      .describe("Sets the cloud rotation speed");
     88 
     89  LoadParam(root, "planet-rotation-speed", this, Planet, setPlanetRotationSpeed)
     90      .describe("Sets the planet rotation speed");
     91 
     92  LoadParam(root, "planet-rotation-axis", this, Planet, setPlanetRotationAxis)
     93      .describe("Sets the planet rotation axis");
    8794}
    8895
     
    132139{
    133140  if( dt != 0.)
    134     this->shiftDir( Quaternion( this->rotSpeedPlanet * dt, Vector(1,0,0)));
     141    this->shiftDir( Quaternion( this->rotSpeedPlanet * dt, this->rotVecPlanet));
    135142}
    136143
  • trunk/src/world_entities/environments/planet.h

    r10618 r10653  
    3131  void setCloudTexture(const std::string& textureName);
    3232  void setCloudRotation(float rotationSpeed);
     33  void setPlanetRotationSpeed(float rotationSpeed){ this->rotSpeedPlanet = rotationSpeed;}
     34  void setPlanetRotationAxis(float x, float y, float z){ this->rotVecPlanet = Vector(x,y,z);}
    3335
    3436
     
    4850  float           rotSpeedCloud;   //! cloud rotation speed
    4951  float           rotSpeedPlanet;  //! planet rotation speed
     52  Vector          rotVecPlanet;    //! planet rotation vector
    5053  float           size;            //!< Size of the Planet. This should match the frustum maximum range.
    5154  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
Note: See TracChangeset for help on using the changeset viewer.