28namespace SkyX {
namespace VClouds
35 , mDistanceFallingParams(
Ogre::Vector2(1,-1))
37 , mWindDirection(
Ogre::Degree(0))
39 , mWheater(
Ogre::Vector2(0.5f, 1.0f))
40 , mDelayedResponse(false)
41 , mSunDirection(
Ogre::Vector3(0,-1,0))
42 , mSunColor(
Ogre::Vector3(1,1,1))
43 , mAmbientColor(
Ogre::Vector3(0.63f,0.63f,0.7f))
44 , mLightResponse(
Ogre::Vector4(0.25f,0.2f,1.0f,0.1f))
45 , mAmbientFactors(
Ogre::Vector4(0.45f,0.3f,0.6f,1))
46 , mGlobalOpacity(1.0f)
47 , mCloudFieldScale(1.0f)
54 , mVolCloudsMaterial(
Ogre::MaterialPtr())
55 , mVolCloudsLightningMaterial(
Ogre::MaterialPtr())
72 mVolCloudsMaterial =
static_cast<Ogre::MaterialPtr
>(Ogre::MaterialManager::getSingleton().getByName(
"SkyX_VolClouds"));
73 mVolCloudsLightningMaterial =
static_cast<Ogre::MaterialPtr
>(Ogre::MaterialManager::getSingleton().getByName(
"SkyX_VolClouds_Lightning"));
77 SkyXLOG(
"Error while creating SkyX::VClouds::VClouds, materials are not found");
91 ->getTechnique(0)->getPass(0)->getVertexProgramParameters()->setNamedConstant(
"uRadius",
mGeometrySettings.
Radius);
93 getTechnique(0)->getPass(0)->getVertexProgramParameters()->setNamedConstant(
"uRadius",
mGeometrySettings.
Radius);
163 getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(
"uSunDirection", -
mSunDirection);
170 getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(
"uSunDirection", -
mSunDirection);
184 bool isRegistered =
false;
197 SkyXLOG(
"VClouds warning: unregistered camera registered, manual unregistering is needed before camera destruction");
224 if ((*it).camera == c)
267 ->setNamedConstant(
"uSunColor",
mSunColor);
269 ->setNamedConstant(
"uSunColor",
mSunColor);
317 void VClouds::setWheater(
const float& Humidity,
const float& AverageCloudsSize,
const bool& DelayedResponse)
319 mWheater = Ogre::Vector2(Humidity, AverageCloudsSize);
317 void VClouds::setWheater(
const float& Humidity,
const float& AverageCloudsSize,
const bool& DelayedResponse) {
…}
const Ogre::Real _getInterpolation() const
Get current interpolation factor.
void setWheater(const float &Humidity, const float &AverageCloudsSize, const bool &delayedResponse=true)
Set wheater parameters Use this funtion to update the cloud field parameters, you'll get a smart and ...
void create(const int &nx, const int &ny, const int &nz)
Create.
void update(const Ogre::Real &timeSinceLastFrame)
Update.
const Ogre::Vector2 getHeight() const
Get height (x = Altitude over the camera, y: Field height (both in world coordinates))
void create(const Ogre::Vector2 &Height, const float &Radius, const Ogre::Radian &Alpha, const Ogre::Radian &Beta, const int &NumberOfBlocks, const int &Na, const int &Nb, const int &Nc)
Create.
const Ogre::Vector3 _getCurrentDistance() const
Get current camera to cloud field distance.
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
Ogre::SceneNode * getSceneNode()
Get scene node.
void updateGeometry(Ogre::Camera *c, const Ogre::Real &timeSinceLastCameraFrame)
Update geoemtry.
void _updateRenderQueueGroup(const Ogre::uint8 &rqg)
Update render queue group.
const bool & isEnabled() const
Get whether the lightning system is enabled or not.
void updateMaterial()
Update material.
void _updateRenderQueueGroup(const Ogre::uint8 &rqg)
Update render queue group.
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
void _setVisible(const bool &v)
Set visible.
Ogre::Vector3 mAmbientColor
Ambient color.
void setAmbientColor(const Ogre::Vector3 &AmbientColor)
Set ambient color.
Ogre::MaterialPtr mVolCloudsMaterial
Vol. clouds material.
void setVisible(const bool &visible)
Set visible.
Ogre::MaterialPtr mVolCloudsLightningMaterial
Vol. clouds + lightning material.
bool mCreated
Has been create(...) already called?
LightningManager * mLightningManager
Lightning manager.
void setRenderQueueGroups(const RenderQueueGroups &rqg)
Set render queue groups.
Ogre::Vector2 mWheater
Wheater parameters: x = Humidity, y = Average clouds size, both un [0,1] range.
bool mVisible
Is VClouds visible?
std::vector< CameraData > mCamerasData
Cameras data.
RenderQueueGroups mRenderQueueGroups
Render queue groups.
void registerCamera(Ogre::Camera *c)
Register camera.
Ogre::Vector4 mLightResponse
Light response: x - Sun light power y - Sun beta multiplier z - Ambient color multiplier w - Distance...
bool mDelayedResponse
Delayed response (This param is stored to allow the user call setWheater(...) before create() )
void setLightResponse(const Ogre::Vector4 &LightResponse)
Set light response.
void setAmbientFactors(const Ogre::Vector4 &AmbientFactors)
Set ambient factors.
Ogre::Vector3 mSunDirection
Sun direction.
void notifyCameraRender(Ogre::Camera *c, const Ogre::Real &timeSinceLastCameraFrame)
Notify camera render, to be invoked per-camera and per-frame.
Ogre::Vector4 mAmbientFactors
Ambient factors x - constant, y - linear, z - cuadratic, w - cubic.
Ogre::Camera * mCamera
Current rendering camera.
GeometryManager * mGeometryManager
Geometry manager.
void setWheater(const float &Humidity, const float &AverageCloudsSize, const bool &DelayedResponse)
Set wheater parameters Use this funtion to update the cloud field parameters, you'll get a smart and ...
void unregisterCamera(Ogre::Camera *c)
Unregister camera.
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
void setSunColor(const Ogre::Vector3 &SunColor)
Set sun color.
Ogre::Vector3 mSunColor
Sun color.
DataManager * mDataManager
Data manager.
GeometrySettings mGeometrySettings
Geometry settings.
#define SkyXLOG(msg)
Include external headers.
int NumberOfBlocks
Number of blocks.
int Na
Number of slices per geometry zone.
Ogre::Radian Alpha
Angles.
Ogre::Vector2 Height
Height: x = Altitude over the camera, y: Field height (both in world coordinates)
Ogre::uint8 vclouds
VClouds render queue group.
Ogre::uint8 vcloudsLightningsUnder
VClouds lightnings render queue group (when the camera is under the cloud field)
Ogre::uint8 vcloudsLightningsOver
VClouds lightnings render queue group (when the camera is over the cloud field)