Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Private Attributes
SkyX::VClouds::VClouds Class Reference

Description

Definition at line 35 of file VClouds.h.

Data Structures

struct  CameraData
 
struct  GeometrySettings
 
struct  RenderQueueGroups
 

Public Member Functions

 VClouds (Ogre::SceneManager *sm)
 
 ~VClouds ()
 
void create ()
 
void create (const GeometrySettings &gs)
 
void create (const Ogre::Vector2 &Height, const float &Radius)
 
void remove ()
 
void update (const Ogre::Real &timeSinceLastFrame)
 
void notifyCameraRender (Ogre::Camera *c, const Ogre::Real &timeSinceLastCameraFrame)
 
void registerCamera (Ogre::Camera *c)
 
void unregisterCamera (Ogre::Camera *c)
 
const bool & isCreated () const
 
void setGeometrySettings (const GeometrySettings &gs)
 
const GeometrySettings & getGeometrySettings () const
 
void setDistanceFallingParams (const Ogre::Vector2 &DistanceFallingParams)
 
const Ogre::Vector2 & getDistanceFallingParams () const
 
void setRenderQueueGroups (const RenderQueueGroups &rqg)
 
const RenderQueueGroups & getRenderQueueGroups () const
 
void setWindDirection (const Ogre::Radian &WindDirection)
 
const Ogre::Radian & getWindDirection () const
 
const Ogre::Vector2 getWindDirectionV2 () const
 
void setWindSpeed (const float &WindSpeed)
 
const float & getWindSpeed () const
 
void setSunDirection (const Ogre::Vector3 &SunDirection)
 
const Ogre::Vector3 & getSunDirection () const
 
void setSunColor (const Ogre::Vector3 &SunColor)
 
const Ogre::Vector3 & getSunColor () const
 
void setAmbientColor (const Ogre::Vector3 &AmbientColor)
 
const Ogre::Vector3 & getAmbientColor () const
 
void setLightResponse (const Ogre::Vector4 &LightResponse)
 
const Ogre::Vector4 & getLightResponse () const
 
void setAmbientFactors (const Ogre::Vector4 &AmbientFactors)
 
const Ogre::Vector4 & getAmbientFactors () const
 
void setGlobalOpacity (const Ogre::Real &GlobalOpacity)
 
const Ogre::Real & getGlobalOpacity () const
 
void setCloudFieldScale (const Ogre::Real &CloudFieldScale)
 
const Ogre::Real & getCloudFieldScale () const
 
void setNoiseScale (const Ogre::Real &NoiseScale)
 
const Ogre::Real & getNoiseScale () const
 
void setWheater (const float &Humidity, const float &AverageCloudsSize, const bool &DelayedResponse)
 
const Ogre::Vector2 & getWheater () const
 
void setVisible (const bool &visible)
 
const bool & isVisible () const
 
Ogre::SceneManager * getSceneManager ()
 
Ogre::Camera * getCamera ()
 
DataManager * getDataManager ()
 
GeometryManager * getGeometryManager ()
 
LightningManager * getLightningManager ()
 
std::vector< CameraData > & _getCamerasData ()
 

Private Attributes

bool mCreated
 
GeometrySettings mGeometrySettings
 
Ogre::Vector2 mDistanceFallingParams
 
RenderQueueGroups mRenderQueueGroups
 
Ogre::Radian mWindDirection
 
float mWindSpeed
 
Ogre::Vector2 mWheater
 
bool mDelayedResponse
 
Ogre::Vector3 mSunDirection
 
Ogre::Vector3 mSunColor
 
Ogre::Vector3 mAmbientColor
 
Ogre::Vector4 mLightResponse
 
Ogre::Vector4 mAmbientFactors
 
float mGlobalOpacity
 
float mCloudFieldScale
 
float mNoiseScale
 
bool mVisible
 
DataManager * mDataManager
 
GeometryManager * mGeometryManager
 
LightningManager * mLightningManager
 
Ogre::SceneManager * mSceneManager
 
Ogre::Camera * mCamera
 
Ogre::MaterialPtr mVolCloudsMaterial
 
Ogre::MaterialPtr mVolCloudsLightningMaterial
 
std::vector< CameraData > mCamerasData
 

Constructor & Destructor Documentation

◆ VClouds()

SkyX::VClouds::VClouds::VClouds ( Ogre::SceneManager *  sm)

Simple constructor.

Parameters
smScene manager

