00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CAELUM__SKYDOME_H
00022 #define CAELUM__SKYDOME_H
00023
00024 #include "CaelumPrerequisites.h"
00025 #include "CameraBoundElement.h"
00026 #include "FastGpuParamRef.h"
00027 #include "PrivatePtr.h"
00028
00029 namespace Caelum
00030 {
00033 class CAELUM_EXPORT SkyDome : public CameraBoundElement
00034 {
00035 private:
00038 static const Ogre::String SPHERIC_DOME_NAME;
00039
00042 static const Ogre::String SKY_DOME_MATERIAL_NAME;
00043
00045 PrivateSceneNodePtr mNode;
00046
00048 PrivateMaterialPtr mMaterial;
00049
00051 PrivateEntityPtr mEntity;
00052
00053 private:
00055 bool mShadersEnabled;
00056
00058 bool mHazeEnabled;
00059
00060 public:
00065 SkyDome (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode);
00066
00069 virtual ~SkyDome ();
00070
00074 void setSunDirection (const Ogre::Vector3& dir);
00075
00077 void setHazeColour (const Ogre::ColourValue& hazeColour);
00078
00080 void setSkyGradientsImage (const Ogre::String& gradients);
00081
00083 void setAtmosphereDepthImage (const Ogre::String& gradients);
00084
00088 void setHazeEnabled (bool value);
00089
00091 bool getHazeEnabled () const;
00092
00093 void setQueryFlags (uint flags) { mEntity->setQueryFlags (flags); }
00094 uint getQueryFlags () const { return mEntity->getQueryFlags (); }
00095 void setVisibilityFlags (uint flags) { mEntity->setVisibilityFlags (flags); }
00096 uint getVisibilityFlags () const { return mEntity->getVisibilityFlags (); }
00097
00098 public:
00100 virtual void notifyCameraChanged (Ogre::Camera *cam);
00101
00102 protected:
00104 virtual void setFarRadius (Ogre::Real radius);
00105
00106 private:
00107 struct Params {
00108 void setup(Ogre::GpuProgramParametersSharedPtr vpParams, Ogre::GpuProgramParametersSharedPtr fpParams);
00109
00110 Ogre::GpuProgramParametersSharedPtr vpParams;
00111 Ogre::GpuProgramParametersSharedPtr fpParams;
00112 FastGpuParamRef sunDirection;
00113 FastGpuParamRef offset;
00114 FastGpuParamRef hazeColour;
00115 } mParams;
00116 };
00117 }
00118
00119 #endif //CAELUM__SKYDOME_H