| 1 | /*! | 
|---|
| 2 | * @file planet.h | 
|---|
| 3 | *  Definition of the Planet, that handles the Display of an atmosphere for orxonox. | 
|---|
| 4 | */ | 
|---|
| 5 |  | 
|---|
| 6 | #ifndef _PLANET_H | 
|---|
| 7 | #define _PLANET_H | 
|---|
| 8 |  | 
|---|
| 9 | /* INCLUDES */ | 
|---|
| 10 | #include "world_entity.h" | 
|---|
| 11 | #include "material.h" | 
|---|
| 12 | /* FORWARD DECLARATION */ | 
|---|
| 13 | class Texture; | 
|---|
| 14 | class Billboard; | 
|---|
| 15 |  | 
|---|
| 16 | //! A Class to handle a Planet | 
|---|
| 17 | class Planet : public WorldEntity | 
|---|
| 18 | { | 
|---|
| 19 | ObjectListDeclaration(Planet); | 
|---|
| 20 |  | 
|---|
| 21 | public: | 
|---|
| 22 | Planet(const TiXmlElement* root); | 
|---|
| 23 |  | 
|---|
| 24 | virtual ~Planet(); | 
|---|
| 25 |  | 
|---|
| 26 | virtual void loadParams(const TiXmlElement* root); | 
|---|
| 27 |  | 
|---|
| 28 | void setSize(float size); | 
|---|
| 29 | /** assumes jpg as input-format */ | 
|---|
| 30 | void setTexture(const std::string& textureName); | 
|---|
| 31 | void setCloudTexture(const std::string& textureName); | 
|---|
| 32 | 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);} | 
|---|
| 35 |  | 
|---|
| 36 |  | 
|---|
| 37 |  | 
|---|
| 38 | virtual void tick( float dt); | 
|---|
| 39 | virtual void draw() const; | 
|---|
| 40 |  | 
|---|
| 41 |  | 
|---|
| 42 |  | 
|---|
| 43 | private: | 
|---|
| 44 | Material        materialPlanet;  //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back | 
|---|
| 45 | Material        materialCloud;   //!< the material for the cloud surrounding the planet | 
|---|
| 46 |  | 
|---|
| 47 | Model*          cloudModel;      //!< the model for the cloud | 
|---|
| 48 |  | 
|---|
| 49 | bool            bClouds;         //!< true if there are clouds defined | 
|---|
| 50 | float           rotSpeedCloud;   //! cloud rotation speed | 
|---|
| 51 | float           rotSpeedPlanet;  //! planet rotation speed | 
|---|
| 52 | Vector          rotVecPlanet;    //! planet rotation vector | 
|---|
| 53 | float           size;            //!< Size of the Planet. This should match the frustum maximum range. | 
|---|
| 54 | float           textureSize;     //!< this is the length of a texture (assumes a square texture) | 
|---|
| 55 | char*           textureName;     //!< Name of the Texture | 
|---|
| 56 |  | 
|---|
| 57 | }; | 
|---|
| 58 |  | 
|---|
| 59 | #endif  /* _PLANET_H */ | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
| 62 |  | 
|---|