Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cd_old/src/lib/graphics/effects/lense_flare.h @ 7422

Last change on this file since 7422 was 6889, checked in by patrick, 19 years ago

trunk: lenseflare is not drawn if behind the camera

File size: 1.4 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 "vector.h"
14#include "plane.h"
15
16
17#define LF_MAX_FLARES 7
18
19
20class TiXmlElement;
21class Light;
22class Billboard;
23
24//! A class that handles LenseFlares. The LenseFlareManager operates on this.
25class LenseFlare : public GraphicsEffect
26{
27  public:
28    LenseFlare(const TiXmlElement* root = NULL);
29    virtual ~LenseFlare();
30
31    virtual void loadParams(const TiXmlElement* root);
32
33    virtual bool init();
34
35    virtual bool activate();
36    virtual bool deactivate();
37
38    virtual void draw() const;
39    virtual void tick(float dt);
40
41    void addFlare(const char* textureName);
42
43
44  private:
45    GLint charToFogMode(const char* mode);
46    bool sourceVisible() const;
47
48
49  private:
50    Light*                   lightSource;        //!< reference to the sun (or primary light source)
51    std::vector<Billboard*>  flares;             //!< the flares array
52
53    Vector                   flareVector;        //!< the axis to draw the flares on
54    float                    distance;           //!< distance from center to source
55    Vector                   screenCenter;       //!< the vector marking the center of the screen
56
57    float*                   flareMatrix;
58    Plane                    frustumPlane;       //!< plane that marks the view frustum
59};
60
61
62#endif /* _LENSE_FLARE */
Note: See TracBrowser for help on using the repository browser.