00001
00003
00004
00005
00006
00007
00009
00010
00011
00013
00014
00015 #ifndef __RAIN_LIGHT__
00016 #define __RAIN_LIGHT__
00017
00018
00019
00020 #include "CommonRain.h"
00021 #include "ExampleApplication.h"
00022 #include <vector>
00023
00024
00025
00026
00030 class RainLight
00031 {
00032 private :
00033 SceneManager *mSceneMgr;
00034 SceneNode *mLightNode;
00035 SceneNode *mConeNode;
00036 BillboardSet *mBillboardSet;
00037 Billboard *mBillboard;
00038
00039 ColourValue mColour;
00040 Vector3 mLightPos, mLightInitialPos, mLightDir;
00041 float mLightCutoff, mLightAttenuation;
00042 bool isAnimated;
00043
00044
00045 float stepH1, stepH2, stepH3, stepV1, stepV2;
00046 float h1, h2, h3;
00047 float v1, v2;
00048
00049 public :
00051 RainLight(SceneManager *sceneMgr, int lightNumber = 0, ColourValue col = ColourValue::Red, Vector3 LightPos = Vector3(0, 0, 0), float LightAttenuation = 150);
00052
00053 void animate();
00054
00055 ColourValue getColour()
00056 {
00057 return mColour;
00058 }
00059
00060 Vector3 getPosition()
00061 {
00062 return mLightPos;
00063 }
00064
00065 Vector3 getDirection()
00066 {
00067 return mLightDir;
00068 }
00069
00070 float getCutoff()
00071 {
00072 return mLightCutoff;
00073 }
00074
00075 float getAttenuation()
00076 {
00077 return mLightAttenuation;
00078 }
00079
00080 bool getIsAnimated()
00081 {
00082 return isAnimated;
00083 }
00084
00085 };
00086
00087
00088
00089 class RainLightManager
00090 {
00091 private :
00092 int lightCount;
00093 std::vector<RainLight *> lightVector;
00094 SceneManager *mSceneMgr;
00095
00096 public :
00097 RainLightManager(SceneManager *sceneMgr);
00098
00099 ~RainLightManager();
00100
00101 int getLightCount()
00102 {
00103 return lightCount;
00104 }
00105
00106 void addStreetLight(ColourValue col = ColourValue::Red + ColourValue::Green + ColourValue::Blue, Vector3 LightPos = Vector3(0, 0, 0), float LightAttenuation = 150);
00107
00109 void createLightInfoTexture();
00110
00111 void updateLightInfoTexture();
00112
00113 void updateLights();
00114
00115 void finalizeLights();
00116 };
00117
00118 #endif // __RAIN_LIGHT__
00119