24 #ifndef _SkyX_VClouds_VClouds_H_
25 #define _SkyX_VClouds_VClouds_H_
35 namespace SkyX {
namespace VClouds {
78 : Height(Ogre::Vector2(10, 50))
79 , Alpha(Ogre::Degree(12)), Beta(Ogre::Degree(40))
82 , Na(10), Nb(8), Nc(6)
98 const Ogre::Radian& _Alpha = Ogre::Degree(12),
99 const Ogre::Radian& _Beta = Ogre::Degree(40),
100 const int& _NumberOfBlocks = 12,
const int& _Na = 10,
101 const int& _Nb = 8,
const int& _Nc = 6)
103 , Alpha(_Alpha), Beta(_Beta)
105 , NumberOfBlocks(_NumberOfBlocks)
106 , Na(_Na), Nb(_Nb), Nc(_Nc)
120 , lastPosition(Ogre::Vector3(0, 0, 0))
121 , cameraOffset(Ogre::Vector2(0, 0))
122 , geometryDisplacement(Ogre::Vector3(0, 0, 0))
131 , lastPosition(c->getDerivedPosition())
132 , cameraOffset(Ogre::Vector2(0, 0))
133 , geometryDisplacement(Ogre::Vector3(0, 0, 0))
150 VClouds(Ogre::SceneManager *sm);
170 void create(
const Ogre::Vector2& Height,
const float& Radius);
179 void update(
const Ogre::Real& timeSinceLastFrame);
186 const Ogre::Real& timeSinceLastCameraFrame);
195 void registerCamera(Ogre::Camera* c);
202 void unregisterCamera(Ogre::Camera* c);
218 mGeometrySettings = gs;
226 return mGeometrySettings;
240 const Ogre::Vector2& DistanceFallingParams)
242 mDistanceFallingParams = DistanceFallingParams;
261 return mDistanceFallingParams;
282 mWindDirection = WindDirection;
290 return mWindDirection;
298 return Ogre::Vector2(Ogre::Math::Cos(mWindDirection),
299 Ogre::Math::Sin(mWindDirection));
307 mWindSpeed = WindSpeed;
337 void setSunColor(
const Ogre::Vector3& SunColor);
350 void setAmbientColor(
const Ogre::Vector3& AmbientColor);
357 return mAmbientColor;
367 void setLightResponse(
const Ogre::Vector4& LightResponse);
374 return mLightResponse;
380 void setAmbientFactors(
const Ogre::Vector4& AmbientFactors);
387 return mAmbientFactors;
395 mGlobalOpacity = GlobalOpacity;
403 return mGlobalOpacity;
411 mCloudFieldScale = CloudFieldScale;
419 return mCloudFieldScale;
427 mNoiseScale = NoiseScale;
451 void setWheater(
const float& Humidity,
const float& AverageCloudsSize,
452 const bool& DelayedResponse);
510 return mGeometryManager;
518 return mLightningManager;
541 GeometrySettings mGeometrySettings;
544 Ogre::Vector2 mDistanceFallingParams;
550 Ogre::Radian mWindDirection;
556 Ogre::Vector2 mWheater;
559 bool mDelayedResponse;
565 Ogre::Vector3 mSunColor;
567 Ogre::Vector3 mAmbientColor;
575 Ogre::Vector4 mLightResponse;
579 Ogre::Vector4 mAmbientFactors;
582 float mGlobalOpacity;
585 float mCloudFieldScale;
600 std::vector<CameraData> mCamerasData;
603 Ogre::MaterialPtr mVolCloudsMaterial;
606 Ogre::MaterialPtr mVolCloudsLightningMaterial;
const Ogre::Vector2 & getWheater() const
Get wheater.
Definition: VClouds.h:458
CameraData()
Default constructor.
Definition: VClouds.h:118
CameraData(Ogre::Camera *c)
Constructor.
Definition: VClouds.h:129
LightningManager * getLightningManager()
Get lightning manager.
Definition: VClouds.h:516
const Ogre::Vector2 & getDistanceFallingParams() const
Get distance falling params.
Definition: VClouds.h:259
const bool & isCreated() const
Has been create() already called?
Definition: VClouds.h:207
float Radius
Radius.
Definition: VClouds.h:69
const Ogre::Vector4 & getAmbientFactors() const
Get ambient factors.
Definition: VClouds.h:385
const Ogre::Vector2 getWindDirectionV2() const
Get wind direction as a Vector2.
Definition: VClouds.h:296
Ogre::uint8 vclouds
VClouds render queue group.
Definition: VClouds.h:54
Ogre::uint8 vclouds
VClouds render queue group.
Definition: SkyX.h:83
const RenderQueueGroups & getRenderQueueGroups() const
Get render queue groups.
Definition: VClouds.h:272
const Ogre::Real & getGlobalOpacity() const
Get global opacity.
Definition: VClouds.h:401
Ogre::Camera * getCamera()
Get current rendering camera.
Definition: VClouds.h:492
GeometryManager * getGeometryManager()
Get geometry manager.
Definition: VClouds.h:508
Definition: LightningManager.h:37
const Ogre::Vector3 & getSunColor() const
Get sun color.
Definition: VClouds.h:342
DataManager * getDataManager()
Get data manager.
Definition: VClouds.h:500
const Ogre::Real & getCloudFieldScale() const
Get cloud field scale.
Definition: VClouds.h:417
Camera data struct.
Definition: VClouds.h:113
Ogre::Vector2 Height
Height: x = Altitude over the camera, y: Field height (both in world coordinates) ...
Definition: VClouds.h:65
const Ogre::Vector3 & getAmbientColor() const
Get Ambient color.
Definition: VClouds.h:355
void create()
Create SkyX.
Ogre::uint8 vcloudsLightnings
VClouds lightnings render queue group.
Definition: SkyX.h:85
void notifyCameraRender(Ogre::Camera *c)
Notify camera render (to be invoked per camera and per frame)
Definition: GeometryManager.h:36
Ogre::Radian Beta
Definition: VClouds.h:67
Definition: DataManager.h:37
Ogre::Camera * mCamera
Current rendering camera.
Definition: SkyX.h:404
GeometrySettings()
Default constructor.
Definition: VClouds.h:77
Ogre::Vector3 lastPosition
Last camera position.
Definition: VClouds.h:140
Ogre::Vector2 cameraOffset
Camera offset.
Definition: VClouds.h:142
const Ogre::Vector4 & getLightResponse() const
Get light response.
Definition: VClouds.h:372
Ogre::Camera * camera
Camera.
Definition: VClouds.h:138
RenderQueueGroups(const Ogre::uint8 &vc, const Ogre::uint8 &vcl)
Constructor.
Definition: VClouds.h:48
Ogre::Vector3 mSunDirection
Sun direction.
Definition: BasicController.h:128
const Ogre::Real & getNoiseScale() const
Get noise scale.
Definition: VClouds.h:433
const float & getWindSpeed() const
Get wind speed.
Definition: VClouds.h:313
void setSunDirection(const Ogre::Vector3 &SunDirection)
Set sun direction.
Definition: VClouds.h:321
void setCloudFieldScale(const Ogre::Real &CloudFieldScale)
Set cloud field scale.
Definition: VClouds.h:409
const bool & isVisible() const
Is VClouds visible?
Definition: VClouds.h:476
const Ogre::Vector3 & getSunDirection() const
Get sun direction.
Definition: VClouds.h:329
std::vector< CameraData > & _getCamerasData()
Get cameras data.
Definition: VClouds.h:525
Geometry settings.
Definition: VClouds.h:61
SkyX(Ogre::SceneManager *sm, Controller *c)
Contructor.
void setWindDirection(const Ogre::Radian &WindDirection)
Set wind direction.
Definition: VClouds.h:280
void setEnabled(bool _enabled)
Definition: SkyX.h:355
void setWindSpeed(const float &WindSpeed)
Set wind speed.
Definition: VClouds.h:305
void setRenderQueueGroups(const RenderQueueGroups &rqg)
Set render queue groups.
Ogre::Vector3 geometryDisplacement
Geometry displacement.
Definition: VClouds.h:144
bool mCreated
Is SkyX created?
Definition: SkyX.h:422
GeometrySettings(const Ogre::Vector2 &_Height, const float &_Radius, const Ogre::Radian &_Alpha=Ogre::Degree(12), const Ogre::Radian &_Beta=Ogre::Degree(40), const int &_NumberOfBlocks=12, const int &_Na=10, const int &_Nb=8, const int &_Nc=6)
Constructor.
Definition: VClouds.h:97
void setGlobalOpacity(const Ogre::Real &GlobalOpacity)
Set global opacity.
Definition: VClouds.h:393
void setDistanceFallingParams(const Ogre::Vector2 &DistanceFallingParams)
Set distance falling params.
Definition: VClouds.h:239
RenderQueueGroups mRenderQueueGroups
Render queue groups.
Definition: SkyX.h:419
const GeometrySettings & getGeometrySettings() const
Get geometry settings.
Definition: VClouds.h:224
void setVisible(const bool &visible)
Set visible.
void setNoiseScale(const Ogre::Real &NoiseScale)
Set noise scale.
Definition: VClouds.h:425
int Nc
Definition: VClouds.h:73
Ogre::SceneManager * getSceneManager()
Get scene manager.
Definition: VClouds.h:484
Ogre::uint8 vcloudsLightnings
VClouds lightnings render queue group.
Definition: VClouds.h:56
Ogre::SceneManager * mSceneManager
Scene manager.
Definition: SkyX.h:398
void setGeometrySettings(const GeometrySettings &gs)
Set geometry settings.
Definition: VClouds.h:216
int NumberOfBlocks
Number of blocks.
Definition: VClouds.h:71
Render queue groups.
Definition: VClouds.h:42
class __declspec(dllimport) BasicController void update(const Ogre::Real &simDeltaTime)
Basic controller class.
#define DllExport
Include external headers.
Definition: Prerequisites.h:45
bool mVisible
Is SkyX visible?
Definition: SkyX.h:432
const Ogre::Radian & getWindDirection() const
Get wind direction.
Definition: VClouds.h:288