Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Backlight.h @ 2182

Last change on this file since 2182 was 2182, checked in by landauf, 15 years ago

changed a lot in Backlight, but not yet finished

File size: 4.1 KB
Line 
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 "Billboard.h"
34#include "objects/Tickable.h"
35
36namespace orxonox
37{
38    class _OrxonoxExport Backlight : public Billboard, public Tickable
39    {
40        public:
41            Backlight(BaseObject* creator);
42            virtual ~Backlight();
43
44            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
45            void registerVariables();
46
47            virtual void tick(float dt);
48            virtual void changedActivity();
49            virtual void changedVisibility();
50
51            inline void setWidth(float width)
52                { this->width_ = width; this->update_width(); }
53            inline float getWidth() const
54                { return this->width_; }
55
56            inline void setLifetime(float lifetime)
57                { this->lifetime_ = lifetime; this->update_lifetime(); }
58            inline float getLifetime() const
59                { return this->lifetime_; }
60
61            inline void setLength(float length)
62                { this->length_ = length; this->update_length(); }
63            inline float getLength() const
64                { return this->length_; }
65
66            inline void setMaxElements(size_t maxelements)
67                { this->maxelements_ = maxelements; this->update_maxelements(); }
68            inline size_t getMaxElements() const
69                { return this->maxelements_; }
70
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_; }
75
76        protected:
77            virtual void notifyAttached();
78
79        private:
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    };
95
96
97/*
98        public:
99            Backlight(float maxspeed = 1.0, float brakingtime = 1.0, float scale = 1.0);
100            virtual ~Backlight();
101
102            void setConfigValues();
103            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
104            virtual void tick(float dt);
105            virtual void changedVisibility();
106            virtual bool create();
107
108
109            void setTimeFactor(float factor);
110
111        private:
112            void configure(float maxspeed, float brakingtime, float scale = 1);
113            void updateColourChange();
114
115            static float timeFactor_s;
116            BillboardSet billboard_;
117            Ogre::SceneNode* ribbonTrailNode_;
118            Ogre::RibbonTrail* ribbonTrail_;
119
120
121            float maxLifeTime_;
122            float trailSegmentLength_;
123            float width_;
124
125            float brakefactor_;
126
127            float maxTraillength_;
128            float traillength_;
129
130            size_t maxTrailsegments_;
131    };
132*/
133}
134
135#endif /* _Backlight_H__ */
Note: See TracBrowser for help on using the repository browser.