source:
orxonox.OLD/trunk/src/world_entities/weather_effects/lense_flare.h
@
10388
Last change on this file since 10388 was 9869, checked in by bensch, 18 years ago | |
---|---|
File size: 1.6 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 | { | |
[9715] | 28 | ObjectListDeclaration(LenseFlare); |
[6776] | 29 | public: |
30 | LenseFlare(const TiXmlElement* root = NULL); | |
31 | virtual ~LenseFlare(); | |
32 | ||
33 | virtual void loadParams(const TiXmlElement* root); | |
34 | ||
[8495] | 35 | virtual void init(); |
[6776] | 36 | |
[8495] | 37 | virtual void activate(); |
38 | virtual void deactivate(); | |
[6776] | 39 | |
40 | virtual void draw() const; | |
[6785] | 41 | virtual void tick(float dt); |
[6776] | 42 | |
[7221] | 43 | void addFlare(const std::string& textureName); |
[6776] | 44 | |
[6779] | 45 | |
[6776] | 46 | private: |
[7221] | 47 | GLint stringToFogMode(const std::string& mode); |
[7015] | 48 | void setSourceVisibility(bool visibility) ; |
[6776] | 49 | |
50 | ||
51 | private: | |
[7844] | 52 | bool bVisible; //!< Checks visibility |
[6776] | 53 | Light* lightSource; //!< reference to the sun (or primary light source) |
[8619] | 54 | std::vector<ImagePlane*> flares; //!< the flares array |
[6783] | 55 | |
[7316] | 56 | Vector2D flareVector; //!< the axis to draw the flares on |
[6787] | 57 | float distance; //!< distance from center to source |
[7316] | 58 | Vector2D screenCenter; //!< the vector marking the center of the screen |
[6787] | 59 | |
[8619] | 60 | float flareMatrix[14]; |
[6889] | 61 | Plane frustumPlane; //!< plane that marks the view frustum |
[6776] | 62 | }; |
63 | ||
64 | ||
65 | #endif /* _LENSE_FLARE */ |
Note: See TracBrowser
for help on using the repository browser.