RigsofRods
Soft-body Physics Simulation
Data Structures | Public Types | Public Member Functions | Private Attributes
SkyX::SkyX Class Reference

SkyX class Create simple and beautiful skies! More...

#include <SkyX.h>

+ Inheritance diagram for SkyX::SkyX:
+ Collaboration diagram for SkyX::SkyX:

Data Structures

struct  RenderQueueGroups
 Render queue groups. More...
 

Public Types

enum  LightingMode { LM_LDR = 0, LM_HDR = 1 }
 Lighting mode enumeration SkyX is designed for true HDR rendering, but there is a big number of applications which don't use HDR rendering, due to this fact a little exponential tone-mapping algoritm is applied to SkyX materials if LM_LDR is selected. More...
 

Public Member Functions

 SkyX (Ogre::SceneManager *sm, Controller *c)
 Contructor. More...
 
 ~SkyX ()
 Destructor. More...
 
void create ()
 Create SkyX. More...
 
void remove ()
 Remove SkyX (free resources) More...
 
void update (const Ogre::Real &timeSinceLastFrame)
 Update (to be invoked per frame) More...
 
void notifyCameraRender (Ogre::Camera *c)
 Notify camera render (to be invoked per camera and per frame) More...
 
const bool isCreated () const
 Is SkyX created? More...
 
void setVisible (const bool &visible)
 Set visible. More...
 
const bool & isVisible () const
 Is SkyX visible? More...
 
void setTimeMultiplier (const Ogre::Real &TimeMultiplier)
 Set time multiplier. More...
 
const Ogre::Real & getTimeMultiplier () const
 Get time multiplier. More...
 
MeshManagergetMeshManager ()
 Get mesh manager. More...
 
AtmosphereManagergetAtmosphereManager ()
 Get atmosphere manager. More...
 
GPUManagergetGPUManager ()
 Get GPU manager. More...
 
MoonManagergetMoonManager ()
 Get moon manager. More...
 
CloudsManagergetCloudsManager ()
 Get clouds manager. More...
 
VCloudsManagergetVCloudsManager ()
 Get volumetric clouds manager. More...
 
void setController (Controller *c)
 Set controller. More...
 
ControllergetController () const
 Get current controller. More...
 
void setRenderQueueGroups (const RenderQueueGroups &rqg)
 Set render queue groups. More...
 
const RenderQueueGroupsgetRenderQueueGroups () const
 Get render queue groups. More...
 
void setLightingMode (const LightingMode &lm)
 Set lighting mode. More...
 
const LightingModegetLightingMode () const
 Get lighting mode. More...
 
void setStarfieldEnabled (const bool &Enabled)
 Set the starfield enabled/disabled. More...
 
const bool & isStarfieldEnabled () const
 Is the starfield enable? More...
 
void setInfiniteCameraFarClipDistance (const Ogre::Real &d)
 Set infinite camera far clip distance. More...
 
const Ogre::Real & getInfiniteCameraFarClipDistance () const
 Get infinite cmaera far clip distance. More...
 
Ogre::SceneManager * getSceneManager ()
 Get scene manager. More...
 
Ogre::Camera * getCamera ()
 Get current rendering camera. More...
 
bool frameStarted (const Ogre::FrameEvent &evt)
 Frame started. More...
 
void preViewportUpdate (const Ogre::RenderTargetViewportEvent &evt)
 Fired before update a render target viewport. More...
 
const Ogre::Real & _getTimeOffset () const
 Get time offset. More...
 
CfgFileManagergetCfgFileManager ()
 
const bool loadCfg (const Ogre::String &File) const
 

Private Attributes

bool mCreated
 Is SkyX created? More...
 
MeshManagermMeshManager
 Mesh manager. More...
 
AtmosphereManagermAtmosphereManager
 Atmosphere manager. More...
 
GPUManagermGPUManager
 GPU manager. More...
 
MoonManagermMoonManager
 Moon manager. More...
 
CloudsManagermCloudsManager
 Clouds manager. More...
 
VCloudsManagermVCloudsManager
 Volumetric clouds manager. More...
 
ControllermController
 Controller. More...
 
RenderQueueGroups mRenderQueueGroups
 Render queue groups. More...
 
Ogre::SceneManager * mSceneManager
 Scene manager. More...
 
Ogre::Camera * mCamera
 Current rendering camera. More...
 
