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