RigsofRods
Soft-body Physics Simulation
Public Member Functions | Protected Attributes
Hydrax::Module::Module Class Reference

Base module class, Override it for create different ways of create water noise. More...

#include <Module.h>

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

Public Member Functions

 Module (const Ogre::String &Name, Noise::Noise *n, const Mesh::Options &MeshOptions, const MaterialManager::NormalMode &NormalMode)
 Constructor. More...
 
virtual ~Module ()
 Destructor. More...
 
virtual void create ()
 Create. More...
 
virtual void remove ()
 Remove. More...
 
void setNoise (Noise::Noise *Noise, GPUNormalMapManager *g=0, const bool &DeleteOldNoise=true)
 Set noise. More...
 
virtual void update (const Ogre::Real &timeSinceLastFrame)
 Call it each frame. More...
 
virtual void saveCfg (Ogre::String &Data)
 Save config. More...
 
virtual bool loadCfg (Ogre::ConfigFile &CfgFile)
 Load config. 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...
 
virtual float getHeigth (const Ogre::Vector2 &Position)
 Get the current heigth at a especified world-space point. More...
 

Protected Attributes

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

Base module class, Override it for create different ways of create water noise.

Definition at line 46 of file Module.h.

Constructor & Destructor Documentation

◆ Module()

Hydrax::Module::Module::Module ( const Ogre::String &  Name,
Noise::Noise n,
const Mesh::Options MeshOptions,
const MaterialManager::NormalMode NormalMode 
)

Constructor.

Parameters
NameModule name
nHydrax::Noise::Noise generator pointer
MeshOptionsMesh options
NormalModeNormal generation mode

Definition at line 29 of file Module.cpp.

◆ ~Module()

Hydrax::Module::Module::~Module ( )
virtual

Destructor.

Definition at line 41 of file Module.cpp.

Member Function Documentation

◆ _createGeometry()

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

Create geometry in module(If special geometry is needed)

Parameters
mMeshMesh
Returns
false if it must be create by default Mesh::_createGeometry() fnc.
Remarks
Override it if any especial geometry mesh creation is needed.

Reimplemented in Hydrax::Module::RadialGrid.

Definition at line 117 of file Module.h.

+ Here is the caller graph for this function:

◆ create()

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

Create.

Remarks
Not forgot call in the override class

Reimplemented in Hydrax::Module::ProjectedGrid, Hydrax::Module::RadialGrid, and Hydrax::Module::SimpleGrid.

Definition at line 46 of file Module.cpp.

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

◆ getHeigth()

float Hydrax::Module::Module::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 in Hydrax::Module::ProjectedGrid, Hydrax::Module::RadialGrid, and Hydrax::Module::SimpleGrid.

Definition at line 117 of file Module.cpp.

◆ getMeshOptions()

const Mesh::Options& Hydrax::Module::Module::getMeshOptions ( ) const
inline

Get the mesh options for this module.

Returns
Mesh options for this module

Definition at line 133 of file Module.h.

+ Here is the caller graph for this function:

◆ getName()

const Ogre::String& Hydrax::Module::Module::getName ( ) const
inline

Get module name.

Returns
Module name

Definition at line 99 of file Module.h.

+ Here is the caller graph for this function:

◆ getNoise()

Noise::Noise* Hydrax::Module::Module::getNoise ( )
inline

Get the Hydrax::Noise module pointer.

Returns
Hydrax::Noise pointer

Definition at line 141 of file Module.h.

+ Here is the caller graph for this function:

◆ getNormalMode()

const MaterialManager::NormalMode& Hydrax::Module::Module::getNormalMode ( ) const
inline

Get the normal generation mode.

Returns
Module normal generation mode

Definition at line 125 of file Module.h.

+ Here is the caller graph for this function:

◆ isCreated()

const bool& Hydrax::Module::Module::isCreated ( ) const
inline

Is created() called?

Returns
true if created() have been already called

Definition at line 107 of file Module.h.

+ Here is the caller graph for this function:

◆ loadCfg()

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

Load config.

Returns
True if is the correct module config

Reimplemented in Hydrax::Module::ProjectedGrid, Hydrax::Module::RadialGrid, and Hydrax::Module::SimpleGrid.

Definition at line 105 of file Module.cpp.

+ Here is the caller graph for this function:

◆ remove()

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

Remove.

Remarks
Not forgot call in the override class

Reimplemented in Hydrax::Module::ProjectedGrid, Hydrax::Module::RadialGrid, and Hydrax::Module::SimpleGrid.

Definition at line 53 of file Module.cpp.

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

◆ saveCfg()

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

Save config.

Parameters
DataString reference

Reimplemented in Hydrax::Module::ProjectedGrid, Hydrax::Module::RadialGrid, and Hydrax::Module::SimpleGrid.

Definition at line 99 of file Module.cpp.

+ Here is the caller graph for this function:

◆ setNoise()

void Hydrax::Module::Module::setNoise ( Noise::Noise Noise,
GPUNormalMapManager g = 0,
const bool &  DeleteOldNoise = true 
)

Set noise.

Parameters
NoiseNew noise module
gGPUNormalMapManager pointer, default: NULL, use it if GPU Normal map generation is needed
DeleteOldNoiseDelete the old noise module (Default = true)

Definition at line 60 of file Module.cpp.

+ Here is the call graph for this function:

◆ update()

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

Call it each frame.

Parameters
timeSinceLastFrameTime since last frame(delta)

Reimplemented in Hydrax::Module::ProjectedGrid, Hydrax::Module::RadialGrid, and Hydrax::Module::SimpleGrid.

Definition at line 94 of file Module.cpp.

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

Field Documentation

◆ mCreated

bool Hydrax::Module::Module::mCreated
protected

Is create() called?

Definition at line 162 of file Module.h.

◆ mMeshOptions

Mesh::Options Hydrax::Module::Module::mMeshOptions
protected

Module mesh options.

Definition at line 158 of file Module.h.

◆ mName

Ogre::String Hydrax::Module::Module::mName
protected

Module name.

Definition at line 154 of file Module.h.

◆ mNoise

Noise::Noise* Hydrax::Module::Module::mNoise
protected

Noise generator pointer.

Definition at line 156 of file Module.h.

◆ mNormalMode

MaterialManager::NormalMode Hydrax::Module::Module::mNormalMode
protected

Normal map generation mode.

Definition at line 160 of file Module.h.


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