00001 #ifndef SKYLIGHT_H
00002 #define SKYLIGHT_H
00003
00004 namespace caelum
00005 {
00009 class CAELUM_EXPORT BaseSkyLight : public CameraBoundElement
00010 {
00011 protected:
00013 Ogre::Light *mMainLight;
00014
00016 Ogre::SceneNode *mNode;
00017
00019 float mRadius;
00020
00022 Ogre::Vector3 mDirection;
00023
00025 Ogre::ColourValue mBodyColour;
00026
00028 Ogre::ColourValue mLightColour;
00029
00031 Ogre::ColourValue mDiffuseMultiplier;
00032
00034 Ogre::ColourValue mSpecularMultiplier;
00035
00039 Ogre::ColourValue mAmbientMultiplier;
00040
00042 bool mAutoDisableLight;
00043
00045 Ogre::Real mAutoDisableThreshold;
00046
00048 bool mForceDisableLight;
00049
00050 public:
00055 BaseSkyLight (
00056 Ogre::SceneManager *sceneMgr,
00057 Ogre::SceneNode *caelumRootNode);
00058
00060 virtual ~BaseSkyLight () = 0;
00061
00067 virtual void update (
00068 const Ogre::Vector3& direction,
00069 const Ogre::ColourValue &lightColour,
00070 const Ogre::ColourValue &bodyColour);
00071
00073 const Ogre::Vector3& getLightDirection () const;
00074
00076 virtual void setLightDirection (const Ogre::Vector3 &dir);
00077
00079 Ogre::ColourValue getBodyColour () const;
00080
00082 virtual void setBodyColour (const Ogre::ColourValue &colour);
00083
00085 Ogre::ColourValue getLightColour () const;
00086
00088 virtual void setLightColour (const Ogre::ColourValue &colour);
00089
00091 void setDiffuseMultiplier (const Ogre::ColourValue &diffuse);
00092
00094 Ogre::ColourValue getDiffuseMultiplier () const;
00095
00097 void setSpecularMultiplier (const Ogre::ColourValue &specular);
00098
00100 Ogre::ColourValue getSpecularMultiplier () const;
00101
00105 void setAmbientMultiplier (const Ogre::ColourValue &ambient);
00106
00108 Ogre::ColourValue getAmbientMultiplier () const;
00109
00111 Ogre::Light* getMainLight() const;
00112
00114 inline bool getAutoDisable() const { return mAutoDisableLight; }
00115
00121 inline void setAutoDisable(bool value) { mAutoDisableLight = value; }
00122
00124 inline Ogre::Real getAutoDisableThreshold() const { return mAutoDisableThreshold; }
00125
00127 inline void setAutoDisableThreshold(Ogre::Real value) { mAutoDisableThreshold = value; }
00128
00129 static const Ogre::Real DEFAULT_AUTO_DISABLE_THRESHOLD;
00130
00132 inline void setForceDisable(bool value) { mForceDisableLight = value; }
00133 inline bool getForceDisable() const { return mForceDisableLight; }
00134
00135 protected:
00137 virtual void setFarRadius (Ogre::Real radius);
00138
00140 void setMainLightColour(const Ogre::ColourValue &colour);
00141
00144 bool shouldEnableLight(const Ogre::ColourValue &colour);
00145 };
00146 }
00147
00148 #endif // SKYLIGHT_H