Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/effects/lense_flare.h @ 9744

Last change on this file since 9744 was 8619, checked in by bensch, 18 years ago

trunk: merged the gui-branche back.
merged with command:
svn merge -r8520:HEAD https://svn.orxonox.net/orxonox/branches/gui
no conflicts

File size: 1.5 KB
Line 
1/**
2 * @file lense_flare.h
3 *  lense flare effect
4 */
5
6#ifndef _LENSE_FLARE
7#define _LENSE_FLARE
8
9#include "graphics_effect.h"
10
11#include <vector>
12
13#include "vector2D.h"
14#include "plane.h"
15#include "glincl.h"
16
17
18#define LF_MAX_FLARES 7
19
20
21class TiXmlElement;
22class Light;
23class ImagePlane;
24
25//! A class that handles LenseFlares. The LenseFlareManager operates on this.
26class LenseFlare : public GraphicsEffect
27{
28  public:
29    LenseFlare(const TiXmlElement* root = NULL);
30    virtual ~LenseFlare();
31
32    virtual void loadParams(const TiXmlElement* root);
33
34    virtual void init();
35
36    virtual void activate();
37    virtual void deactivate();
38
39    virtual void draw() const;
40    virtual void tick(float dt);
41
42    void addFlare(const std::string& textureName);
43
44
45  private:
46    GLint stringToFogMode(const std::string& mode);
47    void setSourceVisibility(bool visibility) ;
48
49
50  private:
51    bool                     bVisible;          //!< Checks visibility
52    Light*                   lightSource;        //!< reference to the sun (or primary light source)
53    std::vector<ImagePlane*> flares;             //!< the flares array
54
55    Vector2D                 flareVector;        //!< the axis to draw the flares on
56    float                    distance;           //!< distance from center to source
57    Vector2D                 screenCenter;       //!< the vector marking the center of the screen
58
59    float                    flareMatrix[14];
60    Plane                    frustumPlane;       //!< plane that marks the view frustum
61};
62
63
64#endif /* _LENSE_FLARE */
Note: See TracBrowser for help on using the repository browser.