RigsofRods
Soft-body Physics Simulation
Data Structures | Public Member Functions | Private Member Functions | Private Attributes
Hydrax::Module::SimpleGrid Class Reference

Hydrax simple grid module. More...

#include <SimpleGrid.h>

+ Inheritance diagram for Hydrax::Module::SimpleGrid:
+ Collaboration diagram for Hydrax::Module::SimpleGrid:

Data Structures

struct  Options
 Struct wich contains Hydrax simple grid module options. More...
 

Public Member Functions

 SimpleGrid (Hydrax *h, Noise::Noise *n, const MaterialManager::NormalMode &NormalMode)
 Constructor. More...
 
 SimpleGrid (Hydrax *h, Noise::Noise *n, const MaterialManager::NormalMode &NormalMode, const Options &Options)
 Constructor. More...
 
 ~SimpleGrid ()
 Destructor. More...
 
void create ()
 Create. More...
 
void remove ()
 Remove. More...
 
void update (const Ogre::Real &timeSinceLastFrame)
 Call it each frame. More...
 
void setOptions (const Options &Options)
 Set options. More...
 
void saveCfg (Ogre::String &Data)
 Save config. More...
 
bool loadCfg (Ogre::ConfigFile &CfgFile)
 Load config. More...
 
float getHeigth (const Ogre::Vector2 &Position)
 Get the current heigth at a especified world-space point. More...
 
const OptionsgetOptions () const
 Get current options. More...
 
- Public Member Functions inherited from Hydrax::Module::Module
 Module (const Ogre::String &Name, Noise::Noise *n, const Mesh::Options &MeshOptions, const MaterialManager::NormalMode &NormalMode)
 Constructor. More...
 
virtual ~Module ()
 Destructor. More...
 
void setNoise (Noise::Noise *Noise, GPUNormalMapManager *g=0, const bool &DeleteOldNoise=true)
 Set noise. More...
 
const Ogre::String & getName () const
 Get module name. More...
 
const bool & isCreated () const
 Is created() called? More...
 
virtual const bool _createGeometry (Mesh *mMesh) const
 Create geometry in module(If special geometry is needed) More...
 
const MaterialManager::NormalModegetNormalMode () const
 Get the normal generation mode. More...
 
const Mesh::OptionsgetMeshOptions () const
 Get the mesh options for this module. More...
 
Noise::NoisegetNoise ()
 Get the Hydrax::Noise module pointer. More...
 

Private Member Functions

void _calculeNormals ()
 Calcule current normals. More...
 
void _performChoppyWaves ()
 Perform choppy waves. More...
 

Private Attributes

void * mVertices
 Vertex pointer (Mesh::POS_NORM_VERTEX or Mesh::POS_VERTEX) More...
 
Mesh::POS_NORM_VERTEXmVerticesChoppyBuffer
 Use it to store vertex positions when choppy displacement is enabled. More...
 
Options mOptions
 Our projected grid options. More...
 
HydraxmHydrax
 Our Hydrax pointer. More...
 

Additional Inherited Members

- Protected Attributes inherited from Hydrax::Module::Module
Ogre::String mName
 Module name. More...
 
Noise::NoisemNoise
 Noise generator pointer. More...
 
Mesh::Options mMeshOptions
 Module mesh options. More...
 
MaterialManager::NormalMode mNormalMode
 Normal map generation mode. More...
 
bool mCreated
 Is create() called? More...
 

Detailed Description

Hydrax simple grid module.

Definition at line 44 of file SimpleGrid.h.

Constructor & Destructor Documentation

◆ SimpleGrid() [1/2]

Hydrax::Module::SimpleGrid::SimpleGrid ( Hydrax h,
Noise::Noise n,
const MaterialManager::NormalMode NormalMode 
)

Constructor.

Parameters
hHydrax manager pointer
nHydrax noise module
NormalModeSwitch between MaterialManager::NM_VERTEX and Materialmanager::NM_RTT

Definition at line 50 of file SimpleGrid.cpp.

◆ SimpleGrid() [2/2]