Ogre::Vector3 mLastCameraPosition
 Last camera position. More...
 
Ogre::Real mLastCameraFarClipDistance
 Last camera far clip distance. More...
 
Ogre::Real mInfiniteCameraFarClipDistance
 Infinite camera far clip distance. More...
 
bool mVisible
 Is SkyX visible? More...
 
LightingMode mLightingMode
 Lighting mode. More...
 
bool mStarfield
 Enable starfield? More...
 
Ogre::Real mTimeMultiplier
 Time multiplier. More...
 
Ogre::Real mTimeOffset
 Time offset. More...
 
CfgFileManagermCfgFileManager
 

Detailed Description

SkyX class Create simple and beautiful skies!

Remarks
How to update SkyX: Updating SkyX is a very easy task that can be done manually or automatically by using listeners. There're two update steps in SkyX: per-frame update and per-camera update, and the order is very important. The per-frame update must be performed at first: SkyX::update(...), after that and before each camera render operation SkyX::notifyCameraRender(...) must be invoked. Both updates can be automatically performed by using listeners: the Ogre::FrameListener is used for the per-frame udpate, and the Ogre::RenderTargetListener is used for the per-camera update. For more information have a look to sample projects.

Definition at line 61 of file SkyX.h.

Member Enumeration Documentation

◆ LightingMode

Lighting mode enumeration SkyX is designed for true HDR rendering, but there is a big number of applications which don't use HDR rendering, due to this fact a little exponential tone-mapping algoritm is applied to SkyX materials if LM_LDR is selected.

(See: AtmosphereManager::Options::Exposure) Select LM_HDR if your app is designed for true HDR rendering. In HDR mode, we assume you're ussing a full linear rendering pipeline, so all textures are gamma corrected if needed.

Enumerator
LM_LDR 

Low dynamic range.

LM_HDR 

High dynamic range.

Definition at line 96 of file SkyX.h.

Constructor & Destructor Documentation

◆ SkyX()

SkyX::SkyX::SkyX ( Ogre::SceneManager *  sm,
Controller c 
)

Contructor.

Parameters
smOgre Scene manager
cSkyX controller

Definition at line 30 of file SkyX.cpp.

◆ ~SkyX()

SkyX::SkyX::~SkyX ( )

Destructor.

Definition at line 56 of file SkyX.cpp.

Member Function Documentation

◆ _getTimeOffset()

const Ogre::Real& SkyX::SkyX::_getTimeOffset ( ) const
inline

Get time offset.

Returns
Time offset
Remarks
Only for internal use

Definition at line 342 of file SkyX.h.

+ Here is the caller graph for this function:

◆ create()

void SkyX::SkyX::create ( )

Create SkyX.

Definition at line 76 of file SkyX.cpp.

◆ frameStarted()

bool SkyX::SkyX::frameStarted ( const Ogre::FrameEvent &  evt)

Frame started.

Parameters
evtFrame event

Definition at line 264 of file SkyX.cpp.

◆ getAtmosphereManager()

AtmosphereManager* SkyX::SkyX::getAtmosphereManager ( )
inline

Get atmosphere manager.

Returns
Atmosphere manager pointer

Definition at line 191 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getCamera()

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

Get current rendering camera.

Returns
Current rendering camera

Definition at line 323 of file SkyX.h.

◆ getCfgFileManager()

CfgFileManager* SkyX::SkyX::getCfgFileManager ( )
inline

Definition at line 347 of file SkyX.h.

◆ getCloudsManager()

CloudsManager* SkyX::SkyX::getCloudsManager ( )
inline

Get clouds manager.

Returns
Clouds manager

Definition at line 215 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getController()

Controller* SkyX::SkyX::getController ( ) const
inline

Get current controller.

Returns
Current controller

Definition at line 244 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getGPUManager()

GPUManager* SkyX::SkyX::getGPUManager ( )
inline

Get GPU manager.

Returns
Atmosphere manager pointer

Definition at line 199 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getInfiniteCameraFarClipDistance()

const Ogre::Real& SkyX::SkyX::getInfiniteCameraFarClipDistance ( ) const
inline

Get infinite cmaera far clip distance.

Returns
Infinite camera far clip distance

Definition at line 307 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getLightingMode()

const LightingMode& SkyX::SkyX::getLightingMode ( ) const
inline

Get lighting mode.

