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

Main Hydrax class. More...

#include <Hydrax.h>

+ Collaboration diagram for Hydrax::Hydrax:

Data Structures

class  DeviceListener
 Device listener. More...
 

Public Member Functions

 Hydrax (Ogre::SceneManager *sm, Ogre::Camera *c, Ogre::Viewport *v)
 Constructor. More...
 
 ~Hydrax ()
 Destructor. More...
 
void create ()
 Create all resources according with current Hydrax components and add Hydrax to the scene. More...
 
void remove ()
 Remove hydrax, you can call this method to remove Hydrax from the scene or release (secondary) Hydrax memory, call create() to return Hydrax to the scene. More...
 
void update (const Ogre::Real &timeSinceLastFrame)
 Call every frame. More...
 
bool isComponent (const HydraxComponent &Component)
 Returns if the especified component is active. More...
 
void setComponents (const HydraxComponent &Components)
 Set Hydrax components. More...
 
void setModule (Module::Module *Module, const bool &DeleteOldModule=true)
 Set Hydrax module. More...
 
void setPolygonMode (const Ogre::PolygonMode &PM)
 Set polygon mode (Solid, Wireframe, Points) More...
 
void setShaderMode (const MaterialManager::ShaderMode &ShaderMode)
 Set shader mode. More...
 
void setPosition (const Ogre::Vector3 &Position)
 Set water position. More...
 
void rotate (const Ogre::Quaternion &q)
 Rotate water and planes. More...
 
const bool saveCfg (const Ogre::String &File, const Ogre::String &Path="") const
 Save hydrax config to file. More...
 
const bool loadCfg (const Ogre::String &File) const
 Load config from file. More...
 
void setPlanesError (const Ogre::Real &PlanesError)
 Set clip planes error. More...
 
void _setStrength (const Ogre::Real &Strength)
 Set water strength GPU param. More...
 
void setFullReflectionDistance (const Ogre::Real &FullReflectionDistance)
 Set full reflection distance. More...
 
void setGlobalTransparency (const Ogre::Real &GlobalTransparencyDistance)
 
void setWaterColor (const Ogre::Vector3 &WaterColor)
 
void setNormalDistortion (const Ogre::Real &NormalDistortion)
 Set normal distortion. More...
 
void setSunPosition (const Ogre::Vector3 &SunPosition)
 Set sun position. More...
 
void setSunStrength (const Ogre::Real &SunStrength)
 Set sun strength. More...
 
void setSunArea (const Ogre::Real &SunArea)
 Set sun area. More...
 
void setSunColor (const Ogre::Vector3 &SunColor)
 Set sun color. More...
 
void setFoamMaxDistance (const Ogre::Real &FoamMaxDistance)
 Set foam max distance. More...
 
void setFoamScale (const Ogre::Real &FoamScale)
 Set foam scale. More...
 
void setFoamStart (const Ogre::Real &FoamStart)
 Set foam start. More...
 
void setFoamTransparency (const Ogre::Real &FoamTransparency)
 Set foam transparency. More...
 
void setDepthLimit (const Ogre::Real &DepthLimit)
 Set depth limit. More...
 
void setDistLimit (const Ogre::Real &DistLimit)
 Set distance limit underwater (occlusion) More...
 
void setSmoothPower (const Ogre::Real &SmoothPower)
 Set smooth power. More...
 
void setCausticsScale (const Ogre::Real &CausticsScale)
 Set caustics scale. More...
 
void setCausticsPower (const Ogre::Real &CausticsPower)
 Set caustics power. More...
 
void setCausticsEnd (const Ogre::Real &CausticsEnd)
 Set caustics end. More...
 
void setGodRaysExposure (const Ogre::Vector3 &GodRaysExposure)
 Set god rays exposure. More...
 
void setGodRaysIntensity (const Ogre::Real &GodRaysIntensity)
 Set god rays intensity. More...
 
void setUnderwaterCameraSwitchDelta (const Ogre::Real &UnderwaterCameraSwitchDelta)
 Set the y-displacement under the water needed to change between underwater and overwater mode. More...
 
const bool & isCreated () const
 Has create() already called? More...
 
void setVisible (const bool &Visible)
 Show/Hide hydrax water. More...
 
const bool & isVisible () const
 Is hydrax water visible? More...
 
Ogre::Camera * getCamera ()
 Get rendering camera. More...
 
Ogre::Viewport * getViewport ()
 Get main window viewport. More...
 
Ogre::SceneManager * getSceneManager ()
 Get scene manager. More...
 
MeshgetMesh ()
 Get Hydrax::Mesh. More...
 
MaterialManagergetMaterialManager ()
 Get Hydrax::MaterialManager. More...
 
RttManagergetRttManager ()
 Get Hydrax::RttManager. More...
 
TextureManagergetTextureManager ()
 Get Hydrax::TextureManager. More...
 
GodRaysManagergetGodRaysManager ()
 Get Hydrax::GodRaysManager. More...
 
DecalsManagergetDecalsManager ()
 Get Hydrax::DecalsManager. More...
 
GPUNormalMapManagergetGPUNormalMapManager ()
 Get Hydrax::GPUNormalMapManager. More...
 
CfgFileManagergetCfgFileManager ()
 Get Hydrax::CfgFileManager. More...
 
Module::ModulegetModule ()
 Get our Hydrax::Module::Module. More...
 
const HydraxComponentgetComponents () const
 Get hydrax components selected. More...
 
const Ogre::PolygonMode & getPolygonMode () const
 Get current polygon mode. More...
 
const MaterialManager::ShaderModegetShaderMode () const
 Get current shader mode. More...
 
const Ogre::Vector3 & getPosition () const
 Get water position. More...
 
const Ogre::Real & getPlanesError () const
 Get current clip planes error. More...
 
float getHeigth (const Ogre::Vector2 &Position)
 Get the current heigth at a especified world-space point. More...
 
float getHeigth (const Ogre::Vector3 &Position)
 Get the current heigth at a especified world-space point. More...
 
const Ogre::Real & getFullReflectionDistance () const
 Get full reflection distance. More...
 
const Ogre::Real & getGlobalTransparency () const
 Get global transparency. More...
 
const Ogre::Vector3 & getSunPosition () const
 Get sun position. More...
 
const Ogre::Vector3 & getWaterColor () const
 Get water color. More...
 
const Ogre::Real & getNormalDistortion () const
 Get normal distortion. More...
 
const Ogre::Real & getSunStrength () const
 Get water strength. More...
 
const Ogre::Real & getSunArea () const
 Get sun area. More...
 
const Ogre::Vector3 & getSunColor () const
 Get sun color. More...
 
const Ogre::Real & getFoamMaxDistance () const
 Get foam max distance. More...
 
const Ogre::Real & getFoamScale () const
 Get foam scale. More...
 
const Ogre::Real & getFoamStart () const
 Get foam start. More...
 
const Ogre::Real & getFoamTransparency () const
 Get foam transparency. More...
 
const Ogre::Real & getDepthLimit () const
 Get depth limit. More...
 
const Ogre::Real & getDistLimit () const
 Get distance limit (viewable underwater) More...
 
const Ogre::Real & getSmoothPower () const
 Get smooth power. More...
 
const Ogre::Real & getCausticsScale () const
 Get caustics scale. More...
 
const Ogre::Real & getCausticsPower () const
 Get caustics power. More...
 
const Ogre::Real & getCausticsEnd () const
 Get caustics end. More...
 
const Ogre::Vector3 & getGodRaysExposure () const
 Get God rays exposure factors. More...
 
const Ogre::Real & getGodRaysIntensity () const
 Get God rays intensity. More...
 
const Ogre::Real & getUnderwaterCameraSwitchDelta () const
 Get the y-displacement under the water needed to change between underwater and overwater mode. More...
 
const bool & _isCurrentFrameUnderwater () const
 Is current frame underwater? More...
 

Private Member Functions

void _updateNM ()
 Update normal map textures. More...
 
void _checkVisible ()
 setVisible() helper funtion More...
 
void _checkUnderwater (const Ogre::Real &timeSinceLastFrame)
 Check for underwater effects. More...
 

Private Attributes

bool mCreated
 Has create() already called? More...
 
bool mVisible
 Is hydrax water visible? More...
 
HydraxComponent mComponents
 Hydrax components. More...
 
MaterialManager::ShaderMode mShaderMode
 Current shader mode. More...
 
DeviceListener mDeviceListener
 Device listener. More...
 
Ogre::PolygonMode mPolygonMode
 Polygon mode (Solid, Wireframe, Points) More...
 
Ogre::Vector3 mPosition
 Water position. More...
 
Ogre::Real mPlanesError
 Planes error, y axis clipplanes displacement. More...
 
Ogre::Real mFullReflectionDistance
 Full reflection distance param. More...
 
Ogre::Real mGlobalTransparency
 Global transparency param. More...
 
Ogre::Vector3 mWaterColor
 Water color param. More...
 
Ogre::Real mNormalDistortion
 Normal distortion param. More...
 
Ogre::Vector3 mSunPosition
 Sun position. More...
 
Ogre::Real mSunStrength
 Sun strength param. More...
 
Ogre::Real mSunArea
 Sun area. More...
 
Ogre::Vector3 mSunColor
 Sun color. More...
 
Ogre::Real mFoamMaxDistance
 Foam max distance param. More...
 
