source:
orxonox.OLD/trunk/src/lib/graphics/effects/lense_flare.h
@
8689
Last change on this file since 8689 was 8619, checked in by bensch, 18 years ago | |
---|---|
File size: 1.5 KB |
Rev | Line | |
---|---|---|
[6776] | 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 | ||
[6779] | 11 | #include <vector> |
[6776] | 12 | |
[7316] | 13 | #include "vector2D.h" |
[6889] | 14 | #include "plane.h" |
[8362] | 15 | #include "glincl.h" |
[6776] | 16 | |
[6787] | 17 | |
18 | #define LF_MAX_FLARES 7 | |
19 | ||
20 | ||
[6776] | 21 | class TiXmlElement; |
[6779] | 22 | class Light; |
[7810] | 23 | class ImagePlane; |
[6776] | 24 | |
25 | //! A class that handles LenseFlares. The LenseFlareManager operates on this. | |
26 | class LenseFlare : public GraphicsEffect | |
27 | { | |
28 | public: | |
29 | LenseFlare(const TiXmlElement* root = NULL); | |
30 | virtual ~LenseFlare(); | |
31 | ||
32 | virtual void loadParams(const TiXmlElement* root); | |
33 | ||
[8495] | 34 | virtual void init(); |
[6776] | 35 | |
[8495] | 36 | virtual void activate(); |
37 | virtual void deactivate(); | |
[6776] | 38 | |
39 | virtual void draw() const; | |
[6785] | 40 | virtual void tick(float dt); |
[6776] | 41 | |
[7221] | 42 | void addFlare(const std::string& textureName); |
[6776] | 43 | |
[6779] | 44 | |
[6776] | 45 | private: |
[7221] | 46 | GLint stringToFogMode(const std::string& mode); |
[7015] | 47 | void setSourceVisibility(bool visibility) ; |
[6776] | 48 | |
49 | ||
50 | private: | |
[7844] | 51 | bool bVisible; //!< Checks visibility |
[6776] | 52 | Light* lightSource; //!< reference to the sun (or primary light source) |
[8619] | 53 | std::vector<ImagePlane*> flares; //!< the flares array |
[6783] | 54 | |
[7316] | 55 | Vector2D flareVector; //!< the axis to draw the flares on |
[6787] | 56 | float distance; //!< distance from center to source |
[7316] | 57 | Vector2D screenCenter; //!< the vector marking the center of the screen |
[6787] | 58 | |
[8619] | 59 | float flareMatrix[14]; |
[6889] | 60 | Plane frustumPlane; //!< plane that marks the view frustum |
[6776] | 61 | }; |
62 | ||
63 | ||
64 | #endif /* _LENSE_FLARE */ |
Note: See TracBrowser
for help on using the repository browser.