|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
28 namespace 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())
68 void VClouds::create()
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);
118 void VClouds::create(
const Ogre::Vector2& Height,
const float& Radius)
127 void VClouds::remove()
147 void VClouds::update(
const Ogre::Real& timeSinceLastFrame)
163 getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(
"uSunDirection", -
mSunDirection);
170 getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(
"uSunDirection", -
mSunDirection);
174 void VClouds::notifyCameraRender(Ogre::Camera* c,
const Ogre::Real& timeSinceLastCameraFrame)
184 bool isRegistered =
false;
197 SkyXLOG(
"VClouds warning: unregistered camera registered, manual unregistering is needed before camera destruction");
207 void VClouds::registerCamera(Ogre::Camera* c)
220 void VClouds::unregisterCamera(Ogre::Camera* c)
224 if ((*it).camera == c)
232 void VClouds::setVisible(
const bool& visible)
257 void VClouds::setSunColor(
const Ogre::Vector3& SunColor)
267 ->setNamedConstant(
"uSunColor",
mSunColor);
269 ->setNamedConstant(
"uSunColor",
mSunColor);
272 void VClouds::setAmbientColor(
const Ogre::Vector3& AmbientColor)
287 void VClouds::setLightResponse(
const Ogre::Vector4& LightResponse)
302 void VClouds::setAmbientFactors(
const Ogre::Vector4& AmbientFactors)
317 void VClouds::setWheater(
const float& Humidity,
const float& AverageCloudsSize,
const bool& DelayedResponse)
319 mWheater = Ogre::Vector2(Humidity, AverageCloudsSize);
Ogre::Vector2 Height
Height: x = Altitude over the camera, y: Field height (both in world coordinates)
void create(const int &nx, const int &ny, const int &nz)
Create.
Ogre::Vector3 mAmbientColor
Ambient color.
std::vector< CameraData > mCamerasData
Cameras data.
int NumberOfBlocks
Number of blocks.
void _updateRenderQueueGroup(const Ogre::uint8 &rqg)
Update render queue group.
Ogre::uint8 vclouds
VClouds render queue group.
const Ogre::Vector3 _getCurrentDistance() const
Get current camera to cloud field distance.
Ogre::Radian Alpha
Angles.
GeometrySettings mGeometrySettings
Geometry settings.
void setLightResponse(const Ogre::Vector4 &LightResponse)
Set light response.
Ogre::MaterialPtr mVolCloudsLightningMaterial
Vol. clouds + lightning material.
const Ogre::Vector2 getHeight() const
Get height (x = Altitude over the camera, y: Field height (both in world coordinates))
Ogre::Vector2 mWheater
Wheater parameters: x = Humidity, y = Average clouds size, both un [0,1] range.
const bool & isEnabled() const
Get whether the lightning system is enabled or not.
const Ogre::Real _getInterpolation() const
Get current interpolation factor.
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.
Ogre::SceneNode * getSceneNode()
Get scene node.
bool mCreated
Has been create(...) already called?
bool mDelayedResponse
Delayed response (This param is stored to allow the user call setWheater(...) before create() )
RenderQueueGroups mRenderQueueGroups
Render queue groups.
GeometryManager * mGeometryManager
Geometry manager.
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
void _updateRenderQueueGroup(const Ogre::uint8 &rqg)
Update render queue group.
Ogre::Vector4 mAmbientFactors
Ambient factors x - constant, y - linear, z - cuadratic, w - cubic.
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
Ogre::Vector3 mSunColor
Sun color.
LightningManager * mLightningManager
Lightning manager.
Ogre::MaterialPtr mVolCloudsMaterial
Vol. clouds material.
bool mVisible
Is VClouds visible?
Ogre::Vector4 mLightResponse
Light response: x - Sun light power y - Sun beta multiplier z - Ambient color multiplier w - Distance...
void setSunColor(const Ogre::Vector3 &SunColor)
Set sun color.
void _setVisible(const bool &v)
Set visible.
int Na
Number of slices per geometry zone.
void setAmbientFactors(const Ogre::Vector4 &AmbientFactors)
Set ambient factors.
Ogre::uint8 vcloudsLightningsOver
VClouds lightnings render queue group (when the camera is over the cloud field)
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 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 ...
#define SkyXLOG(msg)
Include external headers.
Ogre::Camera * mCamera
Current rendering camera.
void updateMaterial()
Update material.
DataManager * mDataManager
Data manager.
void updateGeometry(Ogre::Camera *c, const Ogre::Real &timeSinceLastCameraFrame)
Update geoemtry.
Ogre::Vector3 mSunDirection
Sun direction.
Ogre::uint8 vcloudsLightningsUnder
VClouds lightnings render queue group (when the camera is under the cloud field)
void setAmbientColor(const Ogre::Vector3 &AmbientColor)
Set ambient color.
void update(const Ogre::Real &timeSinceLastFrame)
Update.