27namespace Hydrax{
namespace Module
55 , mVerticesChoppyBuffer(0)
64 , mVerticesChoppyBuffer(0)
304 Ogre::Vector3 p = Ogre::Vector3(0,0,0);
305 Ogre::Affine3 mWorldMatrix;
379 Ogre::Vector3 vec1, vec2, normal;
387 vec1 = Ogre::Vector3(
392 vec2 = Ogre::Vector3(
397 normal = vec2.crossProduct(vec1);
static Ogre::String _getCfgString(const Ogre::String &Name, const int &Value)
static Size _getSizeValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get size value.
static Ogre::Real _getFloatValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get float value.
static bool _getBoolValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get bool value.
static int _getIntValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get int value.
Mesh * getMesh()
Get Hydrax::Mesh.
const Ogre::Vector3 & getPosition() const
Get water position.
void _setStrength(const Ogre::Real &Strength)
Set water strength GPU param.
GPUNormalMapManager * getGPUNormalMapManager()
Get Hydrax::GPUNormalMapManager.
const bool & _isCurrentFrameUnderwater() const
Is current frame underwater?
NormalMode
Normal generation mode.
Class wich contains all funtions/variables related to Hydrax water mesh.
const Ogre::String & getMaterialName() const
Get material name.
Ogre::Vector2 getGridPosition(const Ogre::Vector2 &Position)
Get the [0,1] range x/y grid position from a 2D world space x/z point.
void create()
Create our water mesh, geometry, entity, etc...
void setMaterialName(const Ogre::String &MaterialName)
Set mesh material.
void remove()
Remove all resources.
VertexType
Mesh vertex type enum.
void setOptions(const Options &Options)
Update options.
Ogre::Entity * getEntity()
Get entity.
bool updateGeometry(const int &numVer, void *verArray)
Update geomtry.
Base module class, Override it for create different ways of create water noise.
virtual void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
virtual void remove()
Remove.
const Ogre::String & getName() const
Get module name.
virtual void create()
Create.
const bool & isCreated() const
Is created() called?
Noise::Noise * mNoise
Noise generator pointer.
MaterialManager::NormalMode mNormalMode
Normal map generation mode.
virtual void saveCfg(Ogre::String &Data)
Save config.
Mesh::Options mMeshOptions
Module mesh options.
const MaterialManager::NormalMode & getNormalMode() const
Get the normal generation mode.
virtual bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
const Mesh::Options & getMeshOptions() const
Get the mesh options for this module.
SimpleGrid(Hydrax *h, Noise::Noise *n, const MaterialManager::NormalMode &NormalMode)
Constructor.
Hydrax * mHydrax
Our Hydrax pointer.
bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Mesh::POS_NORM_VERTEX * mVerticesChoppyBuffer
Use it to store vertex positions when choppy displacement is enabled.
void _performChoppyWaves()
Perform choppy waves.
void setOptions(const Options &Options)
Set options.
Options mOptions
Our projected grid options.
float getHeigth(const Ogre::Vector2 &Position)
Get the current heigth at a especified world-space point.
void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
void * mVertices
Vertex pointer (Mesh::POS_NORM_VERTEX or Mesh::POS_VERTEX)
void _calculeNormals()
Calcule current normals.
void saveCfg(Ogre::String &Data)
Save config.
Base noise class, Override it for create different ways of create water noise.
const Ogre::String & getName() const
Get noise name.
virtual bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
virtual float getValue(const float &x, const float &y)=0
Get the especified x/y noise value.
Mesh::VertexType _SG_getVertexTypeFromNormalMode(const MaterialManager::NormalMode &NormalMode)
Ogre::String _SG_getNormalModeString(const MaterialManager::NormalMode &NormalMode)
Size MeshSize
Grid size (X/Z) world space.
float MeshStrength
Water strength.
int MeshComplexity
Mesh complexity.
Vertex struct for position and normals data.
Vertex struct for position data.
Struct wich contains Hydrax simple grid module options.
float ChoppyStrength
Choppy waves strength.
bool ChoppyWaves
Choppy waves.
int Complexity
Projected grid complexity (N*N)
Struct wich contains an especific width and height value.