| [2380] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
 | 3 |  *                    > www.orxonox.net < | 
|---|
 | 4 |  * | 
|---|
 | 5 |  * | 
|---|
 | 6 |  *   License notice: | 
|---|
 | 7 |  * | 
|---|
 | 8 |  *   This program is free software; you can redistribute it and/or | 
|---|
 | 9 |  *   modify it under the terms of the GNU General Public License | 
|---|
 | 10 |  *   as published by the Free Software Foundation; either version 2 | 
|---|
 | 11 |  *   of the License, or (at your option) any later version. | 
|---|
 | 12 |  * | 
|---|
 | 13 |  *   This program is distributed in the hope that it will be useful, | 
|---|
 | 14 |  *   but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
 | 15 |  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
 | 16 |  *   GNU General Public License for more details. | 
|---|
 | 17 |  * | 
|---|
 | 18 |  *   You should have received a copy of the GNU General Public License | 
|---|
 | 19 |  *   along with this program; if not, write to the Free Software | 
|---|
 | 20 |  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
|---|
 | 21 |  * | 
|---|
 | 22 |  *   Author: | 
|---|
 | 23 |  *      Marian Runo | 
|---|
 | 24 |  *   Co-authors: | 
|---|
 | 25 |  *      ... | 
|---|
 | 26 |  * | 
|---|
 | 27 |  */ | 
|---|
 | 28 |  | 
|---|
 | 29 | #ifndef _Planet_H__ | 
|---|
 | 30 | #define _Planet_H__ | 
|---|
| [2435] | 31 |  | 
|---|
| [5730] | 32 | #include "objects/ObjectsPrereqs.h" | 
|---|
| [2380] | 33 |  | 
|---|
| [3196] | 34 | #include <string> | 
|---|
| [2435] | 35 | #include "tools/BillboardSet.h" | 
|---|
 | 36 | #include "tools/Mesh.h" | 
|---|
| [5735] | 37 | #include "worldentities/MovableEntity.h" | 
|---|
| [2380] | 38 |  | 
|---|
 | 39 | namespace orxonox | 
|---|
 | 40 | { | 
|---|
| [5730] | 41 |     class _ObjectsExport Planet : public MovableEntity | 
|---|
| [2380] | 42 |     { | 
|---|
 | 43 |         public: | 
|---|
 | 44 |             Planet(BaseObject* creator); | 
|---|
| [5730] | 45 |  | 
|---|
| [2380] | 46 |             virtual ~Planet(); | 
|---|
| [5730] | 47 |  | 
|---|
| [2380] | 48 |             void init(); | 
|---|
 | 49 |             virtual void tick(float dt); | 
|---|
| [5730] | 50 |  | 
|---|
| [2380] | 51 |             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); | 
|---|
| [5730] | 52 |  | 
|---|
| [2380] | 53 |             virtual void changedVisibility(); | 
|---|
| [5730] | 54 |  | 
|---|
| [2380] | 55 |             inline void setMeshSource(const std::string& meshname) | 
|---|
 | 56 |                 { this->meshSrc_ = meshname; this->changedMesh(); } | 
|---|
| [5730] | 57 |  | 
|---|
| [2380] | 58 |             inline const std::string& getMeshSource() const | 
|---|
 | 59 |                 { return this->meshSrc_; } | 
|---|
 | 60 |  | 
|---|
 | 61 |             inline void setCastShadows(bool bCastShadows) | 
|---|
 | 62 |                 { this->bCastShadows_ = bCastShadows; this->changedShadows(); } | 
|---|
| [5730] | 63 |  | 
|---|
| [2380] | 64 |             inline bool getCastShadows() const | 
|---|
| [5730] | 65 |                 { return this->bCastShadows_; } | 
|---|
 | 66 |  | 
|---|
| [2380] | 67 |             inline const std::string& getMesh() const{ | 
|---|
 | 68 |                 return this->meshSrc_; | 
|---|
 | 69 |             } | 
|---|
| [5730] | 70 |  | 
|---|
| [2710] | 71 |             inline void setAtmosphereSize(float size){ | 
|---|
| [2380] | 72 |                 this->atmosphereSize = size; | 
|---|
 | 73 |             } | 
|---|
| [5730] | 74 |  | 
|---|
| [2710] | 75 |             inline float getAtmosphereSize(){ | 
|---|
| [2380] | 76 |                 return this->atmosphereSize; | 
|---|
 | 77 |             } | 
|---|
| [5730] | 78 |  | 
|---|
| [2380] | 79 |             inline void setAtmosphere(const std::string& atmosphere){ | 
|---|
 | 80 |                 this->atmosphere_ = atmosphere; | 
|---|
 | 81 |             } | 
|---|
| [5730] | 82 |  | 
|---|
| [2380] | 83 |             inline const std::string& getAtmosphere(){ | 
|---|
 | 84 |                 return this->atmosphere_; | 
|---|
 | 85 |             } | 
|---|
| [5730] | 86 |  | 
|---|
| [2710] | 87 |             inline void setImageSize(float size){ | 
|---|
| [2380] | 88 |                 this->imageSize = size; | 
|---|
 | 89 |             } | 
|---|
| [5730] | 90 |  | 
|---|
| [2710] | 91 |             inline float getImageSize(){ | 
|---|
| [2380] | 92 |                 return this->imageSize; | 
|---|
 | 93 |             } | 
|---|
 | 94 |  | 
|---|
 | 95 |         protected: | 
|---|
 | 96 |             void registerVariables(); | 
|---|
 | 97 |  | 
|---|
 | 98 |         private: | 
|---|
| [5730] | 99 |  | 
|---|
| [2380] | 100 |             void changedMesh(); | 
|---|
 | 101 |             void changedShadows(); | 
|---|
| [5730] | 102 |  | 
|---|
| [2380] | 103 |             std::string meshSrc_; | 
|---|
 | 104 |             std::string atmosphere_; | 
|---|
 | 105 |             Mesh mesh_; | 
|---|
| [2710] | 106 |             float atmosphereSize; | 
|---|
 | 107 |             float imageSize; | 
|---|
| [3196] | 108 |             std::vector<float> distList; | 
|---|
| [2380] | 109 |             BillboardSet billboard_; | 
|---|
 | 110 |             bool bCastShadows_; | 
|---|
 | 111 |  | 
|---|
 | 112 |     }; | 
|---|
 | 113 | } | 
|---|
 | 114 |  | 
|---|
 | 115 | #endif | 
|---|
 | 116 |  | 
|---|