00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CAELUM__SUN_H
00022 #define CAELUM__SUN_H
00023
00024 #include "CaelumPrerequisites.h"
00025 #include "CameraBoundElement.h"
00026 #include "SkyLight.h"
00027 #include "PrivatePtr.h"
00028
00029 namespace Caelum
00030 {
00031 class BaseSkyLight;
00032 class SphereSun;
00033 class SpriteSun;
00034
00035 typedef SpriteSun Sun;
00036
00040 class CAELUM_EXPORT SphereSun : public BaseSkyLight
00041 {
00042 public:
00044 static const Ogre::String SUN_MATERIAL_NAME;
00045
00046 private:
00048 PrivateMaterialPtr mSunMaterial;
00049
00051 PrivateEntityPtr mSunEntity;
00052
00053 public:
00057 SphereSun (
00058 Ogre::SceneManager *sceneMgr,
00059 Ogre::SceneNode *caelumRootNode,
00060 const Ogre::String &meshName = "sphere.mesh");
00061
00065 virtual ~SphereSun ();
00066
00070 void setBodyColour (const Ogre::ColourValue &colour);
00071
00072 public:
00074 virtual void notifyCameraChanged (Ogre::Camera *cam);
00075
00076 virtual void setQueryFlags (uint flags) { mSunEntity->setQueryFlags (flags); }
00077 virtual uint getQueryFlags () const { return mSunEntity->getQueryFlags (); }
00078 virtual void setVisibilityFlags (uint flags) { mSunEntity->setVisibilityFlags (flags); }
00079 virtual uint getVisibilityFlags () const { return mSunEntity->getVisibilityFlags (); }
00080 };
00081
00084 class CAELUM_EXPORT SpriteSun : public BaseSkyLight
00085 {
00086 public:
00088 static const Ogre::String SUN_MATERIAL_NAME;
00089
00090 protected:
00092 PrivateMaterialPtr mSunMaterial;
00093
00095 PrivateBillboardSetPtr mSunBillboardSet;
00096
00098 Ogre::Degree mSunTextureAngularSize;
00099
00100 public:
00105 SpriteSun (
00106 Ogre::SceneManager *sceneMgr,
00107 Ogre::SceneNode *caelumRootNode,
00108 const Ogre::String& sunTextureName = "sun_disc.png",
00109 const Ogre::Degree& sunTextureAngularSize = Ogre::Degree(3.77f));
00110
00114 virtual ~SpriteSun ();
00115
00119 void setSunTexture (const Ogre::String &textureName);
00120
00124 void setSunTextureAngularSize(const Ogre::Degree& sunTextureAngularSize);
00125
00129 void setBodyColour (const Ogre::ColourValue &colour);
00130
00131 public:
00133 virtual void notifyCameraChanged (Ogre::Camera *cam);
00134
00135 virtual void setQueryFlags (uint flags) { mSunBillboardSet->setQueryFlags (flags); }
00136 virtual uint getQueryFlags () const { return mSunBillboardSet->getQueryFlags (); }
00137 virtual void setVisibilityFlags (uint flags) { mSunBillboardSet->setVisibilityFlags (flags); }
00138 virtual uint getVisibilityFlags () const { return mSunBillboardSet->getVisibilityFlags (); }
00139 };
00140 }
00141
00142 #endif // CAELUM__SUN_H