Hydrax::Module::SimpleGrid::SimpleGrid ( Hydrax h,
Noise::Noise n,
const MaterialManager::NormalMode NormalMode,
const Options Options 
)

Constructor.

Parameters
hHydrax manager pointer
nHydrax noise module
NormalModeSwitch between MaterialManager::NM_VERTEX and Materialmanager::NM_RTT
OptionsPerlin options

Definition at line 59 of file SimpleGrid.cpp.

+ Here is the call graph for this function:

◆ ~SimpleGrid()

Hydrax::Module::SimpleGrid::~SimpleGrid ( )

Destructor.

Definition at line 69 of file SimpleGrid.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _calculeNormals()

void Hydrax::Module::SimpleGrid::_calculeNormals ( )
private

Calcule current normals.

Definition at line 371 of file SimpleGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _performChoppyWaves()

void Hydrax::Module::SimpleGrid::_performChoppyWaves ( )
private

Perform choppy waves.

Definition at line 406 of file SimpleGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

void Hydrax::Module::SimpleGrid::create ( )
virtual

Create.

Reimplemented from Hydrax::Module::Module.

Definition at line 155 of file SimpleGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeigth()

float Hydrax::Module::SimpleGrid::getHeigth ( const Ogre::Vector2 &  Position)
virtual

Get the current heigth at a especified world-space point.

Parameters
PositionX/Z World position
Returns
Heigth at the given position in y-World coordinates, if it's outside of the water return -1

Reimplemented from Hydrax::Module::Module.

Definition at line 433 of file SimpleGrid.cpp.

+ Here is the call graph for this function:

◆ getOptions()

const Options& Hydrax::Module::SimpleGrid::getOptions ( ) const
inline

Get current options.

Returns
Current options

Definition at line 171 of file SimpleGrid.h.

◆ loadCfg()

bool Hydrax::Module::SimpleGrid::loadCfg ( Ogre::ConfigFile &  CfgFile)
virtual

Load config.

Returns
True if is the correct module config

Reimplemented from Hydrax::Module::Module.

Definition at line 249 of file SimpleGrid.cpp.

+ Here is the call graph for this function:

◆ remove()

void Hydrax::Module::SimpleGrid::remove ( )
virtual

Remove.

Reimplemented from Hydrax::Module::Module.

Definition at line 208 of file SimpleGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCfg()

void Hydrax::Module::SimpleGrid::saveCfg ( Ogre::String &  Data)
virtual

Save config.

Parameters
DataString reference

Reimplemented from Hydrax::Module::Module.

Definition at line 237 of file SimpleGrid.cpp.

+ Here is the call graph for this function:

◆ setOptions()

void Hydrax::Module::SimpleGrid::setOptions ( const Options Options)

Set options.

Parameters
OptionsOptions

Definition at line 76 of file SimpleGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

void Hydrax::Module::SimpleGrid::update ( const Ogre::Real &  timeSinceLastFrame)
virtual

Call it each frame.

Parameters
timeSinceLastFrameTime since last frame(delta)

Reimplemented from Hydrax::Module::Module.

Definition at line 267 of file SimpleGrid.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ mHydrax

Hydrax* Hydrax::Module::SimpleGrid::mHydrax
private

Our Hydrax pointer.

Definition at line 195 of file SimpleGrid.h.

◆ mOptions

Options Hydrax::Module::SimpleGrid::mOptions
private

Our projected grid options.

Definition at line 192 of file SimpleGrid.h.

◆ mVertices

void* Hydrax::Module::SimpleGrid::mVertices
private

Vertex pointer (Mesh::POS_NORM_VERTEX or Mesh::POS_VERTEX)

Definition at line 186 of file SimpleGrid.h.

◆ mVerticesChoppyBuffer

Mesh::POS_NORM_VERTEX* Hydrax::Module::SimpleGrid::mVerticesChoppyBuffer
private

Use it to store vertex positions when choppy displacement is enabled.

Definition at line 189 of file SimpleGrid.h.


The documentation for this class was generated from the following files: