25#ifndef _Hydrax_Hydrax_H_
26#define _Hydrax_Hydrax_H_
64 Hydrax(Ogre::SceneManager *sm, Ogre::Camera *c, Ogre::Viewport *v);
84 void update(
const Ogre::Real &timeSinceLastFrame);
102 void setModule(
Module::Module* Module,
const bool& DeleteOldModule =
true);
107 void setPolygonMode(
const Ogre::PolygonMode& PM);
117 void setPosition(
const Ogre::Vector3 &Position);
122 void rotate(
const Ogre::Quaternion &q);
130 inline const bool saveCfg(
const Ogre::String &File,
const Ogre::String& Path =
"")
const
132 return mCfgFileManager->save(File, Path);
130 inline const bool saveCfg(
const Ogre::String &File,
const Ogre::String& Path =
"")
const {
…}
142 inline const bool loadCfg(
const Ogre::String &File)
const
144 return mCfgFileManager->load(File);
142 inline const bool loadCfg(
const Ogre::String &File)
const {
…}
150 void setPlanesError(
const Ogre::Real &PlanesError);
155 void _setStrength(
const Ogre::Real &Strength);
160 void setFullReflectionDistance(
const Ogre::Real &FullReflectionDistance);
162 void setGlobalTransparency(
const Ogre::Real &GlobalTransparencyDistance);
164 void setWaterColor(
const Ogre::Vector3 &WaterColor);
169 void setNormalDistortion(
const Ogre::Real &NormalDistortion);
174 void setSunPosition(
const Ogre::Vector3 &SunPosition);
179 void setSunStrength(
const Ogre::Real &SunStrength);
184 void setSunArea(
const Ogre::Real &SunArea);
189 void setSunColor(
const Ogre::Vector3 &SunColor);
194 void setFoamMaxDistance(
const Ogre::Real &FoamMaxDistance);
199 void setFoamScale(
const Ogre::Real &FoamScale);
204 void setFoamStart(
const Ogre::Real &FoamStart);
209 void setFoamTransparency(
const Ogre::Real &FoamTransparency);
214 void setDepthLimit(
const Ogre::Real &DepthLimit);
219 void setDistLimit(
const Ogre::Real &DistLimit);
225 void setSmoothPower(
const Ogre::Real &SmoothPower);
230 void setCausticsScale(
const Ogre::Real &CausticsScale);
235 void setCausticsPower(
const Ogre::Real &CausticsPower);
240 void setCausticsEnd(
const Ogre::Real &CausticsEnd);
247 mGodRaysExposure = GodRaysExposure;
255 mGodRaysIntensity = GodRaysIntensity;
264 mUnderwaterCameraSwitchDelta = UnderwaterCameraSwitchDelta;
280 void setVisible(
const bool& Visible);
311 return mSceneManager;
327 return mMaterialManager;
343 return mTextureManager;
351 return mGodRaysManager;
359 return mDecalsManager;
367 return mGPUNormalMapManager;
375 return mCfgFileManager;
434 return mModule->getHeigth(Position);
446 return getHeigth(Ogre::Vector2(Position.x, Position.z));
454 return mFullReflectionDistance;
462 return mGlobalTransparency;
486 return mNormalDistortion;
518 return mFoamMaxDistance;
542 return mFoamTransparency;
574 return mCausticsScale;
582 return mCausticsPower;
598 return mGodRaysExposure;
606 return mGodRaysIntensity;
615 return mUnderwaterCameraSwitchDelta;
623 return mCurrentFrameUnderwater;
640 void eventOccurred(
const Ogre::String& eventName,
const Ogre::NameValuePairList *parameters);
649 void _checkVisible();
654 void _checkUnderwater(
const Ogre::Real& timeSinceLastFrame);
Central state/object manager and communications hub.
Class to load/save all Hydrax options from/to a config file.
Class to manager GPU normal maps.
Underwater god rays manager class God rays.
Hydrax * mHydrax
Hydrax manager pointer.
void _updateNM()
Update normal map textures.
const Ogre::Real & getGlobalTransparency() const
Get global transparency.
Ogre::Real mFoamStart
Foam start param.
RttManager * getRttManager()
Get Hydrax::RttManager.
Mesh * getMesh()
Get Hydrax::Mesh.
Ogre::Vector3 mPosition
Water position.
const Ogre::Real & getSunArea() const
Get sun area.
const bool loadCfg(const Ogre::String &File) const
Load config from file.
const Ogre::Real & getFoamStart() const
Get foam start.
Module::Module * mModule
Our Hydrax::Module::Module pointer.
Ogre::Real mNormalDistortion
Normal distortion param.
GodRaysManager * getGodRaysManager()
Get Hydrax::GodRaysManager.
Ogre::Vector3 mSunPosition
Sun position.
bool mCurrentFrameUnderwater
Is current frame underwater?
float getHeigth(const Ogre::Vector3 &Position)
Get the current heigth at a especified world-space point.
const Ogre::Real & getSmoothPower() const
Get smooth power.
void setUnderwaterCameraSwitchDelta(const Ogre::Real &UnderwaterCameraSwitchDelta)
Set the y-displacement under the water needed to change between underwater and overwater mode.
GPUNormalMapManager * mGPUNormalMapManager
Our Hydrax::GPUNormalMapManager pointer.
bool mCreated
Has create() already called?
const Ogre::PolygonMode & getPolygonMode() const
Get current polygon mode.
Ogre::Real mGodRaysIntensity
God rays intensity.
void setGodRaysExposure(const Ogre::Vector3 &GodRaysExposure)
Set god rays exposure.
Ogre::Real mFoamScale
Foam scale param.
const HydraxComponent & getComponents() const
Get hydrax components selected.
Mesh * mMesh
Our Hydrax::Mesh pointer.
const Ogre::Real & getNormalDistortion() const
Get normal distortion.
DeviceListener mDeviceListener
Device listener.
Ogre::Real mFullReflectionDistance
Full reflection distance param.
const Ogre::Vector3 & getSunPosition() const
Get sun position.
Ogre::Camera * getCamera()
Get rendering camera.
Ogre::Real mFoamMaxDistance
Foam max distance param.
Ogre::Camera * mCamera
Pointer to Ogre::Camera.
const Ogre::Real & getFullReflectionDistance() const
Get full reflection distance.
const Ogre::Real & getCausticsPower() const
Get caustics power.
const bool saveCfg(const Ogre::String &File, const Ogre::String &Path="") const
Save hydrax config to file.
bool mVisible
Is hydrax water visible?
Ogre::Real mUnderwaterCameraSwitchDelta
const Ogre::Real & getSunStrength() const
Get water strength.
const Ogre::Vector3 & getPosition() const
Get water position.
Ogre::Real mCausticsScale
Caustics scale param.
const bool & isCreated() const
Has create() already called?
const bool & isVisible() const
Is hydrax water visible?
HydraxComponent mComponents
Hydrax components.
const Ogre::Real & getDistLimit() const
Get distance limit (viewable underwater)
MaterialManager::ShaderMode mShaderMode
Current shader mode.
const Ogre::Real & getFoamScale() const
Get foam scale.
Ogre::Real mPlanesError
Planes error, y axis clipplanes displacement.
const Ogre::Vector3 & getWaterColor() const
Get water color.
const Ogre::Real & getFoamTransparency() const
Get foam transparency.
const MaterialManager::ShaderMode & getShaderMode() const
Get current shader mode.
Ogre::Vector3 mSunColor
Sun color.
const Ogre::Real & getPlanesError() const
Get current clip planes error.
Ogre::Real mGlobalTransparency
Global transparency param.
const Ogre::Vector3 & getGodRaysExposure() const
Get God rays exposure factors.
Ogre::Real mDepthLimit
Depth limit param.
Ogre::SceneManager * mSceneManager
Pointer to Ogre::SceneManager.
CfgFileManager * getCfgFileManager()
Get Hydrax::CfgFileManager.
const Ogre::Vector3 & getSunColor() const
Get sun color.
Ogre::PolygonMode mPolygonMode
Polygon mode (Solid, Wireframe, Points)
GodRaysManager * mGodRaysManager
Our Hydrax::GodRaysManager pointer.
const Ogre::Real & getCausticsScale() const
Get caustics scale.
Ogre::Real mSunStrength
Sun strength param.
float getHeigth(const Ogre::Vector2 &Position)
Get the current heigth at a especified world-space point.
MaterialManager * mMaterialManager
Our Hydrax::MaterialManager.
Ogre::Vector3 mWaterColor
Water color param.
const Ogre::Real & getGodRaysIntensity() const
Get God rays intensity.
const Ogre::Real & getFoamMaxDistance() const
Get foam max distance.
const Ogre::Real & getDepthLimit() const
Get depth limit.
Ogre::Real mDistLimit
Distance limit param (viewable underwater)
MaterialManager * getMaterialManager()
Get Hydrax::MaterialManager.
const Ogre::Real & getCausticsEnd() const
Get caustics end.
Ogre::Viewport * mViewport
Pointer to main window viewport.
TextureManager * getTextureManager()
Get Hydrax::TextureManager.
Ogre::Viewport * getViewport()
Get main window viewport.
Ogre::Real mCausticsPower
Caustics power.
GPUNormalMapManager * getGPUNormalMapManager()
Get Hydrax::GPUNormalMapManager.
Module::Module * getModule()
Get our Hydrax::Module::Module.
TextureManager * mTextureManager
Our Hydrax::TextureManager pointer.
Ogre::Real mFoamTransparency
Foam transparency param.
Ogre::Real mCausticsEnd
Caustics end.
Ogre::SceneManager * getSceneManager()
Get scene manager.
const Ogre::Real & getUnderwaterCameraSwitchDelta() const
Get the y-displacement under the water needed to change between underwater and overwater mode.
Ogre::Real mSunArea
Sun area.
RttManager * mRttManager
Our Hydrax::RttManager.
DecalsManager * mDecalsManager
Our Hydrax::DecalsManager pointer.
Ogre::Vector3 mGodRaysExposure
God rays exposure factors.
DecalsManager * getDecalsManager()
Get Hydrax::DecalsManager.
void setGodRaysIntensity(const Ogre::Real &GodRaysIntensity)
Set god rays intensity.
Ogre::Real mSmoothPower
Smooth power param.
CfgFileManager * mCfgFileManager
Our Hydrax::CfgFileManager pointer.
const bool & _isCurrentFrameUnderwater() const
Is current frame underwater?
Material/Shader manager class.
Class wich contains all funtions/variables related to Hydrax water mesh.
Base module class, Override it for create different ways of create water noise.
Class for manager Normal maps.
HydraxComponent
Hydrax flags to select components wich we want to use.