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

#include <LightningManager.h>

+ Collaboration diagram for SkyX::VClouds::LightningManager:

Data Structures

class  Listener
 Listener class. More...
 

Public Member Functions

 LightningManager (VClouds *vc)
 Constructor. More...
 
 ~LightningManager ()
 Destructor. More...
 
void create ()
 Create. More...
 
void remove ()
 Remove. More...
 
void update (const Ogre::Real &timeSinceLastFrame)
 Update, to be invoked per frame. More...
 
LightningaddLightning (const Ogre::Vector3 &p, const Ogre::Vector3 &d, const Ogre::Real l, const Ogre::uint32 &div=static_cast< Ogre::uint32 >(Ogre::Math::RangeRandom(12, 30)))
 Add lightning. More...
 
void updateMaterial ()
 Update material. More...
 
void addListener (Listener *listener)
 Add listener. More...
 
void removeListener (Listener *listener)
 Remove listener. More...
 
void removeListeners ()
 Remove listeners. More...
 
const std::vector< Listener * > & getListeners () const
 Get listeners. More...
 
void setEnabled (const bool &enable)
 Enable or disable the lightning system. More...
 
const bool & isEnabled () const
 Get whether the lightning system is enabled or not. More...
 
void setLightningColor (const Ogre::Vector3 &c)
 Set lightning color. More...
 
const Ogre::Vector3 & getLightningColor () const
 Get lightning color. More...
 
void setLightningTimeMultiplier (const Ogre::Real &m)
 Set lightning time multiplier. More...
 
const Ogre::Real & getLightningTimeMultiplier () const
 Set lightning time multiplier. More...
 
void setAverageLightningApparitionTime (const Ogre::Real &alat)
 Set average lightning apparition time. More...
 
const Ogre::Real & getAverageLightningApparitionTime () const
 Get average lightning apparition time. More...
 
const bool & isCreated () const
 Has been create() already called? More...
 
void _updateRenderQueueGroup (const Ogre::uint8 &rqg)
 Update render queue group. More...
 
void _setVisible (const bool &v)
 Set visible. More...
 

Private Attributes

std::vector< Lightning * > mLightnings
 Lightnings. More...
 
std::vector< Ogre::SceneNode * > mSceneNodes
 Scene nodes. More...
 
bool mEnabled
 Is the lightning system enabled? More...
 
Ogre::Vector3 mLightningColor
 Lightning color. More...
 
Ogre::Real mLightningTimeMultiplier
 Lightning time multiplier. More...
 
Ogre::Real mAverageLightningApparitionTime
 Average lightning apparition time (in seconds) More...
 
Ogre::Real mRemainingTime
 Remaining time for next lightning. More...
 
Ogre::MaterialPtr mVolCloudsLightningMaterial
 Vol. clouds + lightning material. More...
 
Ogre::MaterialPtr mLightningMaterial
 Lightning material. More...
 
std::vector< Listener * > mListeners
 Listeners. More...
 
bool mCreated
 Has been create() already called? More...
 
VCloudsmVClouds
 VClouds pointer. More...
 

Detailed Description

Definition at line 35 of file LightningManager.h.

Constructor & Destructor Documentation

◆ LightningManager()

SkyX::VClouds::LightningManager::LightningManager ( VClouds vc)

Constructor.

Parameters
vcVClouds pointer

Definition at line 32 of file LightningManager.cpp.

◆ ~LightningManager()

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

Destructor.

Definition at line 48 of file LightningManager.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _setVisible()

void SkyX::VClouds::LightningManager::_setVisible ( const bool &  v)

Set visible.

Parameters
vVisible?
Remarks
Only for internal use. Use VClouds::setVisible(...) instead.

Definition at line 306 of file LightningManager.cpp.

+ Here is the caller graph for this function:

◆ _updateRenderQueueGroup()

void SkyX::VClouds::LightningManager::_updateRenderQueueGroup ( const Ogre::uint8 &  rqg)

Update render queue group.

Parameters
rqgRender queue group
Remarks
Only for internal use. Use VClouds::setRenderQueueGroups(...) instead.

Definition at line 298 of file LightningManager.cpp.

+ Here is the caller graph for this function:

◆ addLightning()

Lightning * SkyX::VClouds::LightningManager::addLightning ( const Ogre::Vector3 &  p,
const Ogre::Vector3 &  d,
const Ogre::Real  l,
const Ogre::uint32 &  div = static_cast<Ogre::uint32>(Ogre::Math::RangeRandom(12, 30)) 
)

Add lightning.

Parameters
pLightning position
dLightning direction
lLightning length
Returns
The lightning or null in error case (the max number of simultaneous lightnings is 3)
Remarks
The lightning will be automatically destroyed one time it'll be finished, so the returned ptr will not be available one time the lightning will have disappeared

Definition at line 202 of file LightningManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addListener()

void SkyX::VClouds::LightningManager::addListener ( Listener listener)
inline

Add listener.

Parameters
listenerListener

Definition at line 93 of file LightningManager.h.

◆ create()

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

Create.

Definition at line 53 of file LightningManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAverageLightningApparitionTime()

const Ogre::Real& SkyX::VClouds::LightningManager::getAverageLightningApparitionTime ( ) const
inline

Get average lightning apparition time.

Returns
Average lightning apparition time

Definition at line 174 of file LightningManager.h.

◆ getLightningColor()

const Ogre::Vector3& SkyX::VClouds::LightningManager::getLightningColor ( ) const
inline

Get lightning color.

Returns
Lightning color

Definition at line 140 of file LightningManager.h.

◆ getLightningTimeMultiplier()

const Ogre::Real& SkyX::VClouds::LightningManager::getLightningTimeMultiplier ( ) const
inline

Set lightning time multiplier.

Returns
Lightning time multiplier

Definition at line 157 of file LightningManager.h.

◆ getListeners()

const std::vector<Listener*>& SkyX::VClouds::LightningManager::getListeners ( ) const
inline

Get listeners.

Returns
Listeners

Definition at line 113 of file LightningManager.h.

◆ isCreated()

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

Has been create() already called?

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

Definition at line 182 of file LightningManager.h.

◆ isEnabled()

const bool& SkyX::VClouds::LightningManager::isEnabled ( ) const
inline

Get whether the lightning system is enabled or not.

Returns
true if the lightning system is enabled, false otherwise
Remarks
Even if the lightning system is disabled, you'll be able to manually add lightnings trhough LightningManager::addLightning(...)

Definition at line 127 of file LightningManager.h.

+ Here is the caller graph for this function:

◆ remove()

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

Remove.

Definition at line 80 of file LightningManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeListener()

void SkyX::VClouds::LightningManager::removeListener ( Listener listener)

Remove listener.

Parameters
listenerListener to be removed

Definition at line 269 of file LightningManager.cpp.

◆ removeListeners()

void SkyX::VClouds::LightningManager::removeListeners ( )
inline

Remove listeners.

Definition at line 105 of file LightningManager.h.

+ Here is the caller graph for this function:

◆ setAverageLightningApparitionTime()

void SkyX::VClouds::LightningManager::setAverageLightningApparitionTime ( const Ogre::Real &  alat)
inline

Set average lightning apparition time.

Parameters
alatAverage lightning apparition time

Definition at line 165 of file LightningManager.h.

+ Here is the caller graph for this function:

◆ setEnabled()

void SkyX::VClouds::LightningManager::setEnabled ( const bool &  enable)

Enable or disable the lightning system.

Parameters
enabletrue to enable the lightning system, false otherwise

Definition at line 281 of file LightningManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLightningColor()

void SkyX::VClouds::LightningManager::setLightningColor ( const Ogre::Vector3 &  c)

Set lightning color.

Parameters
cLightning color

Definition at line 253 of file LightningManager.cpp.

+ Here is the caller graph for this function:

◆ setLightningTimeMultiplier()

void SkyX::VClouds::LightningManager::setLightningTimeMultiplier ( const Ogre::Real &  m)
inline

Set lightning time multiplier.

Parameters
cLightning time multiplier
Remarks
Changes applies to new lightnings, not to existing ones

Definition at line 149 of file LightningManager.h.

+ Here is the caller graph for this function:

◆ update()

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

Update, to be invoked per frame.

Parameters
timeSinceLastFrameTime since last frame

Definition at line 105 of file LightningManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateMaterial()

void SkyX::VClouds::LightningManager::updateMaterial ( )

Update material.

Remarks
To be invoked before each camera rendering process

Definition at line 230 of file LightningManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ mAverageLightningApparitionTime

Ogre::Real SkyX::VClouds::LightningManager::mAverageLightningApparitionTime
private

Average lightning apparition time (in seconds)

Definition at line 214 of file LightningManager.h.

◆ mCreated

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

Has been create() already called?

Definition at line 227 of file LightningManager.h.

◆ mEnabled

bool SkyX::VClouds::LightningManager::mEnabled
private

Is the lightning system enabled?

Definition at line 206 of file LightningManager.h.

◆ mLightningColor

Ogre::Vector3 SkyX::VClouds::LightningManager::mLightningColor
private

Lightning color.

Definition at line 209 of file LightningManager.h.

◆ mLightningMaterial

Ogre::MaterialPtr SkyX::VClouds::LightningManager::mLightningMaterial
private

Lightning material.

Definition at line 221 of file LightningManager.h.

◆ mLightnings

std::vector<Lightning*> SkyX::VClouds::LightningManager::mLightnings
private

Lightnings.

Definition at line 201 of file LightningManager.h.

◆ mLightningTimeMultiplier

Ogre::Real SkyX::VClouds::LightningManager::mLightningTimeMultiplier
private

Lightning time multiplier.

Definition at line 211 of file LightningManager.h.

◆ mListeners

std::vector<Listener*> SkyX::VClouds::LightningManager::mListeners
private

Listeners.

Definition at line 224 of file LightningManager.h.

◆ mRemainingTime

Ogre::Real SkyX::VClouds::LightningManager::mRemainingTime
private

Remaining time for next lightning.

Definition at line 216 of file LightningManager.h.

◆ mSceneNodes

std::vector<Ogre::SceneNode*> SkyX::VClouds::LightningManager::mSceneNodes
private

Scene nodes.

Definition at line 203 of file LightningManager.h.

◆ mVClouds

VClouds* SkyX::VClouds::LightningManager::mVClouds
private

VClouds pointer.

Definition at line 230 of file LightningManager.h.

◆ mVolCloudsLightningMaterial

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

Vol. clouds + lightning material.

Definition at line 219 of file LightningManager.h.


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