Returns
Lighting mode

Definition at line 275 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getMeshManager()

MeshManager* SkyX::SkyX::getMeshManager ( )
inline

Get mesh manager.

Returns
Mesh manager pointer

Definition at line 183 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getMoonManager()

MoonManager* SkyX::SkyX::getMoonManager ( )
inline

Get moon manager.

Returns
Moon manager

Definition at line 207 of file SkyX.h.

◆ getRenderQueueGroups()

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

Get render queue groups.

Returns
Current render queue groups

Definition at line 257 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getSceneManager()

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

Get scene manager.

Returns
Ogre scene manager

Definition at line 315 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getTimeMultiplier()

const Ogre::Real& SkyX::SkyX::getTimeMultiplier ( ) const
inline

Get time multiplier.

Returns
Time multiplier

Definition at line 175 of file SkyX.h.

+ Here is the caller graph for this function:

◆ getVCloudsManager()

VCloudsManager* SkyX::SkyX::getVCloudsManager ( )
inline

Get volumetric clouds manager.

Returns
Volumetric clouds manager

Definition at line 223 of file SkyX.h.

+ Here is the caller graph for this function:

◆ isCreated()

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

Is SkyX created?

Returns
true if yes, false if not

Definition at line 143 of file SkyX.h.

◆ isStarfieldEnabled()

const bool& SkyX::SkyX::isStarfieldEnabled ( ) const
inline

Is the starfield enable?

Returns
true if the starfield is enabled, false if it isn't

Definition at line 288 of file SkyX.h.

+ Here is the caller graph for this function:

◆ isVisible()

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

Is SkyX visible?

Returns
true if SkyX is visible, false otherwise

Definition at line 156 of file SkyX.h.

+ Here is the caller graph for this function:

◆ loadCfg()

const bool SkyX::SkyX::loadCfg ( const Ogre::String &  File) const
inline

Definition at line 352 of file SkyX.h.

◆ notifyCameraRender()

void SkyX::SkyX::notifyCameraRender ( Ogre::Camera *  c)

Notify camera render (to be invoked per camera and per frame)

Parameters
cCamera
Remarks
Invoke this method manually before the camera render operation Per-camera updates must be performed after the per-frame update through SkyX::update(...) Also it's possible to use listeners, making all this process transparent, just register SkyX in your render target through Ogre::RenderTarget::addListener(...)

Definition at line 154 of file SkyX.cpp.

◆ preViewportUpdate()

void SkyX::SkyX::preViewportUpdate ( const Ogre::RenderTargetViewportEvent &  evt)

Fired before update a render target viewport.

Parameters
evtRender target viewport event

Definition at line 270 of file SkyX.cpp.

◆ remove()

void SkyX::SkyX::remove ( )

Remove SkyX (free resources)

Definition at line 108 of file SkyX.cpp.

◆ setController()

void SkyX::SkyX::setController ( Controller c)
inline

Set controller.

Parameters
cController

Definition at line 231 of file SkyX.h.

◆ setInfiniteCameraFarClipDistance()

void SkyX::SkyX::setInfiniteCameraFarClipDistance ( const Ogre::Real &  d)
inline

Set infinite camera far clip distance.

Parameters
dInfinite camera far clip distance
Remarks
SkyX needs a finite camera far clip distance in order to builds its geometry. Since Ogre allows infinite far clip camera distances (camearFarClipDistance = 0) you'll need to manually provide a far clip distance if you're using an infinite camera far clip distance.

Definition at line 299 of file SkyX.h.

◆ setLightingMode()

void SkyX::SkyX::setLightingMode ( const LightingMode lm)

Set lighting mode.

Parameters
lmLighting mode
Remarks
SkyX is designed for true HDR rendering, but there're a lot of applications that doesn't use HDR rendering, due to this a little exponential tone-mapping algoritm is applied to SkyX materials if LM_LDR is selected. (See: AtmosphereManager::Options::Exposure) Select LM_HDR if your app is designed for true HDR rendering. In HDR mode, we assume you're ussing a full linear rendering pipeline, so all textures are gamma corrected if needed.

Definition at line 216 of file SkyX.cpp.

◆ setRenderQueueGroups()

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

Set render queue groups.

Parameters
rqgRender queue groups

Definition at line 200 of file SkyX.cpp.

◆ setStarfieldEnabled()