Ogre::Real mFoamScale
 Foam scale param. More...
 
Ogre::Real mFoamStart
 Foam start param. More...
 
Ogre::Real mFoamTransparency
 Foam transparency param. More...
 
Ogre::Real mDepthLimit
 Depth limit param. More...
 
Ogre::Real mDistLimit
 Distance limit param (viewable underwater) More...
 
Ogre::Real mSmoothPower
 Smooth power param. More...
 
Ogre::Real mCausticsScale
 Caustics scale param. More...
 
Ogre::Real mCausticsPower
 Caustics power. More...
 
Ogre::Real mCausticsEnd
 Caustics end. More...
 
Ogre::Vector3 mGodRaysExposure
 God rays exposure factors. More...
 
Ogre::Real mGodRaysIntensity
 God rays intensity. More...
 
Ogre::Real mUnderwaterCameraSwitchDelta
 
bool mCurrentFrameUnderwater
 Is current frame underwater? More...
 
MeshmMesh
 Our Hydrax::Mesh pointer. More...
 
MaterialManagermMaterialManager
 Our Hydrax::MaterialManager. More...
 
RttManagermRttManager
 Our Hydrax::RttManager. More...
 
TextureManagermTextureManager
 Our Hydrax::TextureManager pointer. More...
 
GodRaysManagermGodRaysManager
 Our Hydrax::GodRaysManager pointer. More...
 
DecalsManagermDecalsManager
 Our Hydrax::DecalsManager pointer. More...
 
GPUNormalMapManagermGPUNormalMapManager
 Our Hydrax::GPUNormalMapManager pointer. More...
 
CfgFileManagermCfgFileManager
 Our Hydrax::CfgFileManager pointer. More...
 
Module::ModulemModule
 Our Hydrax::Module::Module pointer. More...
 
Ogre::SceneManager * mSceneManager
 Pointer to Ogre::SceneManager. More...
 
Ogre::Camera * mCamera
 Pointer to Ogre::Camera. More...
 
Ogre::Viewport * mViewport
 Pointer to main window viewport. More...
 

Detailed Description

Main Hydrax class.

Hydrax is a plugin for the Ogre3D engine whose aim is rendering realistic water scenes. Do not use two instances of the Hydrax class.

Definition at line 56 of file Hydrax.h.

Constructor & Destructor Documentation

◆ Hydrax()

Hydrax::Hydrax::Hydrax ( Ogre::SceneManager *  sm,
Ogre::Camera *  c,
Ogre::Viewport *  v 
)

Constructor.

Parameters
smOgre SceneManager pointer
cOgre Camera pointer
vOgre Main window viewport pointer

Definition at line 37 of file Hydrax.cpp.

◆ ~Hydrax()

Hydrax::Hydrax::~Hydrax ( )

Destructor.

Definition at line 82 of file Hydrax.cpp.

Member Function Documentation

◆ _checkUnderwater()

void Hydrax::Hydrax::_checkUnderwater ( const Ogre::Real &  timeSinceLastFrame)
private

Check for underwater effects.

Parameters
timeSinceLastFrameTime since last frame

Definition at line 631 of file Hydrax.cpp.

◆ _checkVisible()

void Hydrax::Hydrax::_checkVisible ( )
private

setVisible() helper funtion

Definition at line 204 of file Hydrax.cpp.

◆ _isCurrentFrameUnderwater()

const bool& Hydrax::Hydrax::_isCurrentFrameUnderwater ( ) const
inline

Is current frame underwater?

Returns
true If yes, false if not

Definition at line 621 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ _setStrength()

void Hydrax::Hydrax::_setStrength ( const Ogre::Real &  Strength)

Set water strength GPU param.

Parameters
StrengthWater strength GPU param

Definition at line 763 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ _updateNM()

void Hydrax::Hydrax::_updateNM ( )
private

Update normal map textures.

◆ create()

void Hydrax::Hydrax::create ( )

Create all resources according with current Hydrax components and add Hydrax to the scene.

Remarks
Call when all params are set

Definition at line 103 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ getCamera()

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

Get rendering camera.

Returns
Ogre::Camera pointer

Definition at line 293 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getCausticsEnd()

const Ogre::Real& Hydrax::Hydrax::getCausticsEnd ( ) const
inline

Get caustics end.

Returns
Caustics end

Definition at line 588 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getCausticsPower()

const Ogre::Real& Hydrax::Hydrax::getCausticsPower ( ) const
inline

Get caustics power.

Returns
Caustics power

Definition at line 580 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getCausticsScale()

const Ogre::Real& Hydrax::Hydrax::getCausticsScale ( ) const
inline

Get caustics scale.

Returns
Caustics scale

Definition at line 572 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getCfgFileManager()

