Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2008, 2:24:10 AM (17 years ago)
Author:
landauf
Message:

changed a lot in Backlight, but not yet finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Backlight.h

    r2171 r2182  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include "PositionableEntity.h"
    35 #include "tools/BillboardSet.h"
     33#include "Billboard.h"
     34#include "objects/Tickable.h"
    3635
    3736namespace orxonox
    3837{
    39     class _OrxonoxExport Backlight : public PositionableEntity
     38    class _OrxonoxExport Backlight : public Billboard, public Tickable
    4039    {
     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/*
    4198        public:
    4299            Backlight(float maxspeed = 1.0, float brakingtime = 1.0, float scale = 1.0);
     
    49106            virtual bool create();
    50107
    51             void setColour(const ColourValue& colour);
     108
    52109            void setTimeFactor(float factor);
    53110
     
    60117            Ogre::SceneNode* ribbonTrailNode_;
    61118            Ogre::RibbonTrail* ribbonTrail_;
     119
    62120
    63121            float maxLifeTime_;
     
    72130            size_t maxTrailsegments_;
    73131    };
     132*/
    74133}
    75134
Note: See TracChangeset for help on using the changeset viewer.