Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2012, 3:26:49 PM (12 years ago)
Author:
davidsa
Message:

Added nested Class Lens to LensFlare, to simplify lens flare configuration and some of the methods. Might also be used to define presets in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shaders/src/orxonox/graphics/LensFlare.h

    r9466 r9500  
    4646
    4747namespace orxonox
    48 {
     48{   
    4949      /**
    5050    @brief
     
    6161    class _OrxonoxExport LensFlare : public StaticEntity, public Tickable
    6262    {
     63          /**
     64          @brief
     65              This is a nested Class used to easily set properties of the different sublenses of a LensFlare effect
     66          */
     67          class Lens
     68          {
     69              public:
     70                  std::string* material_;//!< Which material should the Lens use, current choices include burst, bursthalo, halo1, halo2, halo3
     71                  float alpha_;//!< Which base alpha value should the Lens use
     72                  float scale_;//!< Which base scale should the Lens Flare have
     73                  float position_;//!< This defines how far along the view direction the flare should be positioned, e.g. 0.5 would position the flare halfway between the viewer and the base burst, 0 at the camera, 1 at the burst
     74                  Lens(std::string* material, float alpha, float scale, float position)
     75                  {
     76                      this->material_=material;
     77                      this->alpha_=alpha;
     78                      this->scale_=scale;
     79                      this->position_=position;
     80                  }
     81          };
     82         
    6383        public:
    6484            LensFlare(BaseObject* creator);
     
    6989            inline float getScale() const
    7090                { return this->scale_; }
     91               
     92            /**
     93            @brief
     94                This sets the base colour of the billboards
     95            @param colour
     96                Vector3 containing r,g,b values
     97            */
     98            inline void setColour(const ColourValue& colour)
     99            {
     100                this->colour_->r=colour.r;
     101                this->colour_->g=colour.g;
     102                this->colour_->b=colour.b;
     103            }
     104            /**
     105            @brief
     106                This returns the current base colour of the billboards
     107            @return a Vector3 containing r,g,b values
     108            */
     109            inline const ColourValue& getColour() const
     110                { return *(new ColourValue(this->colour_->r,this->colour_->g,this->colour_->b)); }
    71111               
    72112            /**
     
    141181            unsigned int getPointCount(float dimension) const;
    142182           
     183            std::vector<Lens*>* lensConfiguration_;//!< this stores the lensConfiguration
    143184            Billboard* occlusionBillboard_;//!< this is a transparent billboard used solely for the Hardware Occlusion Query
    144185            float cameraDistance_;//!< current distance of the lensflare center from the camera
     
    147188            unsigned int fadeResolution_;//!< how many points should be sampled per axis for the screen border fade. High number => smooth fade, but uses more processing power
    148189            float fadeExponent_;//!< this determines how fast the flare fades away as it gets obstructed
    149             //TODO: add XML port for colour manipulation
    150190            ColourValue* colour_;//!< this stores the base colour of the light
    151191    };
Note: See TracChangeset for help on using the changeset viewer.