CfgFileManager* Hydrax::Hydrax::getCfgFileManager ( )
inline

Get Hydrax::CfgFileManager.

Returns
Hydrax::CfgFileManager pointer

Definition at line 373 of file Hydrax.h.

◆ getComponents()

const HydraxComponent& Hydrax::Hydrax::getComponents ( ) const
inline

Get hydrax components selected.

Returns
Hydrax components

Definition at line 389 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getDecalsManager()

DecalsManager* Hydrax::Hydrax::getDecalsManager ( )
inline

Get Hydrax::DecalsManager.

Returns
Hydrax::DecalsManager pointer

Definition at line 357 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getDepthLimit()

const Ogre::Real& Hydrax::Hydrax::getDepthLimit ( ) const
inline

Get depth limit.

Returns
Depth limit

Definition at line 548 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getDistLimit()

const Ogre::Real& Hydrax::Hydrax::getDistLimit ( ) const
inline

Get distance limit (viewable underwater)

Returns
Distance limit

Definition at line 556 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getFoamMaxDistance()

const Ogre::Real& Hydrax::Hydrax::getFoamMaxDistance ( ) const
inline

Get foam max distance.

Returns
Foam max distance

Definition at line 516 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getFoamScale()

const Ogre::Real& Hydrax::Hydrax::getFoamScale ( ) const
inline

Get foam scale.

Returns
Foam scale

Definition at line 524 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getFoamStart()

const Ogre::Real& Hydrax::Hydrax::getFoamStart ( ) const
inline

Get foam start.

Returns
Foam start

Definition at line 532 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getFoamTransparency()

const Ogre::Real& Hydrax::Hydrax::getFoamTransparency ( ) const
inline

Get foam transparency.

Returns
Foam scale

Definition at line 540 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getFullReflectionDistance()

const Ogre::Real& Hydrax::Hydrax::getFullReflectionDistance ( ) const
inline

Get full reflection distance.

Returns
Hydrax water full reflection distance

Definition at line 452 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getGlobalTransparency()

const Ogre::Real& Hydrax::Hydrax::getGlobalTransparency ( ) const
inline

Get global transparency.

Returns
Hydrax water global transparency

Definition at line 460 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getGodRaysExposure()

const Ogre::Vector3& Hydrax::Hydrax::getGodRaysExposure ( ) const
inline

Get God rays exposure factors.

Returns
God rays exposure factors

Definition at line 596 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getGodRaysIntensity()

const Ogre::Real& Hydrax::Hydrax::getGodRaysIntensity ( ) const
inline

Get God rays intensity.

Returns
God rays intensity

Definition at line 604 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getGodRaysManager()

GodRaysManager* Hydrax::Hydrax::getGodRaysManager ( )
inline

Get Hydrax::GodRaysManager.

Returns
Hydrax::GodRaysManager pointer

Definition at line 349 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getGPUNormalMapManager()

GPUNormalMapManager* Hydrax::Hydrax::getGPUNormalMapManager ( )
inline

Get Hydrax::GPUNormalMapManager.

Returns
Hydrax::GPUNormalMapManager pointer

Definition at line 365 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getHeigth() [1/2]

float Hydrax::Hydrax::getHeigth ( const Ogre::Vector2 &  Position)
inline

Get the current heigth at a especified world-space point.

Parameters
PositionX/Z World position
Returns
Heigth at the given position in y-World coordinates, if it's outside of the water return -1

Definition at line 430 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getHeigth() [2/2]

float Hydrax::Hydrax::getHeigth ( const Ogre::Vector3 &  Position)
inline

Get the current heigth at a especified world-space point.

Parameters
PositionX/(Y)/Z World position
Returns
Heigth at the given position in y-World coordinates, if it's outside of the water return -1

Definition at line 444 of file Hydrax.h.

◆ getMaterialManager()

MaterialManager* Hydrax::Hydrax::getMaterialManager ( )
inline

Get Hydrax::MaterialManager.

Returns
Hydrax::MaterialManager pointer

Definition at line 325 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getMesh()

Mesh* Hydrax::Hydrax::getMesh ( )
inline

Get Hydrax::Mesh.

Returns
Hydrax::Mesh pointer

Definition at line 317 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getModule()

Module::Module* Hydrax::Hydrax::getModule ( )
inline

Get our Hydrax::Module::Module.

Returns
Hydrax::Module::Module pointer or NULL if Module isn't set.

Definition at line 381 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getNormalDistortion()

const Ogre::Real& Hydrax::Hydrax::getNormalDistortion ( ) const
inline

Get normal distortion.

Returns
Hydrax normal distortion

Definition at line 484 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getPlanesError()

const Ogre::Real& Hydrax::Hydrax::getPlanesError ( ) const
inline