Definition at line 30 of file VClouds.cpp.

◆ ~VClouds()

SkyX::VClouds::VClouds::~VClouds ( )

Destructor.

Definition at line 59 of file VClouds.cpp.

Member Function Documentation

◆ _getCamerasData()

std::vector< CameraData > & SkyX::VClouds::VClouds::_getCamerasData ( )
inline

Get cameras data.

Returns
Cameras data
Remarks
Only for internal use

Definition at line 500 of file VClouds.h.

◆ create() [1/3]

void SkyX::VClouds::VClouds::create ( )

Create.

Definition at line 68 of file VClouds.cpp.

◆ create() [2/3]

void SkyX::VClouds::VClouds::create ( const GeometrySettings &  gs)

Create.

Parameters
gsGeometry settings

Definition at line 110 of file VClouds.cpp.

◆ create() [3/3]

void SkyX::VClouds::VClouds::create ( const Ogre::Vector2 &  Height,
const float &  Radius 
)

Create.

Parameters
Heightx = Cloud field y-coord start, y: Field height (both in world coordinates)
RadiusRadius

Definition at line 118 of file VClouds.cpp.

◆ getAmbientColor()

const Ogre::Vector3 & SkyX::VClouds::VClouds::getAmbientColor ( ) const
inline

Get Ambient color.

Returns
Ambient color

Definition at line 342 of file VClouds.h.

◆ getAmbientFactors()

const Ogre::Vector4 & SkyX::VClouds::VClouds::getAmbientFactors ( ) const
inline

Get ambient factors.

Returns
Ambient factors

Definition at line 372 of file VClouds.h.

◆ getCamera()

Ogre::Camera * SkyX::VClouds::VClouds::getCamera ( )
inline

Get current rendering camera.

Returns
Current rendering camera

Definition at line 467 of file VClouds.h.

◆ getCloudFieldScale()

const Ogre::Real & SkyX::VClouds::VClouds::getCloudFieldScale ( ) const
inline

Get cloud field scale.

Returns
Cloud field scale

Definition at line 404 of file VClouds.h.

◆ getDataManager()

DataManager * SkyX::VClouds::VClouds::getDataManager ( )
inline

Get data manager.

Returns
Data manager

Definition at line 475 of file VClouds.h.

◆ getDistanceFallingParams()

const Ogre::Vector2 & SkyX::VClouds::VClouds::getDistanceFallingParams ( ) const
inline

Get distance falling params.

Returns
DistanceFallingParams.x = Distance falling factor (How much the cloud field geometry falls with the distance) Remember that the geometry falling is relative to the distance(height) between the camera and the cloud field. Typical range is [0, ~2] 0 = no falling DistanceFallingParams.y = Max falling (in world coords), useful when , i.e., you've water and you want to go in. That param will allow you to avoid the cloud field geometry falls into the ocean. -1 means not max falling. (default)
Remarks
See GoemetryBlock::_setVertexData(...) for more info

Definition at line 247 of file VClouds.h.

◆ getGeometryManager()

GeometryManager * SkyX::VClouds::VClouds::getGeometryManager ( )
inline

Get geometry manager.

Returns
Geometry manager

Definition at line 483 of file VClouds.h.

◆ getGeometrySettings()

const GeometrySettings & SkyX::VClouds::VClouds::getGeometrySettings ( ) const
inline

Get geometry settings.

Returns
Geometry settings

Definition at line 217 of file VClouds.h.

◆ getGlobalOpacity()

const Ogre::Real & SkyX::VClouds::VClouds::getGlobalOpacity ( ) const
inline

Get global opacity.

Returns
Global opacity

Definition at line 388 of file VClouds.h.

◆ getLightningManager()

LightningManager * SkyX::VClouds::VClouds::getLightningManager ( )
inline

Get lightning manager.

Returns
Lightning manager

Definition at line 491 of file VClouds.h.

◆ getLightResponse()

const Ogre::Vector4 & SkyX::VClouds::VClouds::getLightResponse ( ) const
inline

Get light response.

Returns
Light response

Definition at line 359 of file VClouds.h.

◆ getNoiseScale()

const Ogre::Real & SkyX::VClouds::VClouds::getNoiseScale ( ) const
inline

Get noise scale.

Returns
Noise scale

Definition at line 420 of file VClouds.h.

◆ getRenderQueueGroups()

const RenderQueueGroups & SkyX::VClouds::VClouds::getRenderQueueGroups ( ) const
inline

