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

Hydrax radial grid module. More...

#include <RadialGrid.h>

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

Data Structures

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

Public Member Functions

 RadialGrid (Hydrax *h, Noise::Noise *n, const MaterialManager::NormalMode &NormalMode)
 Constructor. More...
 
 RadialGrid (Hydrax *h, Noise::Noise *n, const MaterialManager::NormalMode &NormalMode, const Options &Options)
 Constructor. More...
 
 ~RadialGrid ()
 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...
 
const bool _createGeometry (Mesh *mMesh) const
 Create geometry in module(If special geometry is needed) 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...
 
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 radial grid module.

Definition at line 44 of file RadialGrid.h.

Constructor & Destructor Documentation

◆ RadialGrid() [1/2]

Hydrax::Module::RadialGrid::RadialGrid ( 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 RadialGrid.cpp.

◆ RadialGrid() [2/2]

Hydrax::Module::RadialGrid::RadialGrid ( 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 RadialGrid.cpp.

+ Here is the call graph for this function:

◆ ~RadialGrid()

Hydrax::Module::RadialGrid::~RadialGrid ( )

Destructor.

Definition at line 69 of file RadialGrid.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _calculeNormals()

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

Calcule current normals.

Definition at line 528 of file RadialGrid.cpp.

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

◆ _createGeometry()

const bool Hydrax::Module::RadialGrid::_createGeometry ( Mesh mMesh) const
virtual

Create geometry in module(If special geometry is needed)

Parameters
mMeshMesh
Returns
false if it must be create by default Mesh::_createGeometry() fnc.

Reimplemented from Hydrax::Module::Module.

Definition at line 254 of file RadialGrid.cpp.

+ Here is the call graph for this function:

◆ _performChoppyWaves()

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

Perform choppy waves.

Definition at line 603 of file RadialGrid.cpp.

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

◆ create()

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

Create.

Reimplemented from Hydrax::Module::Module.

Definition at line 173 of file RadialGrid.cpp.

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

◆ getHeigth()

float Hydrax::Module::RadialGrid::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 665 of file RadialGrid.cpp.

+ Here is the call graph for this function:

◆ getOptions()

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

Get current options.

Returns
Current options

Definition at line 201 of file RadialGrid.h.

◆ loadCfg()

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

Load config.

Returns
True if is the correct module config

Reimplemented from Hydrax::Module::Module.

Definition at line 412 of file RadialGrid.cpp.

+ Here is the call graph for this function:

◆ remove()

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

Remove.

Reimplemented from Hydrax::Module::Module.

Definition at line 367 of file RadialGrid.cpp.

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

◆ saveCfg()

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

Save config.

Parameters
DataString reference

Reimplemented from Hydrax::Module::Module.

Definition at line 396 of file RadialGrid.cpp.

+ Here is the call graph for this function:

◆ setOptions()

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

Set options.

Parameters
OptionsOptions

Definition at line 76 of file RadialGrid.cpp.

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

◆ update()

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

Call it each frame.

Parameters
timeSinceLastFrameTime since last frame(delta)

Reimplemented from Hydrax::Module::Module.

Definition at line 434 of file RadialGrid.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ mHydrax

Hydrax* Hydrax::Module::RadialGrid::mHydrax
private

Our Hydrax pointer.

Definition at line 231 of file RadialGrid.h.

◆ mOptions

Options Hydrax::Module::RadialGrid::mOptions
private

Our projected grid options.

Definition at line 228 of file RadialGrid.h.

◆ mVertices

void* Hydrax::Module::RadialGrid::mVertices
private

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

Definition at line 222 of file RadialGrid.h.

◆ mVerticesChoppyBuffer

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

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

Definition at line 225 of file RadialGrid.h.


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