void SkyX::SkyX::setStarfieldEnabled ( const bool &  Enabled)

Set the starfield enabled/disabled.

Parameters
Enabledtrue for starfield, false for not

Definition at line 238 of file SkyX.cpp.

◆ setTimeMultiplier()

void SkyX::SkyX::setTimeMultiplier ( const Ogre::Real &  TimeMultiplier)
inline

Set time multiplier.

Parameters
TimeMultiplierTime multiplier
Remarks
The time multiplier can be a negative number, 0 will disable auto-updating For setting a custom time of day, check: AtmosphereManager::Options::Time

Definition at line 166 of file SkyX.h.

+ Here is the caller graph for this function:

◆ setVisible()

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

Set visible.

Parameters
visibletrue to set SkyX visible, false to hide it

Definition at line 182 of file SkyX.cpp.

◆ update()

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

Update (to be invoked per frame)

Parameters
timeSinceLastFrameTime elapsed since last frame
Remarks
Invoke this function only one time per frame. Per-frame update must be performed before per-camera updates through SkyX::notifyCameraRender(...) Also it's possible to use listeners, making all this process transparent, just register SkyX in ogre root through Ogre::Root::addFrameListener(...)

Definition at line 125 of file SkyX.cpp.

Field Documentation

◆ mAtmosphereManager

AtmosphereManager* SkyX::SkyX::mAtmosphereManager
private

Atmosphere manager.

Definition at line 364 of file SkyX.h.

◆ mCamera

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

Current rendering camera.

Definition at line 383 of file SkyX.h.

◆ mCfgFileManager

CfgFileManager* SkyX::SkyX::mCfgFileManager
private

Definition at line 405 of file SkyX.h.

◆ mCloudsManager

CloudsManager* SkyX::SkyX::mCloudsManager
private

Clouds manager.

Definition at line 370 of file SkyX.h.

◆ mController

Controller* SkyX::SkyX::mController
private

Controller.

Definition at line 375 of file SkyX.h.

◆ mCreated

bool SkyX::SkyX::mCreated
private

Is SkyX created?

Definition at line 359 of file SkyX.h.

◆ mGPUManager

GPUManager* SkyX::SkyX::mGPUManager
private

GPU manager.

Definition at line 366 of file SkyX.h.

◆ mInfiniteCameraFarClipDistance

Ogre::Real SkyX::SkyX::mInfiniteCameraFarClipDistance
private

Infinite camera far clip distance.

Definition at line 390 of file SkyX.h.

◆ mLastCameraFarClipDistance

Ogre::Real SkyX::SkyX::mLastCameraFarClipDistance
private

Last camera far clip distance.

Definition at line 388 of file SkyX.h.

◆ mLastCameraPosition

Ogre::Vector3 SkyX::SkyX::mLastCameraPosition
private

Last camera position.

Definition at line 386 of file SkyX.h.

◆ mLightingMode

LightingMode SkyX::SkyX::mLightingMode
private

Lighting mode.

Definition at line 396 of file SkyX.h.

◆ mMeshManager

MeshManager* SkyX::SkyX::mMeshManager
private

Mesh manager.

Definition at line 362 of file SkyX.h.

◆ mMoonManager

MoonManager* SkyX::SkyX::mMoonManager
private

Moon manager.

Definition at line 368 of file SkyX.h.

◆ mRenderQueueGroups

RenderQueueGroups SkyX::SkyX::mRenderQueueGroups
private

Render queue groups.

Definition at line 378 of file SkyX.h.

◆ mSceneManager

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

Scene manager.

Definition at line 381 of file SkyX.h.

◆ mStarfield

bool SkyX::SkyX::mStarfield
private

Enable starfield?

Definition at line 398 of file SkyX.h.

◆ mTimeMultiplier

Ogre::Real SkyX::SkyX::mTimeMultiplier
private

Time multiplier.

Definition at line 401 of file SkyX.h.

◆ mTimeOffset

Ogre::Real SkyX::SkyX::mTimeOffset
private

Time offset.

Definition at line 403 of file SkyX.h.

◆ mVCloudsManager

VCloudsManager* SkyX::SkyX::mVCloudsManager
private

Volumetric clouds manager.

Definition at line 372 of file SkyX.h.

◆ mVisible

bool SkyX::SkyX::mVisible
private

Is SkyX visible?

Definition at line 393 of file SkyX.h.


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