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