[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 | |
---|
[7601] | 29 | /** |
---|
| 30 | @file Planet.h |
---|
| 31 | @brief Definition of the Planet class. |
---|
| 32 | @ingroup Objects |
---|
| 33 | */ |
---|
| 34 | |
---|
[2380] | 35 | #ifndef _Planet_H__ |
---|
| 36 | #define _Planet_H__ |
---|
[2435] | 37 | |
---|
[5730] | 38 | #include "objects/ObjectsPrereqs.h" |
---|
[2380] | 39 | |
---|
[3196] | 40 | #include <string> |
---|
[2435] | 41 | #include "tools/BillboardSet.h" |
---|
| 42 | #include "tools/Mesh.h" |
---|
[5735] | 43 | #include "worldentities/MovableEntity.h" |
---|
[2380] | 44 | |
---|
| 45 | namespace orxonox |
---|
| 46 | { |
---|
[5730] | 47 | class _ObjectsExport Planet : public MovableEntity |
---|
[2380] | 48 | { |
---|
| 49 | public: |
---|
[9667] | 50 | Planet(Context* context); |
---|
[5730] | 51 | |
---|
[2380] | 52 | virtual ~Planet(); |
---|
[5730] | 53 | |
---|
[11071] | 54 | virtual void tick(float dt) override; |
---|
[5730] | 55 | |
---|
[11071] | 56 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
---|
[5730] | 57 | |
---|
[11071] | 58 | virtual void changedVisibility() override; |
---|
[5730] | 59 | |
---|
[2380] | 60 | inline void setMeshSource(const std::string& meshname) |
---|
| 61 | { this->meshSrc_ = meshname; this->changedMesh(); } |
---|
[5730] | 62 | |
---|
[2380] | 63 | inline const std::string& getMeshSource() const |
---|
| 64 | { return this->meshSrc_; } |
---|
| 65 | |
---|
| 66 | inline void setCastShadows(bool bCastShadows) |
---|
| 67 | { this->bCastShadows_ = bCastShadows; this->changedShadows(); } |
---|
[5730] | 68 | |
---|
[2380] | 69 | inline bool getCastShadows() const |
---|
[5730] | 70 | { return this->bCastShadows_; } |
---|
| 71 | |
---|
[2380] | 72 | inline const std::string& getMesh() const{ |
---|
| 73 | return this->meshSrc_; |
---|
| 74 | } |
---|
[5730] | 75 | |
---|
[2710] | 76 | inline void setAtmosphereSize(float size){ |
---|
[2380] | 77 | this->atmosphereSize = size; |
---|
| 78 | } |
---|
[5730] | 79 | |
---|
[2710] | 80 | inline float getAtmosphereSize(){ |
---|
[2380] | 81 | return this->atmosphereSize; |
---|
| 82 | } |
---|
[5730] | 83 | |
---|
[2380] | 84 | inline void setAtmosphere(const std::string& atmosphere){ |
---|
| 85 | this->atmosphere_ = atmosphere; |
---|
| 86 | } |
---|
[5730] | 87 | |
---|
[2380] | 88 | inline const std::string& getAtmosphere(){ |
---|
| 89 | return this->atmosphere_; |
---|
| 90 | } |
---|
[5730] | 91 | |
---|
[2710] | 92 | inline void setImageSize(float size){ |
---|
[2380] | 93 | this->imageSize = size; |
---|
| 94 | } |
---|
[5730] | 95 | |
---|
[2710] | 96 | inline float getImageSize(){ |
---|
[2380] | 97 | return this->imageSize; |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | protected: |
---|
| 101 | |
---|
| 102 | private: |
---|
[7163] | 103 | void registerVariables(); |
---|
[5730] | 104 | |
---|
[2380] | 105 | void changedMesh(); |
---|
| 106 | void changedShadows(); |
---|
[5730] | 107 | |
---|
[2380] | 108 | std::string meshSrc_; |
---|
| 109 | std::string atmosphere_; |
---|
| 110 | Mesh mesh_; |
---|
[2710] | 111 | float atmosphereSize; |
---|
| 112 | float imageSize; |
---|
[2380] | 113 | BillboardSet billboard_; |
---|
| 114 | bool bCastShadows_; |
---|
| 115 | |
---|
| 116 | }; |
---|
| 117 | } |
---|
| 118 | |
---|
| 119 | #endif |
---|
| 120 | |
---|