Get current clip planes error.

Returns
Current clip planes error

Definition at line 421 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getPolygonMode()

const Ogre::PolygonMode& Hydrax::Hydrax::getPolygonMode ( ) const
inline

Get current polygon mode.

Returns
Current polygon mode

Definition at line 397 of file Hydrax.h.

◆ getPosition()

const Ogre::Vector3& Hydrax::Hydrax::getPosition ( ) const
inline

Get water position.

Returns
Water position

Definition at line 413 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getRttManager()

RttManager* Hydrax::Hydrax::getRttManager ( )
inline

Get Hydrax::RttManager.

Returns
Hydrax::RttManager pointer

Definition at line 333 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getSceneManager()

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

Get scene manager.

Returns
Ogre::SceneManager pointer

Definition at line 309 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getShaderMode()

const MaterialManager::ShaderMode& Hydrax::Hydrax::getShaderMode ( ) const
inline

Get current shader mode.

Returns
Current shader mode

Definition at line 405 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getSmoothPower()

const Ogre::Real& Hydrax::Hydrax::getSmoothPower ( ) const
inline

Get smooth power.

Returns
Smooth power

Definition at line 564 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getSunArea()

const Ogre::Real& Hydrax::Hydrax::getSunArea ( ) const
inline

Get sun area.

Returns
Sun area

Definition at line 500 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getSunColor()

const Ogre::Vector3& Hydrax::Hydrax::getSunColor ( ) const
inline

Get sun color.

Returns
Sun color

Definition at line 508 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getSunPosition()

const Ogre::Vector3& Hydrax::Hydrax::getSunPosition ( ) const
inline

Get sun position.

Returns
Sun position

Definition at line 468 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getSunStrength()

const Ogre::Real& Hydrax::Hydrax::getSunStrength ( ) const
inline

Get water strength.

Returns
Hydrax water strength

Definition at line 492 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getTextureManager()

TextureManager* Hydrax::Hydrax::getTextureManager ( )
inline

Get Hydrax::TextureManager.

Returns
Hydrax::TextureManager pointer

Definition at line 341 of file Hydrax.h.

◆ getUnderwaterCameraSwitchDelta()

const Ogre::Real& Hydrax::Hydrax::getUnderwaterCameraSwitchDelta ( ) const
inline

Get the y-displacement under the water needed to change between underwater and overwater mode.

Returns
Underwater camera switch delta
Remarks
Useful to get a nice underwater-overwater transition, it depends of the world scale

Definition at line 613 of file Hydrax.h.

◆ getViewport()

Ogre::Viewport* Hydrax::Hydrax::getViewport ( )
inline

Get main window viewport.

Returns
Ogre::Viewport pointer

Definition at line 301 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ getWaterColor()

const Ogre::Vector3& Hydrax::Hydrax::getWaterColor ( ) const
inline

Get water color.

Returns
Water color

Definition at line 476 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ isComponent()

bool Hydrax::Hydrax::isComponent ( const HydraxComponent Component)

Returns if the especified component is active.

Parameters
ComponentComponent that we want to check

Definition at line 611 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ isCreated()

const bool& Hydrax::Hydrax::isCreated ( ) const
inline

Has create() already called?

Returns
true is yes, false if not

Definition at line 270 of file Hydrax.h.

◆ isVisible()

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

Is hydrax water visible?

Returns
true if yes, false if not

Definition at line 285 of file Hydrax.h.

◆ loadCfg()

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

Load config from file.

Parameters
FileFile name
Returns
false if an error has been ocurred(Check the log file in this case).
Remarks
The file must be registred in Hydrax resource group. If module isn't set, or module isn't the same from config file, module options won't be loaded.

Definition at line 142 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ remove()

void Hydrax::Hydrax::remove ( )

Remove hydrax, you can call this method to remove Hydrax from the scene or release (secondary) Hydrax memory, call create() to return Hydrax to the scene.

Definition at line 177 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ rotate()

void Hydrax::Hydrax::rotate ( const Ogre::Quaternion &  q)

Rotate water and planes.

Parameters
qconst Ogre::Quaternion&

Definition at line 742 of file Hydrax.cpp.

◆ saveCfg()

const bool Hydrax::Hydrax::saveCfg ( const Ogre::String &  File,
const Ogre::String &  Path = "" 
) const
inline

Save hydrax config to file.

Parameters
FileFile name
PathFile path
Returns
false if an error has been ocurred(Check the log file in this case).
Remarks
If module isn't set, module/noise options won't be saved.

Definition at line 130 of file Hydrax.h.

◆ setCausticsEnd()

void Hydrax::Hydrax::setCausticsEnd ( const Ogre::Real &  CausticsEnd)

