31#ifndef _Hydrax_Modules_ProjectedGrid_H_
32#define _Hydrax_Modules_ProjectedGrid_H_
46namespace Hydrax{
namespace Module
106 const float &_Strength,
107 const float &_Elevation,
129 const float &_Strength,
130 const float &_Elevation,
132 const bool &_ForceRecalculateGeometry,
133 const bool &_ChoppyWaves,
134 const float &_ChoppyStrength)
178 void update(
const Ogre::Real &timeSinceLastFrame);
188 void saveCfg(Ogre::String &Data);
193 bool loadCfg(Ogre::ConfigFile &CfgFile);
199 float getHeigth(
const Ogre::Vector2 &Position);
224 bool _renderGeometry(
const Ogre::Matrix4& m,
const Ogre::Matrix4& _viewMat,
const Ogre::Vector3& WorldPos);
232 Ogre::Vector4
_calculeWorldPosition(
const Ogre::Vector2 &uv,
const Ogre::Matrix4& m,
const Ogre::Matrix4& _viewMat);
NormalMode
Normal generation mode.
Base module class, Override it for create different ways of create water noise.
Hydrax projected grid module.
Ogre::Quaternion mLastOrientation
void setOptions(const Options &Options)
Set options.
void * mVertices
Vertex pointer (Mesh::POS_NORM_VERTEX or Mesh::POS_VERTEX)
Ogre::Matrix4 mRange
Range matrix.
Ogre::Vector4 t_corners0
For corners.
Hydrax * mHydrax
Our Hydrax pointer.
void _performChoppyWaves()
Perform choppy waves.
Ogre::Plane mLowerBoundPlane
void saveCfg(Ogre::String &Data)
Save config.
Ogre::Plane mUpperBoundPlane
Options mOptions
Our projected grid options.
const Options & getOptions() const
Get current options.
void _calculeNormals()
Calcule current normals.
~ProjectedGrid()
Destructor.
void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
Ogre::Vector3 mLastPosition
Last camera position, orientation.
bool _getMinMax(Ogre::Matrix4 *range)
Get min/max.
void _setDisplacementAmplitude(const float &Amplitude)
Set displacement amplitude.
float getHeigth(const Ogre::Vector2 &Position)
Get the current heigth at a especified world-space point.
Mesh::POS_NORM_VERTEX * mVerticesChoppyBuffer
Use it to store vertex positions when choppy displacement is enabled.
Ogre::Camera * mRenderingCamera
Ogre::Camera * mProjectingCamera
Cameras.
Ogre::Vector3 mNormal
Normal and position.
Ogre::Plane mBasePlane
Planes.
Ogre::Vector4 _calculeWorldPosition(const Ogre::Vector2 &uv, const Ogre::Matrix4 &m, const Ogre::Matrix4 &_viewMat)
Calcule world position.
bool _renderGeometry(const Ogre::Matrix4 &m, const Ogre::Matrix4 &_viewMat, const Ogre::Vector3 &WorldPos)
Render geometry.
bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Ogre::Camera * mTmpRndrngCamera
Base noise class, Override it for create different ways of create water noise.
Vertex struct for position and normals data.
Struct wich contains Hydrax projected grid module options.
bool ChoppyWaves
Choppy waves.
float ChoppyStrength
Choppy waves strength.
Options()
Default constructor.
int Complexity
Projected grid complexity (N*N)
Options(const int &_Complexity, const float &_Strength, const float &_Elevation, const bool &_Smooth, const bool &_ForceRecalculateGeometry, const bool &_ChoppyWaves, const float &_ChoppyStrength)
Constructor.
float Elevation
Elevation.
bool ForceRecalculateGeometry
Force recalculate mesh geometry each frame.
Options(const int &_Complexity)
Constructor.
Options(const int &_Complexity, const float &_Strength, const float &_Elevation, const bool &_Smooth)
Constructor.