Get render queue groups.

Returns
Current render queue groups

Definition at line 260 of file VClouds.h.

◆ getSceneManager()

Ogre::SceneManager * SkyX::VClouds::VClouds::getSceneManager ( )
inline

Get scene manager.

Returns
Ogre::SceneManager pointer

Definition at line 459 of file VClouds.h.

◆ getSunColor()

const Ogre::Vector3 & SkyX::VClouds::VClouds::getSunColor ( ) const
inline

Get sun color.

Returns
Sun color

Definition at line 329 of file VClouds.h.

◆ getSunDirection()

const Ogre::Vector3 & SkyX::VClouds::VClouds::getSunDirection ( ) const
inline

Get sun direction.

Returns
Sun direction

Definition at line 316 of file VClouds.h.

◆ getWheater()

const Ogre::Vector2 & SkyX::VClouds::VClouds::getWheater ( ) const
inline

Get wheater.

Returns
Wheater parameters: x = Humidity, y = Average clouds size, both un [0,1] range

Definition at line 438 of file VClouds.h.

◆ getWindDirection()

const Ogre::Radian & SkyX::VClouds::VClouds::getWindDirection ( ) const
inline

Get wind direction.

Returns
Wind direction

Definition at line 276 of file VClouds.h.

◆ getWindDirectionV2()

const Ogre::Vector2 SkyX::VClouds::VClouds::getWindDirectionV2 ( ) const
inline

Get wind direction as a Vector2.

Returns
Wind direction

Definition at line 284 of file VClouds.h.

◆ getWindSpeed()

const float & SkyX::VClouds::VClouds::getWindSpeed ( ) const
inline

Get wind speed.

Returns
Wind speed

Definition at line 300 of file VClouds.h.

◆ isCreated()

const bool & SkyX::VClouds::VClouds::isCreated ( ) const
inline

Has been create() already called?

Returns
true if created() have been already called, false if not

Definition at line 200 of file VClouds.h.

◆ isVisible()

const bool & SkyX::VClouds::VClouds::isVisible ( ) const
inline

Is VClouds visible?

Returns
true if VClouds is visible, false otherwise

Definition at line 451 of file VClouds.h.

◆ notifyCameraRender()

void SkyX::VClouds::VClouds::notifyCameraRender ( Ogre::Camera *  c,
const Ogre::Real &  timeSinceLastCameraFrame 
)

Notify camera render, to be invoked per-camera and per-frame.

Parameters
cRendering camera
timeSinceLastCameraFrameTime since last CAMERA frame

Definition at line 174 of file VClouds.cpp.

◆ registerCamera()

void SkyX::VClouds::VClouds::registerCamera ( Ogre::Camera *  c)

Register camera.

Parameters
cCamera
Remarks
If a rendering camera is used(in notifyCameraRender(...)) without having registered it before, all will work as expected but a warning will be logged since the user should manually unregister the camera one time it'll be remove

Definition at line 207 of file VClouds.cpp.

◆ remove()

void SkyX::VClouds::VClouds::remove ( )

Remove.

Definition at line 127 of file VClouds.cpp.

◆ setAmbientColor()

void SkyX::VClouds::VClouds::setAmbientColor ( const Ogre::Vector3 &  AmbientColor)

Set ambient color.

Parameters
AmbientColorAmbient color

Definition at line 272 of file VClouds.cpp.

◆ setAmbientFactors()

void SkyX::VClouds::VClouds::setAmbientFactors ( const Ogre::Vector4 &  AmbientFactors)

Set ambient factors.

Parameters
AmbientFactorsx - constant, y - linear, z - cuadratic, w - cubic

Definition at line 302 of file VClouds.cpp.

◆ setCloudFieldScale()

void SkyX::VClouds::VClouds::setCloudFieldScale ( const Ogre::Real &  CloudFieldScale)
inline

Set cloud field scale.

Parameters
CloudFieldScaleCloud field scale

Definition at line 396 of file VClouds.h.

◆ setDistanceFallingParams()

void SkyX::VClouds::VClouds::setDistanceFallingParams ( const Ogre::Vector2 &  DistanceFallingParams)
inline

Set distance falling params.