Set caustics end.

Parameters
CausticsEndCaustics end

Definition at line 1145 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setCausticsPower()

void Hydrax::Hydrax::setCausticsPower ( const Ogre::Real &  CausticsPower)

Set caustics power.

Parameters
CausticsPowerCaustics power

Definition at line 1117 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setCausticsScale()

void Hydrax::Hydrax::setCausticsScale ( const Ogre::Real &  CausticsScale)

Set caustics scale.

Parameters
CausticsScaleCaustics scale

Definition at line 1103 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setComponents()

void Hydrax::Hydrax::setComponents ( const HydraxComponent Components)

Set Hydrax components.

Parameters
ComponentsComponents
Remarks
It can be called after create(), Components will be updated

Definition at line 301 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setDepthLimit()

void Hydrax::Hydrax::setDepthLimit ( const Ogre::Real &  DepthLimit)

Set depth limit.

Parameters
DepthLimitDepth limit

Definition at line 1051 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setDistLimit()

void Hydrax::Hydrax::setDistLimit ( const Ogre::Real &  DistLimit)

Set distance limit underwater (occlusion)

Parameters
DistLimitDistance limit

Definition at line 1070 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setFoamMaxDistance()

void Hydrax::Hydrax::setFoamMaxDistance ( const Ogre::Real &  FoamMaxDistance)

Set foam max distance.

Parameters
FoamMaxDistanceFoam max distance

Definition at line 967 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setFoamScale()

void Hydrax::Hydrax::setFoamScale ( const Ogre::Real &  FoamScale)

Set foam scale.

Parameters
FoamScaleFoam scale

Definition at line 988 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setFoamStart()

void Hydrax::Hydrax::setFoamStart ( const Ogre::Real &  FoamStart)

Set foam start.

Parameters
FoamStartFoam start

Definition at line 1009 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setFoamTransparency()

void Hydrax::Hydrax::setFoamTransparency ( const Ogre::Real &  FoamTransparency)

Set foam transparency.

Parameters
FoamTransparencyFoam transparency

Definition at line 1030 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setFullReflectionDistance()

void Hydrax::Hydrax::setFullReflectionDistance ( const Ogre::Real &  FullReflectionDistance)

Set full reflection distance.

Parameters
FullReflectionDistanceFull reflection distance

Definition at line 782 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setGlobalTransparency()

void Hydrax::Hydrax::setGlobalTransparency ( const Ogre::Real &  GlobalTransparencyDistance)

Definition at line 798 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setGodRaysExposure()

void Hydrax::Hydrax::setGodRaysExposure ( const Ogre::Vector3 &  GodRaysExposure)
inline

Set god rays exposure.

Parameters
GodRaysExposureGod rays exposure

Definition at line 245 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ setGodRaysIntensity()

void Hydrax::Hydrax::setGodRaysIntensity ( const Ogre::Real &  GodRaysIntensity)
inline

Set god rays intensity.

Parameters
GodRaysIntensityGod rays intensity

Definition at line 253 of file Hydrax.h.

+ Here is the caller graph for this function:

◆ setModule()

void Hydrax::Hydrax::setModule ( Module::Module Module,
const bool &  DeleteOldModule = true 
)

Set Hydrax module.

Parameters
ModuleHydrax module
DeleteOldModuleDelete, if exists, the old module
Remarks
Module will be set before call create()

Definition at line 526 of file Hydrax.cpp.

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

◆ setNormalDistortion()

void Hydrax::Hydrax::setNormalDistortion ( const Ogre::Real &  NormalDistortion)

Set normal distortion.

Parameters
NormalDistortionuse low value, like 0.025

Definition at line 867 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setPlanesError()

void Hydrax::Hydrax::setPlanesError ( const Ogre::Real &  PlanesError)

Set clip planes error.

Parameters
PlanesErrorClip planes error

Definition at line 758 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setPolygonMode()

void Hydrax::Hydrax::setPolygonMode ( const Ogre::PolygonMode &  PM)

Set polygon mode (Solid, Wireframe, Points)

Parameters
PMPolygon mode

Definition at line 262 of file Hydrax.cpp.

◆ setPosition()

void Hydrax::Hydrax::setPosition ( const Ogre::Vector3 &  Position)

Set water position.

Parameters
PositionWater position

Definition at line 719 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setShaderMode()

void Hydrax::Hydrax::setShaderMode ( const MaterialManager::ShaderMode ShaderMode)

Set shader mode.

Parameters
ShaderModeShader mode

Definition at line 279 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setSmoothPower()

void Hydrax::Hydrax::setSmoothPower ( const Ogre::Real &  SmoothPower)

Set smooth power.

Parameters
SmoothPowerSmooth power
Remarks
Less values more transition distance, hight values short transition values, 1-50 range(aprox.)

