RigsofRods
Soft-body Physics Simulation
SimpleGrid.cpp
Go to the documentation of this file.
1 /*
2 --------------------------------------------------------------------------------
3 This source file is part of Hydrax.
4 Visit ---
5 
6 Copyright (C) 2008 Xavier Vergu�n Gonz�lez <xavierverguin@hotmail.com>
7  <xavyiy@gmail.com>
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
12 version.
13 
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License along with
19 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21 http://www.gnu.org/copyleft/lesser.txt.
22 --------------------------------------------------------------------------------
23 */
24 
25 #include <SimpleGrid.h>
26 
27 namespace Hydrax{namespace Module
28 {
30  {
31  if (NormalMode == MaterialManager::NM_VERTEX)
32  {
33  return Mesh::VT_POS_NORM;
34  }
35 
36  // NM_RTT
37  return Mesh::VT_POS;
38  }
39 
40  Ogre::String _SG_getNormalModeString(const MaterialManager::NormalMode& NormalMode)
41  {
42  if (NormalMode == MaterialManager::NM_VERTEX)
43  {
44  return "Vertex";
45  }
46 
47  return "Rtt";
48  }
49 
51  : Module("SimpleGrid" + _SG_getNormalModeString(NormalMode),
52  n, Mesh::Options(256, Size(100), _SG_getVertexTypeFromNormalMode(NormalMode)), NormalMode)
53  , mHydrax(h)
54  , mVertices(0)
55  , mVerticesChoppyBuffer(0)
56  {
57  }
58 
60  : Module("SimpleGrid" + _SG_getNormalModeString(NormalMode),
61  n, Mesh::Options(Options.Complexity, Size(Options.MeshSize), _SG_getVertexTypeFromNormalMode(NormalMode)), NormalMode)
62  , mHydrax(h)
63  , mVertices(0)
64  , mVerticesChoppyBuffer(0)
65  {
67  }
68 
70  {
71  remove();
72 
73  HydraxLOG(getName() + " destroyed.");
74  }
75 
77  {
81 
84 
85  if (isCreated())
86  {
88  {
89  remove();
90  mOptions = Options;
91  create();
92 
94  {
96  {
97  HydraxLOG(mNoise->getName() + " doesn't support GPU Normal map generation.");
98  }
99  }
100 
101  Ogre::String MaterialNameTmp = mHydrax->getMesh()->getMaterialName();
102  mHydrax->getMesh()->remove();
103 
105  mHydrax->getMesh()->setMaterialName(MaterialNameTmp);
106  mHydrax->getMesh()->create();
107 
108  return;
109  }
110 
111  mOptions = Options;
112 
113  int v, u;
115  {
116  Mesh::POS_NORM_VERTEX* Vertices = static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
117 
118  for(v=0; v<mOptions.Complexity; v++)
119  {
120  for(u=0; u<mOptions.Complexity; u++)
121  {
122  Vertices[v*mOptions.Complexity + u].x = (static_cast<float>(v)/(mOptions.Complexity-1)) * mOptions.MeshSize.Width;
123  Vertices[v*mOptions.Complexity + u].z = (static_cast<float>(u)/(mOptions.Complexity-1)) * mOptions.MeshSize.Height;
124  }
125  }
126 
128  {
129  for(int i = 0; i < mOptions.Complexity*mOptions.Complexity; i++)
130  {
131  mVerticesChoppyBuffer[i] = Vertices[i];
132  }
133  }
134  }
136  {
137  Mesh::POS_VERTEX* Vertices = static_cast<Mesh::POS_VERTEX*>(mVertices);
138 
139  for(v=0; v<mOptions.Complexity; v++)
140  {
141  for(u=0; u<mOptions.Complexity; u++)
142  {
143  Vertices[v*mOptions.Complexity + u].x = (static_cast<float>(v)/(mOptions.Complexity-1)) * mOptions.MeshSize.Width;
144  Vertices[v*mOptions.Complexity + u].z = (static_cast<float>(u)/(mOptions.Complexity-1)) * mOptions.MeshSize.Height;
145  }
146  }
147  }
148 
149  return;
150  }
151 
152  mOptions = Options;
153  }
154 
156  {
157  HydraxLOG("Creating " + getName() + " module.");
158 
159  Module::create();
160 
161  int v, u;
163  {
165  Mesh::POS_NORM_VERTEX* Vertices = static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
166 
167  for(v=0; v<mOptions.Complexity; v++)
168  {
169  for(u=0; u<mOptions.Complexity; u++)
170  {
171  Vertices[v*mOptions.Complexity + u].x = (static_cast<float>(v)/(mOptions.Complexity-1)) * mOptions.MeshSize.Width;
172  Vertices[v*mOptions.Complexity + u].z = (static_cast<float>(u)/(mOptions.Complexity-1)) * mOptions.MeshSize.Height;
173 
174  Vertices[v*mOptions.Complexity + u].nx = 0;
175  Vertices[v*mOptions.Complexity + u].ny = -1;
176  Vertices[v*mOptions.Complexity + u].nz = 0;
177  }
178  }
179 
180  if (mOptions.ChoppyWaves)
181  {
183 
184  for(int i = 0; i < mOptions.Complexity*mOptions.Complexity; i++)
185  {
186  mVerticesChoppyBuffer[i] = Vertices[i];
187  }
188  }
189  }
191  {
193  Mesh::POS_VERTEX* Vertices = static_cast<Mesh::POS_VERTEX*>(mVertices);
194 
195  for(v=0; v<mOptions.Complexity; v++)
196  {
197  for(u=0; u<mOptions.Complexity; u++)
198  {
199  Vertices[v*mOptions.Complexity + u].x = (static_cast<float>(v)/(mOptions.Complexity-1)) * mOptions.MeshSize.Width;
200  Vertices[v*mOptions.Complexity + u].z = (static_cast<float>(u)/(mOptions.Complexity-1)) * mOptions.MeshSize.Height;
201  }
202  }
203  }
204 
205  HydraxLOG(getName() + " created.");
206  }
207 
209  {
210  if (!isCreated())
211  {
212  return;
213  }
214 
215  Module::remove();
216 
217  if (mVertices)
218  {
220  {
221  delete [] static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
222  mVertices = 0;
223  }
225  {
226  delete [] static_cast<Mesh::POS_VERTEX*>(mVertices);
227  mVertices = 0;
228  }
229  }
230 
232  {
233  delete [] mVerticesChoppyBuffer;
234  }
235  }
236 
237  void SimpleGrid::saveCfg(Ogre::String &Data)
238  {
239  Module::saveCfg(Data);
240 
241  Data += CfgFileManager::_getCfgString("SG_Complexity", mOptions.Complexity);
242  Data += CfgFileManager::_getCfgString("SG_MeshSize", mOptions.MeshSize);
243  Data += CfgFileManager::_getCfgString("SG_Strength", mOptions.Strength);
244  Data += CfgFileManager::_getCfgString("SG_Smooth", mOptions.Smooth);
245  Data += CfgFileManager::_getCfgString("SG_ChoppyWaves", mOptions.ChoppyWaves);
246  Data += CfgFileManager::_getCfgString("SG_ChoppyStrength", mOptions.ChoppyStrength); Data += "\n";
247  }
248 
249  bool SimpleGrid::loadCfg(Ogre::ConfigFile &CfgFile)
250  {
251  if (!Module::loadCfg(CfgFile))
252  {
253  return false;
254  }
255 
256  setOptions(
257  Options(CfgFileManager::_getIntValue(CfgFile, "SG_Complexity"),
258  CfgFileManager::_getSizeValue(CfgFile, "SG_MeshSize"),
259  CfgFileManager::_getFloatValue(CfgFile, "SG_Strength"),
260  CfgFileManager::_getBoolValue(CfgFile, "PG_Smooth"),
261  CfgFileManager::_getBoolValue(CfgFile, "PG_ChoppyWaves"),
262  CfgFileManager::_getFloatValue(CfgFile, "PG_ChoopyStrength")));
263 
264  return true;
265  }
266 
267  void SimpleGrid::update(const Ogre::Real &timeSinceLastFrame)
268  {
269  if (!isCreated())
270  {
271  return;
272  }
273 
274  Module::update(timeSinceLastFrame);
275 
276  // Update heigths
277 
279  {
280  Mesh::POS_NORM_VERTEX* Vertices = static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
281 
282  if (mOptions.ChoppyWaves)
283  {
284  for(int i = 0; i < mOptions.Complexity*mOptions.Complexity; i++)
285  {
286  Vertices[i] = mVerticesChoppyBuffer[i];
287  Vertices[i].y = mNoise->getValue(Vertices[i].x, Vertices[i].z) * mOptions.Strength;
288  }
289  }
290  else
291  {
292  for(int i = 0; i < mOptions.Complexity*mOptions.Complexity; i++)
293  {
294  Vertices[i].y = mNoise->getValue(Vertices[i].x, Vertices[i].z) * mOptions.Strength;
295  }
296  }
297  }
299  {
300  Mesh::POS_VERTEX* Vertices = static_cast<Mesh::POS_VERTEX*>(mVertices);
301 
302  // For object-space to world-space conversion
303  // RTT normals calculation needs world-space coords
304  Ogre::Vector3 p = Ogre::Vector3(0,0,0);
305  Ogre::Affine3 mWorldMatrix;
306  mWorldMatrix = mHydrax->getMesh()->getEntity()->getParentSceneNode()->_getFullTransform();
307  for(int i = 0; i < mOptions.Complexity*mOptions.Complexity; i++)
308  {
309  p.x = Vertices[i].x;
310  p.y = 0;
311  p.z = Vertices[i].z;
312 
313  // Calculate the world-space position
314  mWorldMatrix*(p);
315 
316  Vertices[i].y = mNoise->getValue(p.x, p.z) * mOptions.Strength;
317  }
318  }
319 
320  // Smooth the heightdata
321  if (mOptions.Smooth)
322  {
324  {
325  Mesh::POS_NORM_VERTEX* Vertices = static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
326 
327  for(int v=1; v<(mOptions.Complexity-1); v++)
328  {
329  for(int u=1; u<(mOptions.Complexity-1); u++)
330  {
331  Vertices[v*mOptions.Complexity + u].y =
332  0.2f *
333  (Vertices[v *mOptions.Complexity + u ].y +
334  Vertices[v *mOptions.Complexity + (u+1)].y +
335  Vertices[v *mOptions.Complexity + (u-1)].y +
336  Vertices[(v+1)*mOptions.Complexity + u ].y +
337  Vertices[(v-1)*mOptions.Complexity + u ].y);
338  }
339  }
340  }
342  {
343  Mesh::POS_VERTEX* Vertices = static_cast<Mesh::POS_VERTEX*>(mVertices);
344 
345  for(int v=1; v<(mOptions.Complexity-1); v++)
346  {
347  for(int u=1; u<(mOptions.Complexity-1); u++)
348  {
349  Vertices[v*mOptions.Complexity + u].y =
350  0.2f *
351  (Vertices[v *mOptions.Complexity + u ].y +
352  Vertices[v *mOptions.Complexity + (u+1)].y +
353  Vertices[v *mOptions.Complexity + (u-1)].y +
354  Vertices[(v+1)*mOptions.Complexity + u ].y +
355  Vertices[(v-1)*mOptions.Complexity + u ].y);
356  }
357  }
358  }
359  }
360 
361  // Update normals
362  _calculeNormals();
363 
364  // Perform choppy waves
366 
367  // Upload geometry changes
369  }
370 
372  {
374  {
375  return;
376  }
377 
378  int v, u;
379  Ogre::Vector3 vec1, vec2, normal;
380 
381  Mesh::POS_NORM_VERTEX* Vertices = static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
382 
383  for(v=1; v<(mOptions.Complexity-1); v++)
384  {
385  for(u=1; u<(mOptions.Complexity-1); u++)
386  {
387  vec1 = Ogre::Vector3(
388  Vertices[v*mOptions.Complexity + u + 1].x-Vertices[v*mOptions.Complexity + u - 1].x,
389  Vertices[v*mOptions.Complexity + u + 1].y-Vertices[v*mOptions.Complexity + u - 1].y,
390  Vertices[v*mOptions.Complexity + u + 1].z-Vertices[v*mOptions.Complexity + u - 1].z);
391 
392  vec2 = Ogre::Vector3(
393  Vertices[(v+1)*mOptions.Complexity + u].x - Vertices[(v-1)*mOptions.Complexity + u].x,
394  Vertices[(v+1)*mOptions.Complexity + u].y - Vertices[(v-1)*mOptions.Complexity + u].y,
395  Vertices[(v+1)*mOptions.Complexity + u].z - Vertices[(v-1)*mOptions.Complexity + u].z);
396 
397  normal = vec2.crossProduct(vec1);
398 
399  Vertices[v*mOptions.Complexity + u].nx = normal.x;
400  Vertices[v*mOptions.Complexity + u].ny = normal.y;
401  Vertices[v*mOptions.Complexity + u].nz = normal.z;
402  }
403  }
404  }
405 
407  {
409  {
410  return;
411  }
412 
413  int v, u,
414  Underwater = 1;
415 
417  {
418  Underwater = -1;
419  }
420 
421  Mesh::POS_NORM_VERTEX* Vertices = static_cast<Mesh::POS_NORM_VERTEX*>(mVertices);
422 
423  for(v=1; v<(mOptions.Complexity-1); v++)
424  {
425  for(u=1; u<(mOptions.Complexity-1); u++)
426  {
427  Vertices[v*mOptions.Complexity + u].x += Vertices[v*mOptions.Complexity + u].nx * mOptions.ChoppyStrength * Underwater;
428  Vertices[v*mOptions.Complexity + u].z += Vertices[v*mOptions.Complexity + u].nz * mOptions.ChoppyStrength * Underwater;
429  }
430  }
431  }
432 
433  float SimpleGrid::getHeigth(const Ogre::Vector2 &Position)
434  {
436  {
437  Ogre::Vector2 RelativePos = mHydrax->getMesh()->getGridPosition(Position);
438 
439  RelativePos.x *= mOptions.MeshSize.Width;
440  RelativePos.y *= mOptions.MeshSize.Height;
441 
442  return mHydrax->getPosition().y + mNoise->getValue(RelativePos.x, RelativePos.y)*mOptions.Strength;
443  }
444  else // RTT Normals calculations works with world-space coords
445  {
446  return mHydrax->getPosition().y + mNoise->getValue(Position.x, Position.y)*mOptions.Strength;
447  }
448  }
449 }}
Hydrax::Module::SimpleGrid::Options::ChoppyWaves
bool ChoppyWaves
Choppy waves.
Definition: SimpleGrid.h:60
Hydrax::Mesh::create
void create()
Create our water mesh, geometry, entity, etc...
Definition: Mesh.cpp:117
Hydrax::Mesh::VertexType
VertexType
Mesh vertex type enum.
Definition: Mesh.h:83
Hydrax::Module::Module::saveCfg
virtual void saveCfg(Ogre::String &Data)
Save config.
Definition: Module.cpp:99
Hydrax::Module::SimpleGrid::SimpleGrid
SimpleGrid(Hydrax *h, Noise::Noise *n, const MaterialManager::NormalMode &NormalMode)
Constructor.
Definition: SimpleGrid.cpp:50
y
float y
Definition: (ValueTypes) quaternion.h:6
Hydrax::Mesh::Options::MeshStrength
float MeshStrength
Water strength.
Definition: Mesh.h:137
Hydrax::Noise::Noise::createGPUNormalMapResources
virtual bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
Definition: Noise.cpp:52
Hydrax::Mesh::POS_VERTEX
Vertex struct for position data.
Definition: Mesh.h:76
Hydrax::Module::Module::isCreated
const bool & isCreated() const
Is created() called?
Definition: Module.h:107
Hydrax::Hydrax::getPosition
const Ogre::Vector3 & getPosition() const
Get water position.
Definition: Hydrax.h:413
Hydrax::Module::_SG_getVertexTypeFromNormalMode
Mesh::VertexType _SG_getVertexTypeFromNormalMode(const MaterialManager::NormalMode &NormalMode)
Definition: SimpleGrid.cpp:29
Hydrax::Hydrax::getMesh
Mesh * getMesh()
Get Hydrax::Mesh.
Definition: Hydrax.h:317
Hydrax::Module::SimpleGrid::Options::Strength
float Strength
Strength.
Definition: SimpleGrid.h:56
Hydrax
Definition: CfgFileManager.cpp:28
z
float z
Definition: (ValueTypes) quaternion.h:7
Hydrax::Mesh::POS_VERTEX::z
float z
Definition: Mesh.h:78
Hydrax::Mesh::updateGeometry
bool updateGeometry(const int &numVer, void *verArray)
Update geomtry.
Definition: Mesh.cpp:281
Hydrax::Module::SimpleGrid::mVerticesChoppyBuffer
Mesh::POS_NORM_VERTEX * mVerticesChoppyBuffer
Use it to store vertex positions when choppy displacement is enabled.
Definition: SimpleGrid.h:189
Hydrax::Size
Struct wich contains an especific width and height value.
Definition: Help.h:40
Hydrax::Module::SimpleGrid::_calculeNormals
void _calculeNormals()
Calcule current normals.
Definition: SimpleGrid.cpp:371
Hydrax::Mesh::POS_VERTEX::x
float x
Definition: Mesh.h:78
Hydrax::CfgFileManager::_getSizeValue
static Size _getSizeValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get size value.
Definition: CfgFileManager.cpp:505
Hydrax::Mesh::POS_NORM_VERTEX::nx
float nx
Definition: Mesh.h:63
SimpleGrid.h
Hydrax::Module::SimpleGrid::getHeigth
float getHeigth(const Ogre::Vector2 &Position)
Get the current heigth at a especified world-space point.
Definition: SimpleGrid.cpp:433
Hydrax::Mesh::POS_NORM_VERTEX::ny
float ny
Definition: Mesh.h:63
Hydrax::Hydrax::_setStrength
void _setStrength(const Ogre::Real &Strength)
Set water strength GPU param.
Definition: Hydrax.cpp:763
Hydrax::CfgFileManager::_getBoolValue
static bool _getBoolValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get bool value.
Definition: CfgFileManager.cpp:460
Hydrax::Module::Module::create
virtual void create()
Create.
Definition: Module.cpp:46
Hydrax::Module::SimpleGrid::_performChoppyWaves
void _performChoppyWaves()
Perform choppy waves.
Definition: SimpleGrid.cpp:406
Hydrax::Noise::Noise::getValue
virtual float getValue(const float &x, const float &y)=0
Get the especified x/y noise value.
Hydrax::Mesh::getMaterialName
const Ogre::String & getMaterialName() const
Get material name.
Definition: Mesh.h:269
Hydrax::Module::_SG_getNormalModeString
Ogre::String _SG_getNormalModeString(const MaterialManager::NormalMode &NormalMode)
Definition: SimpleGrid.cpp:40
Hydrax::Mesh::POS_NORM_VERTEX::z
float z
Definition: Mesh.h:62
Hydrax::Module::SimpleGrid::remove
void remove()
Remove.
Definition: SimpleGrid.cpp:208
Hydrax::Mesh::getGridPosition
Ogre::Vector2 getGridPosition(const Ogre::Vector2 &Position)
Get the [0,1] range x/y grid position from a 2D world space x/z point.
Definition: Mesh.cpp:353
Hydrax::Mesh::setMaterialName
void setMaterialName(const Ogre::String &MaterialName)
Set mesh material.
Definition: Mesh.cpp:107
Hydrax::Hydrax::getGPUNormalMapManager
GPUNormalMapManager * getGPUNormalMapManager()
Get Hydrax::GPUNormalMapManager.
Definition: Hydrax.h:365
Hydrax::Noise::Noise::getName
const Ogre::String & getName() const
Get noise name.
Definition: Noise.h:92
Hydrax::Module::SimpleGrid::loadCfg
bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Definition: SimpleGrid.cpp:249
Hydrax::Module::SimpleGrid::setOptions
void setOptions(const Options &Options)
Set options.
Definition: SimpleGrid.cpp:76
Hydrax::Noise::Noise
Base noise class, Override it for create different ways of create water noise.
Definition: Noise.h:42
Hydrax::Module::Module::getMeshOptions
const Mesh::Options & getMeshOptions() const
Get the mesh options for this module.
Definition: Module.h:133
Hydrax::MaterialManager::NormalMode
NormalMode
Normal generation mode.
Definition: MaterialManager.h:100
HydraxLOG
#define HydraxLOG(msg)
Definition: Application.h:59
Hydrax::Module::SimpleGrid::Options
Struct wich contains Hydrax simple grid module options.
Definition: SimpleGrid.h:49
Hydrax::Mesh::remove
void remove()
Remove all resources.
Definition: Mesh.cpp:52
Hydrax::Module::Module
Base module class, Override it for create different ways of create water noise.
Definition: Module.h:46
Hydrax::Module::SimpleGrid::Options::Complexity
int Complexity
Projected grid complexity (N*N)
Definition: SimpleGrid.h:52
Hydrax::Module::SimpleGrid::~SimpleGrid
~SimpleGrid()
Destructor.
Definition: SimpleGrid.cpp:69
Hydrax::Module::SimpleGrid::mHydrax
Hydrax * mHydrax
Our Hydrax pointer.
Definition: SimpleGrid.h:195
Hydrax::Mesh
Class wich contains all funtions/variables related to Hydrax water mesh.
Definition: Mesh.h:46
Hydrax::Module::Module::update
virtual void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
Definition: Module.cpp:94
Hydrax::Mesh::VT_POS
@ VT_POS
Definition: Mesh.h:88
Hydrax::MaterialManager::NM_RTT
@ NM_RTT
Definition: MaterialManager.h:107
Hydrax::Module::SimpleGrid::saveCfg
void saveCfg(Ogre::String &Data)
Save config.
Definition: SimpleGrid.cpp:237
Hydrax::CfgFileManager::_getCfgString
static Ogre::String _getCfgString(const Ogre::String &Name, const int &Value)
Definition: CfgFileManager.cpp:155
Hydrax::Module::SimpleGrid::Options::MeshSize
Size MeshSize
Size.
Definition: SimpleGrid.h:54
Hydrax::Module::Module::loadCfg
virtual bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Definition: Module.cpp:105
Hydrax::Mesh::Options::MeshComplexity
int MeshComplexity
Mesh complexity.
Definition: Mesh.h:133
Hydrax::Module::SimpleGrid::update
void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
Definition: SimpleGrid.cpp:267
Hydrax::Mesh::POS_NORM_VERTEX::y
float y
Definition: Mesh.h:62
Hydrax::Mesh::Options::MeshSize
Size MeshSize
Grid size (X/Z) world space.
Definition: Mesh.h:135
Hydrax::Module::SimpleGrid::mOptions
Options mOptions
Our projected grid options.
Definition: SimpleGrid.h:192
Hydrax::Module::Module::mNormalMode
MaterialManager::NormalMode mNormalMode
Normal map generation mode.
Definition: Module.h:160
Hydrax::Size::Width
int Width
Width value.
Definition: Help.h:43
Hydrax::Mesh::POS_NORM_VERTEX
Vertex struct for position and normals data.
Definition: Mesh.h:60
Hydrax::Mesh::POS_NORM_VERTEX::x
float x
Definition: Mesh.h:62
Hydrax::Module::SimpleGrid::mVertices
void * mVertices
Vertex pointer (Mesh::POS_NORM_VERTEX or Mesh::POS_VERTEX)
Definition: SimpleGrid.h:186
Hydrax::Mesh::setOptions
void setOptions(const Options &Options)
Update options.
Definition: Mesh.cpp:78
Hydrax::Module::SimpleGrid::create
void create()
Create.
Definition: SimpleGrid.cpp:155
Hydrax::Module::Module::getNormalMode
const MaterialManager::NormalMode & getNormalMode() const
Get the normal generation mode.
Definition: Module.h:125
Hydrax::Mesh::POS_VERTEX::y
float y
Definition: Mesh.h:78
Hydrax::Mesh::VT_POS_NORM
@ VT_POS_NORM
Definition: Mesh.h:86
Hydrax::CfgFileManager::_getIntValue
static int _getIntValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get int value.
Definition: CfgFileManager.cpp:432
Hydrax::Hydrax::_isCurrentFrameUnderwater
const bool & _isCurrentFrameUnderwater() const
Is current frame underwater?
Definition: Hydrax.h:621
Hydrax::Module::Module::getName
const Ogre::String & getName() const
Get module name.
Definition: Module.h:99
Hydrax::Module::Module::mNoise
Noise::Noise * mNoise
Noise generator pointer.
Definition: Module.h:156
Hydrax::Module::SimpleGrid::Options::ChoppyStrength
float ChoppyStrength
Choppy waves strength.
Definition: SimpleGrid.h:62
Hydrax::Mesh::POS_NORM_VERTEX::nz
float nz
Definition: Mesh.h:63
Hydrax::Size::Height
int Height
Height value.
Definition: Help.h:45
Hydrax::Module::Module::remove
virtual void remove()
Remove.
Definition: Module.cpp:53
Hydrax::CfgFileManager::_getFloatValue
static Ogre::Real _getFloatValue(Ogre::ConfigFile &CfgFile, const Ogre::String Name)
Get float value.
Definition: CfgFileManager.cpp:446
x
float x
Definition: (ValueTypes) quaternion.h:5
Hydrax::Mesh::getEntity
Ogre::Entity * getEntity()
Get entity.
Definition: Mesh.h:221
Hydrax::Module::Module::mMeshOptions
Mesh::Options mMeshOptions
Module mesh options.
Definition: Module.h:158
Hydrax::Module::SimpleGrid::Options::Smooth
bool Smooth
Smooth.
Definition: SimpleGrid.h:58
Hydrax::MaterialManager::NM_VERTEX
@ NM_VERTEX
Definition: MaterialManager.h:105