Last change
on this file since 7773 was
7316,
checked in by bensch, 19 years ago
|
orxonox/trunk: Element2D uses Vector2D instead of Vector whenever possible
|
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" |
---|
[6776] | 15 | |
---|
[6787] | 16 | |
---|
| 17 | #define LF_MAX_FLARES 7 |
---|
| 18 | |
---|
| 19 | |
---|
[6776] | 20 | class TiXmlElement; |
---|
[6779] | 21 | class Light; |
---|
[6782] | 22 | class Billboard; |
---|
[6776] | 23 | |
---|
| 24 | //! A class that handles LenseFlares. The LenseFlareManager operates on this. |
---|
| 25 | class 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; |
---|
[6785] | 39 | virtual void tick(float dt); |
---|
[6776] | 40 | |
---|
[7221] | 41 | void addFlare(const std::string& textureName); |
---|
[6776] | 42 | |
---|
[6779] | 43 | |
---|
[6776] | 44 | private: |
---|
[7221] | 45 | GLint stringToFogMode(const std::string& mode); |
---|
[7015] | 46 | void setSourceVisibility(bool visibility) ; |
---|
[6776] | 47 | |
---|
| 48 | |
---|
| 49 | private: |
---|
[7015] | 50 | float isVisible; //!< Checks visibility |
---|
[6776] | 51 | Light* lightSource; //!< reference to the sun (or primary light source) |
---|
[6782] | 52 | std::vector<Billboard*> flares; //!< the flares array |
---|
[6783] | 53 | |
---|
[7316] | 54 | Vector2D flareVector; //!< the axis to draw the flares on |
---|
[6787] | 55 | float distance; //!< distance from center to source |
---|
[7316] | 56 | Vector2D screenCenter; //!< the vector marking the center of the screen |
---|
[6787] | 57 | |
---|
| 58 | float* flareMatrix; |
---|
[6889] | 59 | Plane frustumPlane; //!< plane that marks the view frustum |
---|
[6776] | 60 | }; |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | #endif /* _LENSE_FLARE */ |
---|
Note: See
TracBrowser
for help on using the repository browser.