Definition at line 1089 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setSunArea()

void Hydrax::Hydrax::setSunArea ( const Ogre::Real &  SunArea)

Set sun area.

Parameters
SunAreaSun area

Definition at line 925 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setSunColor()

void Hydrax::Hydrax::setSunColor ( const Ogre::Vector3 &  SunColor)

Set sun color.

Parameters
SunColorSun color

Definition at line 946 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setSunPosition()

void Hydrax::Hydrax::setSunPosition ( const Ogre::Vector3 &  SunPosition)

Set sun position.

Parameters
SunPositionSun position

Definition at line 883 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setSunStrength()

void Hydrax::Hydrax::setSunStrength ( const Ogre::Real &  SunStrength)

Set sun strength.

Parameters
SunStrengthSun strength

Definition at line 904 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setUnderwaterCameraSwitchDelta()

void Hydrax::Hydrax::setUnderwaterCameraSwitchDelta ( const Ogre::Real &  UnderwaterCameraSwitchDelta)
inline

Set the y-displacement under the water needed to change between underwater and overwater mode.

Parameters
UnderwaterCameraSwitchDeltaUnderwater camera switch delta factor
Remarks
Useful to get a nice underwater-overwater transition, it depends of the world scale

Definition at line 262 of file Hydrax.h.

◆ setVisible()

void Hydrax::Hydrax::setVisible ( const bool &  Visible)

Show/Hide hydrax water.

Parameters
Visibletrue to show, false to hide
Remarks
Resources aren't going to be realeased(Use remove() for this), only RTT's are going to be stopped.

Definition at line 197 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ setWaterColor()

void Hydrax::Hydrax::setWaterColor ( const Ogre::Vector3 &  WaterColor)

Definition at line 814 of file Hydrax.cpp.

+ Here is the caller graph for this function:

◆ update()

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

Call every frame.

Definition at line 291 of file Hydrax.cpp.

+ Here is the caller graph for this function:

Field Documentation

◆ mCamera

Ogre::Camera* Hydrax::Hydrax::mCamera
private

Pointer to Ogre::Camera.

Definition at line 752 of file Hydrax.h.

◆ mCausticsEnd

Ogre::Real Hydrax::Hydrax::mCausticsEnd
private

Caustics end.

Definition at line 717 of file Hydrax.h.

◆ mCausticsPower

Ogre::Real Hydrax::Hydrax::mCausticsPower
private

Caustics power.

Definition at line 715 of file Hydrax.h.

◆ mCausticsScale

Ogre::Real Hydrax::Hydrax::mCausticsScale
private

Caustics scale param.

Definition at line 713 of file Hydrax.h.

◆ mCfgFileManager

CfgFileManager* Hydrax::Hydrax::mCfgFileManager
private

Our Hydrax::CfgFileManager pointer.

Definition at line 745 of file Hydrax.h.

◆ mComponents

HydraxComponent Hydrax::Hydrax::mComponents
private

Hydrax components.

Definition at line 663 of file Hydrax.h.

◆ mCreated

bool Hydrax::Hydrax::mCreated
private

Has create() already called?

Definition at line 657 of file Hydrax.h.

◆ mCurrentFrameUnderwater

bool Hydrax::Hydrax::mCurrentFrameUnderwater
private

Is current frame underwater?

Definition at line 728 of file Hydrax.h.

◆ mDecalsManager

DecalsManager* Hydrax::Hydrax::mDecalsManager
private

Our Hydrax::DecalsManager pointer.

Definition at line 741 of file Hydrax.h.

◆ mDepthLimit

Ogre::Real Hydrax::Hydrax::mDepthLimit
private

Depth limit param.

Definition at line 705 of file Hydrax.h.

◆ mDeviceListener

DeviceListener Hydrax::Hydrax::mDeviceListener
private

Device listener.

Definition at line 668 of file Hydrax.h.

◆ mDistLimit

Ogre::Real Hydrax::Hydrax::mDistLimit
private

Distance limit param (viewable underwater)

Definition at line 707 of file Hydrax.h.

◆ mFoamMaxDistance

Ogre::Real Hydrax::Hydrax::mFoamMaxDistance
private

Foam max distance param.

Definition at line 696 of file Hydrax.h.

◆ mFoamScale

Ogre::Real Hydrax::Hydrax::mFoamScale
private

Foam scale param.

Definition at line 698 of file Hydrax.h.

◆ mFoamStart

Ogre::Real Hydrax::Hydrax::mFoamStart
private

Foam start param.

Definition at line 700 of file Hydrax.h.

◆ mFoamTransparency

Ogre::Real Hydrax::Hydrax::mFoamTransparency
private

Foam transparency param.