Parameters
DistanceFallingParamsDistanceFallingParams.x = Distance falling factor (How much the cloud field geometry falls with the distance) Remember that the geometry falling is relative to the distance(height) between the camera and the cloud field. Typical range is [0, ~2] 0 = no falling DistanceFallingParams.y = Max falling (in world coords), useful when , i.e., you've water and you want to go in. That param will allow you to avoid the cloud field geometry falls into the ocean. -1 means not max falling. (default)
Remarks
See GoemetryBlock::_setVertexData(...) for more info

Definition at line 232 of file VClouds.h.

◆ setGeometrySettings()

void SkyX::VClouds::VClouds::setGeometrySettings ( const GeometrySettings &  gs)
inline

Set geometry settings.

Parameters
GeometrySettingsGeometry settings
Remarks
Set geometry settings before call create(...)

Definition at line 209 of file VClouds.h.

◆ setGlobalOpacity()

void SkyX::VClouds::VClouds::setGlobalOpacity ( const Ogre::Real &  GlobalOpacity)
inline

Set global opacity.

Parameters
GlobalOpacityGlobal opacity: [0,1] range 0->Transparent cloud field

Definition at line 380 of file VClouds.h.

◆ setLightResponse()

void SkyX::VClouds::VClouds::setLightResponse ( const Ogre::Vector4 &  LightResponse)

Set light response.

Parameters
LightResponsex - Sun light power y - Sun beta multiplier z - Ambient color multiplier w - Distance attenuation

Definition at line 287 of file VClouds.cpp.

◆ setNoiseScale()

void SkyX::VClouds::VClouds::setNoiseScale ( const Ogre::Real &  NoiseScale)
inline

Set noise scale.

Parameters
NoiseScaleNoise scale

Definition at line 412 of file VClouds.h.

◆ setRenderQueueGroups()

void SkyX::VClouds::VClouds::setRenderQueueGroups ( const RenderQueueGroups &  rqg)

Set render queue groups.

Parameters
rqgRender queue groups

Definition at line 245 of file VClouds.cpp.

◆ setSunColor()

void SkyX::VClouds::VClouds::setSunColor ( const Ogre::Vector3 &  SunColor)

Set sun color.

Parameters
SunColorSun color

Definition at line 257 of file VClouds.cpp.

◆ setSunDirection()

void SkyX::VClouds::VClouds::setSunDirection ( const Ogre::Vector3 &  SunDirection)
inline

Set sun direction.

Parameters
SunDirectionSun direction

Definition at line 308 of file VClouds.h.

◆ setVisible()

void SkyX::VClouds::VClouds::setVisible ( const bool &  visible)

Set visible.

Parameters
visibletrue to set VClouds visible, false to hide it

Definition at line 232 of file VClouds.cpp.

◆ setWheater()

void SkyX::VClouds::VClouds::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 smooth transition from your old setting to your new ones.

Parameters
HumidityHumidity, in other words: the percentage of clouds in [0,1] range.
AverageCloudsSizeAverage clouds size, for example: if previous wheater clouds size parameter was very different from new one(i.e: more little) only the old biggest clouds are going to be keept and the little ones are going to be replaced
DelayedResponsefalse to change wheather conditions over several updates, true to change it at the moment

Definition at line 317 of file VClouds.cpp.

◆ setWindDirection()

void SkyX::VClouds::VClouds::setWindDirection ( const Ogre::Radian &  WindDirection)
inline

Set wind direction.

Parameters
WindDirectionWind direction

Definition at line 268 of file VClouds.h.

◆ setWindSpeed()

void SkyX::VClouds::VClouds::setWindSpeed ( const float &  WindSpeed)
inline

Set wind speed.

Parameters
WindSpeedWind speed

Definition at line 292 of file VClouds.h.

◆ unregisterCamera()

void SkyX::VClouds::VClouds::unregisterCamera ( Ogre::Camera *  c)

Unregister camera.

Parameters
cCamera
Remarks
After having used a camera (i.e. before removing the camera), the user should manually unregister it

Definition at line 220 of file VClouds.cpp.

◆ update()

void SkyX::VClouds::VClouds::update ( const Ogre::Real &  timeSinceLastFrame)

Update, to be invoked per frame.

Parameters
timeSinceLastFrameTime since last frame

Definition at line 147 of file VClouds.cpp.

Field Documentation

◆ mAmbientColor

Ogre::Vector3 SkyX::VClouds::VClouds::mAmbientColor
private

Ambient color.

Definition at line 534 of file VClouds.h.

◆ mAmbientFactors

Ogre::Vector4 SkyX::VClouds::VClouds::mAmbientFactors
private

