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 | * Fabian 'x3n' Landau |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _Backlight_H__ |
---|
30 | #define _Backlight_H__ |
---|
31 | |
---|
32 | #include "OrxonoxPrereqs.h" |
---|
33 | #include "FadingBillboard.h" |
---|
34 | |
---|
35 | namespace orxonox |
---|
36 | { |
---|
37 | class _OrxonoxExport Backlight : public FadingBillboard |
---|
38 | { |
---|
39 | public: |
---|
40 | Backlight(BaseObject* creator); |
---|
41 | virtual ~Backlight(); |
---|
42 | |
---|
43 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
44 | void registerVariables(); |
---|
45 | |
---|
46 | virtual void tick(float dt); |
---|
47 | virtual void changedVisibility(); |
---|
48 | |
---|
49 | inline void setWidth(float width) |
---|
50 | { this->width_ = width; this->update_width(); } |
---|
51 | inline float getWidth() const |
---|
52 | { return this->width_; } |
---|
53 | |
---|
54 | inline void setLifetime(float lifetime) |
---|
55 | { this->lifetime_ = lifetime; this->update_lifetime(); } |
---|
56 | inline float getLifetime() const |
---|
57 | { return this->lifetime_; } |
---|
58 | |
---|
59 | inline void setLength(float length) |
---|
60 | { this->length_ = length; this->update_length(); } |
---|
61 | inline float getLength() const |
---|
62 | { return this->length_; } |
---|
63 | |
---|
64 | inline void setMaxElements(size_t maxelements) |
---|
65 | { this->maxelements_ = maxelements; this->update_maxelements(); } |
---|
66 | inline size_t getMaxElements() const |
---|
67 | { return this->maxelements_; } |
---|
68 | |
---|
69 | inline void setTrailMaterial(const std::string& material) |
---|
70 | { this->trailmaterial_ = material; this->update_trailmaterial(); } |
---|
71 | inline const std::string& getTrailMaterial() const |
---|
72 | { return this->trailmaterial_; } |
---|
73 | |
---|
74 | virtual void changedScale(); |
---|
75 | |
---|
76 | private: |
---|
77 | virtual void startturnonoff(); |
---|
78 | virtual void stopturnonoff(); |
---|
79 | virtual void poststopturnonoff(); |
---|
80 | virtual void changedColour(); |
---|
81 | void update_width(); |
---|
82 | void update_lifetime(); |
---|
83 | void update_length(); |
---|
84 | void update_maxelements(); |
---|
85 | void update_trailmaterial(); |
---|
86 | |
---|
87 | Ogre::RibbonTrail* ribbonTrail_; |
---|
88 | Ogre::SceneNode* ribbonTrailNode_; |
---|
89 | float width_; |
---|
90 | float length_; |
---|
91 | float lifetime_; |
---|
92 | size_t maxelements_; |
---|
93 | std::string trailmaterial_; |
---|
94 | char tickcount_; |
---|
95 | }; |
---|
96 | } |
---|
97 | |
---|
98 | #endif /* _Backlight_H__ */ |
---|