Definition at line 702 of file Hydrax.h.

◆ mFullReflectionDistance

Ogre::Real Hydrax::Hydrax::mFullReflectionDistance
private

Full reflection distance param.

Definition at line 678 of file Hydrax.h.

◆ mGlobalTransparency

Ogre::Real Hydrax::Hydrax::mGlobalTransparency
private

Global transparency param.

Definition at line 680 of file Hydrax.h.

◆ mGodRaysExposure

Ogre::Vector3 Hydrax::Hydrax::mGodRaysExposure
private

God rays exposure factors.

Definition at line 720 of file Hydrax.h.

◆ mGodRaysIntensity

Ogre::Real Hydrax::Hydrax::mGodRaysIntensity
private

God rays intensity.

Definition at line 722 of file Hydrax.h.

◆ mGodRaysManager

GodRaysManager* Hydrax::Hydrax::mGodRaysManager
private

Our Hydrax::GodRaysManager pointer.

Definition at line 739 of file Hydrax.h.

◆ mGPUNormalMapManager

GPUNormalMapManager* Hydrax::Hydrax::mGPUNormalMapManager
private

Our Hydrax::GPUNormalMapManager pointer.

Definition at line 743 of file Hydrax.h.

◆ mMaterialManager

MaterialManager* Hydrax::Hydrax::mMaterialManager
private

Our Hydrax::MaterialManager.

Definition at line 733 of file Hydrax.h.

◆ mMesh

Mesh* Hydrax::Hydrax::mMesh
private

Our Hydrax::Mesh pointer.

Definition at line 731 of file Hydrax.h.

◆ mModule

Module::Module* Hydrax::Hydrax::mModule
private

Our Hydrax::Module::Module pointer.

Definition at line 747 of file Hydrax.h.

◆ mNormalDistortion

Ogre::Real Hydrax::Hydrax::mNormalDistortion
private

Normal distortion param.

Definition at line 684 of file Hydrax.h.

◆ mPlanesError

Ogre::Real Hydrax::Hydrax::mPlanesError
private

Planes error, y axis clipplanes displacement.

Definition at line 675 of file Hydrax.h.

◆ mPolygonMode

Ogre::PolygonMode Hydrax::Hydrax::mPolygonMode
private

Polygon mode (Solid, Wireframe, Points)

Definition at line 671 of file Hydrax.h.

◆ mPosition

Ogre::Vector3 Hydrax::Hydrax::mPosition
private

Water position.

Definition at line 673 of file Hydrax.h.

◆ mRttManager

RttManager* Hydrax::Hydrax::mRttManager
private

Our Hydrax::RttManager.

Definition at line 735 of file Hydrax.h.

◆ mSceneManager

Ogre::SceneManager* Hydrax::Hydrax::mSceneManager
private

Pointer to Ogre::SceneManager.

Definition at line 750 of file Hydrax.h.

◆ mShaderMode

MaterialManager::ShaderMode Hydrax::Hydrax::mShaderMode
private

Current shader mode.

Definition at line 665 of file Hydrax.h.

◆ mSmoothPower

Ogre::Real Hydrax::Hydrax::mSmoothPower
private

Smooth power param.

Definition at line 710 of file Hydrax.h.

◆ mSunArea

Ogre::Real Hydrax::Hydrax::mSunArea
private

Sun area.

Definition at line 691 of file Hydrax.h.

◆ mSunColor

Ogre::Vector3 Hydrax::Hydrax::mSunColor
private

Sun color.

Definition at line 693 of file Hydrax.h.

◆ mSunPosition

Ogre::Vector3 Hydrax::Hydrax::mSunPosition
private

Sun position.

Definition at line 687 of file Hydrax.h.

◆ mSunStrength

Ogre::Real Hydrax::Hydrax::mSunStrength
private

Sun strength param.

Definition at line 689 of file Hydrax.h.

◆ mTextureManager

TextureManager* Hydrax::Hydrax::mTextureManager
private

Our Hydrax::TextureManager pointer.

Definition at line 737 of file Hydrax.h.

◆ mUnderwaterCameraSwitchDelta

Ogre::Real Hydrax::Hydrax::mUnderwaterCameraSwitchDelta
private

Definition at line 725 of file Hydrax.h.

◆ mViewport

Ogre::Viewport* Hydrax::Hydrax::mViewport
private

Pointer to main window viewport.

Definition at line 754 of file Hydrax.h.

◆ mVisible

bool Hydrax::Hydrax::mVisible
private

Is hydrax water visible?

Definition at line 660 of file Hydrax.h.

◆ mWaterColor

Ogre::Vector3 Hydrax::Hydrax::mWaterColor
private

Water color param.

Definition at line 682 of file Hydrax.h.


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