Ambient factors x - constant, y - linear, z - cuadratic, w - cubic.

Definition at line 546 of file VClouds.h.

◆ mCamera

Ogre::Camera* SkyX::VClouds::VClouds::mCamera
private

Current rendering camera.

Definition at line 569 of file VClouds.h.

◆ mCamerasData

std::vector<CameraData> SkyX::VClouds::VClouds::mCamerasData
private

Cameras data.

Definition at line 577 of file VClouds.h.

◆ mCloudFieldScale

float SkyX::VClouds::VClouds::mCloudFieldScale
private

Cloud field scale.

Definition at line 552 of file VClouds.h.

◆ mCreated

bool SkyX::VClouds::VClouds::mCreated
private

Has been create(...) already called?

Definition at line 507 of file VClouds.h.

◆ mDataManager

DataManager* SkyX::VClouds::VClouds::mDataManager
private

Data manager.

Definition at line 560 of file VClouds.h.

◆ mDelayedResponse

bool SkyX::VClouds::VClouds::mDelayedResponse
private

Delayed response (This param is stored to allow the user call setWheater(...) before create() )

Definition at line 526 of file VClouds.h.

◆ mDistanceFallingParams

Ogre::Vector2 SkyX::VClouds::VClouds::mDistanceFallingParams
private

Geometry distance falling params.

Definition at line 513 of file VClouds.h.

◆ mGeometryManager

GeometryManager* SkyX::VClouds::VClouds::mGeometryManager
private

Geometry manager.

Definition at line 562 of file VClouds.h.

◆ mGeometrySettings

GeometrySettings SkyX::VClouds::VClouds::mGeometrySettings
private

Geometry settings.

Definition at line 510 of file VClouds.h.

◆ mGlobalOpacity

float SkyX::VClouds::VClouds::mGlobalOpacity
private

Global opacity.

Definition at line 549 of file VClouds.h.

◆ mLightningManager

LightningManager* SkyX::VClouds::VClouds::mLightningManager
private

Lightning manager.

Definition at line 564 of file VClouds.h.

◆ mLightResponse

Ogre::Vector4 SkyX::VClouds::VClouds::mLightResponse
private

Light response: x - Sun light power y - Sun beta multiplier z - Ambient color multiplier w - Distance attenuation.

Definition at line 542 of file VClouds.h.

◆ mNoiseScale

float SkyX::VClouds::VClouds::mNoiseScale
private

Noise scale.

Definition at line 554 of file VClouds.h.

◆ mRenderQueueGroups

RenderQueueGroups SkyX::VClouds::VClouds::mRenderQueueGroups
private

Render queue groups.

Definition at line 516 of file VClouds.h.

◆ mSceneManager

Ogre::SceneManager* SkyX::VClouds::VClouds::mSceneManager
private

Ogre::SceneManager pointer.

Definition at line 567 of file VClouds.h.

◆ mSunColor

Ogre::Vector3 SkyX::VClouds::VClouds::mSunColor
private

Sun color.

Definition at line 532 of file VClouds.h.

◆ mSunDirection

Ogre::Vector3 SkyX::VClouds::VClouds::mSunDirection
private

Sun direction.

Definition at line 529 of file VClouds.h.

◆ mVisible

bool SkyX::VClouds::VClouds::mVisible
private

Is VClouds visible?

Definition at line 557 of file VClouds.h.

◆ mVolCloudsLightningMaterial

Ogre::MaterialPtr SkyX::VClouds::VClouds::mVolCloudsLightningMaterial
private

Vol. clouds + lightning material.

Definition at line 574 of file VClouds.h.

◆ mVolCloudsMaterial

Ogre::MaterialPtr SkyX::VClouds::VClouds::mVolCloudsMaterial
private

Vol. clouds material.

Definition at line 572 of file VClouds.h.

◆ mWheater

Ogre::Vector2 SkyX::VClouds::VClouds::mWheater
private

Wheater parameters: x = Humidity, y = Average clouds size, both un [0,1] range.

Definition at line 524 of file VClouds.h.

◆ mWindDirection

Ogre::Radian SkyX::VClouds::VClouds::mWindDirection
private

Wind direction.

Definition at line 519 of file VClouds.h.

◆ mWindSpeed

float SkyX::VClouds::VClouds::mWindSpeed
private

Wind speed.

Definition at line 521 of file VClouds.h.


The documentation for this class was generated from the following files: