Classes | Public Member Functions | List of all members
SkyX::VClouds::LightningManager Class Reference

#include <LightningManager.h>

Classes

class  Listener
 Listener class. More...
 

Public Member Functions

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

Constructor & Destructor Documentation

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

Constructor.

Parameters
vcVClouds pointer
SkyX::VClouds::LightningManager::~LightningManager ( )

Destructor.

Member Function Documentation

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

Set visible.

Parameters
vVisible?
Remarks
Only for internal use. Use VClouds::setVisible(...) instead.
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.
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
void SkyX::VClouds::LightningManager::addListener ( Listener listener)
inline

Add listener.

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

Create.

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

Get average lightning apparition time.

Returns
Average lightning apparition time
const Ogre::Vector3& SkyX::VClouds::LightningManager::getLightningColor ( ) const
inline

Get lightning color.

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

Set lightning time multiplier.

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

Get listeners.

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

Has been create() already called?

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

References SkyX::mCreated.

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(...)

References SkyX::mEnabled.

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

Remove.

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

Remove listener.

Parameters
listenerListener to be removed
void SkyX::VClouds::LightningManager::removeListeners ( )
inline

Remove listeners.

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

Set average lightning apparition time.

Parameters
alatAverage lightning apparition time
void SkyX::VClouds::LightningManager::setEnabled ( const bool &  enable)

Enable or disable the lightning system.

Parameters
enabletrue to enable the lightning system, false otherwise
void SkyX::VClouds::LightningManager::setLightningColor ( const Ogre::Vector3 &  c)

Set lightning color.

Parameters
cLightning color
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
void SkyX::VClouds::LightningManager::update ( const Ogre::Real &  timeSinceLastFrame)

Update, to be invoked per frame.

Parameters
timeSinceLastFrameTime since last frame
void SkyX::VClouds::LightningManager::updateMaterial ( )

Update material.

Remarks
To be invoked before each camera rendering process

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