RigsofRods
Soft-body Physics Simulation
|
#include <Hydrax.h>
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... | |
Mesh * | getMesh () |
Get Hydrax::Mesh. More... | |
MaterialManager * | getMaterialManager () |
Get Hydrax::MaterialManager. More... | |
RttManager * | getRttManager () |
Get Hydrax::RttManager. More... | |
TextureManager * | getTextureManager () |
Get Hydrax::TextureManager. More... | |
GodRaysManager * | getGodRaysManager () |
Get Hydrax::GodRaysManager. More... | |
DecalsManager * | getDecalsManager () |
Get Hydrax::DecalsManager. More... | |
GPUNormalMapManager * | getGPUNormalMapManager () |
Get Hydrax::GPUNormalMapManager. More... | |
CfgFileManager * | getCfgFileManager () |
Get Hydrax::CfgFileManager. More... | |
Module::Module * | getModule () |
Get our Hydrax::Module::Module. More... | |
const HydraxComponent & | getComponents () const |
Get hydrax components selected. More... | |
const Ogre::PolygonMode & | getPolygonMode () const |
Get current polygon mode. More... | |
const MaterialManager::ShaderMode & | getShaderMode () 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... | |
Mesh * | mMesh |
Our Hydrax::Mesh pointer. More... | |
MaterialManager * | mMaterialManager |
Our Hydrax::MaterialManager. More... | |
RttManager * | mRttManager |
Our Hydrax::RttManager. More... | |
TextureManager * | mTextureManager |
Our Hydrax::TextureManager pointer. More... | |
GodRaysManager * | mGodRaysManager |
Our Hydrax::GodRaysManager pointer. More... | |
DecalsManager * | mDecalsManager |
Our Hydrax::DecalsManager pointer. More... | |
GPUNormalMapManager * | mGPUNormalMapManager |
Our Hydrax::GPUNormalMapManager pointer. More... | |
CfgFileManager * | mCfgFileManager |
Our Hydrax::CfgFileManager pointer. More... | |
Module::Module * | mModule |
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... | |
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.
Hydrax::Hydrax::Hydrax | ( | Ogre::SceneManager * | sm, |
Ogre::Camera * | c, | ||
Ogre::Viewport * | v | ||
) |
Constructor.
Definition at line 37 of file Hydrax.cpp.
Hydrax::Hydrax::~Hydrax | ( | ) |
Destructor.
Definition at line 82 of file Hydrax.cpp.
|
private |
Check for underwater effects.
timeSinceLastFrame | Time since last frame |
Definition at line 631 of file Hydrax.cpp.
|
private |
setVisible() helper funtion
Definition at line 204 of file Hydrax.cpp.
|
inline |
void Hydrax::Hydrax::_setStrength | ( | const Ogre::Real & | Strength | ) |
Set water strength GPU param.
Strength | Water strength GPU param |
Definition at line 763 of file Hydrax.cpp.
|
private |
Update normal map textures.
void Hydrax::Hydrax::create | ( | ) |
Create all resources according with current Hydrax components and add Hydrax to the scene.
Definition at line 103 of file Hydrax.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 357 of file Hydrax.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 349 of file Hydrax.h.
|
inline |
Get Hydrax::GPUNormalMapManager.
Definition at line 365 of file Hydrax.h.
|
inline |
|
inline |
|
inline |
Definition at line 325 of file Hydrax.h.
|
inline |
Get Hydrax::Mesh.
Definition at line 317 of file Hydrax.h.
|
inline |
Get our Hydrax::Module::Module.
Definition at line 381 of file Hydrax.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get Hydrax::RttManager.
Definition at line 333 of file Hydrax.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool Hydrax::Hydrax::isComponent | ( | const HydraxComponent & | Component | ) |
Returns if the especified component is active.
Component | Component that we want to check |
Definition at line 611 of file Hydrax.cpp.
|
inline |
|
inline |
|
inline |
Load config from file.
File | File name |
Definition at line 142 of file Hydrax.h.
void Hydrax::Hydrax::remove | ( | ) |
void Hydrax::Hydrax::rotate | ( | const Ogre::Quaternion & | q | ) |
Rotate water and planes.
q | const Ogre::Quaternion& |
Definition at line 742 of file Hydrax.cpp.
|
inline |
void Hydrax::Hydrax::setCausticsEnd | ( | const Ogre::Real & | CausticsEnd | ) |
Set caustics end.
CausticsEnd | Caustics end |
Definition at line 1145 of file Hydrax.cpp.
void Hydrax::Hydrax::setCausticsPower | ( | const Ogre::Real & | CausticsPower | ) |
Set caustics power.
CausticsPower | Caustics power |
Definition at line 1117 of file Hydrax.cpp.
void Hydrax::Hydrax::setCausticsScale | ( | const Ogre::Real & | CausticsScale | ) |
Set caustics scale.
CausticsScale | Caustics scale |
Definition at line 1103 of file Hydrax.cpp.
void Hydrax::Hydrax::setComponents | ( | const HydraxComponent & | Components | ) |
Set Hydrax components.
Components | Components |
Definition at line 301 of file Hydrax.cpp.
void Hydrax::Hydrax::setDepthLimit | ( | const Ogre::Real & | DepthLimit | ) |
Set depth limit.
DepthLimit | Depth limit |
Definition at line 1051 of file Hydrax.cpp.
void Hydrax::Hydrax::setDistLimit | ( | const Ogre::Real & | DistLimit | ) |
Set distance limit underwater (occlusion)
DistLimit | Distance limit |
Definition at line 1070 of file Hydrax.cpp.
void Hydrax::Hydrax::setFoamMaxDistance | ( | const Ogre::Real & | FoamMaxDistance | ) |
Set foam max distance.
FoamMaxDistance | Foam max distance |
Definition at line 967 of file Hydrax.cpp.
void Hydrax::Hydrax::setFoamScale | ( | const Ogre::Real & | FoamScale | ) |
Set foam scale.
FoamScale | Foam scale |
Definition at line 988 of file Hydrax.cpp.
void Hydrax::Hydrax::setFoamStart | ( | const Ogre::Real & | FoamStart | ) |
Set foam start.
FoamStart | Foam start |
Definition at line 1009 of file Hydrax.cpp.
void Hydrax::Hydrax::setFoamTransparency | ( | const Ogre::Real & | FoamTransparency | ) |
Set foam transparency.
FoamTransparency | Foam transparency |
Definition at line 1030 of file Hydrax.cpp.
void Hydrax::Hydrax::setFullReflectionDistance | ( | const Ogre::Real & | FullReflectionDistance | ) |
Set full reflection distance.
FullReflectionDistance | Full reflection distance |
Definition at line 782 of file Hydrax.cpp.
void Hydrax::Hydrax::setGlobalTransparency | ( | const Ogre::Real & | GlobalTransparencyDistance | ) |
|
inline |
|
inline |
void Hydrax::Hydrax::setModule | ( | Module::Module * | Module, |
const bool & | DeleteOldModule = true |
||
) |
void Hydrax::Hydrax::setNormalDistortion | ( | const Ogre::Real & | NormalDistortion | ) |
Set normal distortion.
NormalDistortion | use low value, like 0.025 |
Definition at line 867 of file Hydrax.cpp.
void Hydrax::Hydrax::setPlanesError | ( | const Ogre::Real & | PlanesError | ) |
Set clip planes error.
PlanesError | Clip planes error |
Definition at line 758 of file Hydrax.cpp.
void Hydrax::Hydrax::setPolygonMode | ( | const Ogre::PolygonMode & | PM | ) |
Set polygon mode (Solid, Wireframe, Points)
PM | Polygon mode |
Definition at line 262 of file Hydrax.cpp.
void Hydrax::Hydrax::setPosition | ( | const Ogre::Vector3 & | Position | ) |
Set water position.
Position | Water position |
Definition at line 719 of file Hydrax.cpp.
void Hydrax::Hydrax::setShaderMode | ( | const MaterialManager::ShaderMode & | ShaderMode | ) |
Set shader mode.
ShaderMode | Shader mode |
Definition at line 279 of file Hydrax.cpp.
void Hydrax::Hydrax::setSmoothPower | ( | const Ogre::Real & | SmoothPower | ) |
Set smooth power.
SmoothPower | Smooth power |
Definition at line 1089 of file Hydrax.cpp.
void Hydrax::Hydrax::setSunArea | ( | const Ogre::Real & | SunArea | ) |
Set sun area.
SunArea | Sun area |
Definition at line 925 of file Hydrax.cpp.
void Hydrax::Hydrax::setSunColor | ( | const Ogre::Vector3 & | SunColor | ) |
Set sun color.
SunColor | Sun color |
Definition at line 946 of file Hydrax.cpp.
void Hydrax::Hydrax::setSunPosition | ( | const Ogre::Vector3 & | SunPosition | ) |
Set sun position.
SunPosition | Sun position |
Definition at line 883 of file Hydrax.cpp.
void Hydrax::Hydrax::setSunStrength | ( | const Ogre::Real & | SunStrength | ) |
Set sun strength.
SunStrength | Sun strength |
Definition at line 904 of file Hydrax.cpp.
|
inline |
Set the y-displacement under the water needed to change between underwater and overwater mode.
UnderwaterCameraSwitchDelta | Underwater camera switch delta factor |
void Hydrax::Hydrax::setVisible | ( | const bool & | Visible | ) |
Show/Hide hydrax water.
Visible | true to show, false to hide |
Definition at line 197 of file Hydrax.cpp.
void Hydrax::Hydrax::setWaterColor | ( | const Ogre::Vector3 & | WaterColor | ) |
void Hydrax::Hydrax::update | ( | const Ogre::Real & | timeSinceLastFrame | ) |
Call every frame.
Definition at line 291 of file Hydrax.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
Our Hydrax::CfgFileManager pointer.
|
private |
|
private |
|
private |
|
private |
Our Hydrax::DecalsManager pointer.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Our Hydrax::GodRaysManager pointer.
|
private |
Our Hydrax::GPUNormalMapManager pointer.
|
private |
|
private |
Our Hydrax::Mesh pointer.
|
private |
Our Hydrax::Module::Module pointer.
|
private |
|
private |
|
private |
|
private |
|
private |
Our Hydrax::RttManager.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Our Hydrax::TextureManager pointer.
|
private |
|
private |
|
private |
|
private |