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__ |
---|
31 | #include "tools/BillboardSet.h" |
---|
32 | #include "OrxonoxPrereqs.h" |
---|
33 | |
---|
34 | #include "PositionableEntity.h" |
---|
35 | #include "tools/Mesh.h" |
---|
36 | #include "objects/Tickable.h" |
---|
37 | |
---|
38 | namespace orxonox |
---|
39 | { |
---|
40 | |
---|
41 | class _OrxonoxExport Planet : public PositionableEntity, public Tickable |
---|
42 | { |
---|
43 | public: |
---|
44 | Planet(BaseObject* creator); |
---|
45 | |
---|
46 | virtual ~Planet(); |
---|
47 | |
---|
48 | void init(); |
---|
49 | virtual void tick(float dt); |
---|
50 | |
---|
51 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
52 | |
---|
53 | virtual void changedVisibility(); |
---|
54 | |
---|
55 | inline void setMeshSource(const std::string& meshname) |
---|
56 | { this->meshSrc_ = meshname; this->changedMesh(); } |
---|
57 | |
---|
58 | inline const std::string& getMeshSource() const |
---|
59 | { return this->meshSrc_; } |
---|
60 | |
---|
61 | inline void setCastShadows(bool bCastShadows) |
---|
62 | { this->bCastShadows_ = bCastShadows; this->changedShadows(); } |
---|
63 | |
---|
64 | inline bool getCastShadows() const |
---|
65 | { return this->bCastShadows_; } |
---|
66 | |
---|
67 | inline const std::string& getMesh() const{ |
---|
68 | return this->meshSrc_; |
---|
69 | } |
---|
70 | |
---|
71 | inline void setAtmosphereSize(Real size){ |
---|
72 | this->atmosphereSize = size; |
---|
73 | } |
---|
74 | |
---|
75 | inline Real getAtmosphereSize(){ |
---|
76 | return this->atmosphereSize; |
---|
77 | } |
---|
78 | |
---|
79 | inline void setImageSize(Real size){ |
---|
80 | this->imageSize = size; |
---|
81 | } |
---|
82 | |
---|
83 | inline Real getImageSize(){ |
---|
84 | return this->imageSize; |
---|
85 | } |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | protected: |
---|
91 | void registerVariables(); |
---|
92 | |
---|
93 | private: |
---|
94 | |
---|
95 | void changedMesh(); |
---|
96 | void changedShadows(); |
---|
97 | |
---|
98 | std::string meshSrc_; |
---|
99 | Mesh mesh_; |
---|
100 | Real atmosphereSize; |
---|
101 | Real imageSize; |
---|
102 | Ogre::Mesh::LodDistanceList distList; |
---|
103 | BillboardSet billboard_; |
---|
104 | bool bCastShadows_; |
---|
105 | |
---|
106 | }; |
---|
107 | } |
---|
108 | |
---|
109 | #endif /* _Planet_H__ */ |
---|
110 | //<Planet position="200000,0,0" scale="10000" mesh="planet.mesh" yawpitchroll="-40,30,0" rotationAxis="1,0,0" rotationRate="0"/> |
---|