This class is a sea elevation module that combines several effects:
Waves, defined by direction, amplitude, period and optionally, phase. Perlin noise, used to randomize the sea surface. Pressure points, used to create puntual waves.
More...
#include <Noise/Real/Real.h>
|
| Real () |
| Default constructor. More...
|
|
| ~Real () |
| Destructor. More...
|
|
void | create () |
| Create. More...
|
|
void | remove () |
| Remove. More...
|
|
int | addWave (Ogre::Vector2 dir, float A, float T, float p=0.f) |
| Adds a wave to the system. More...
|
|
int | addPressurePoint (Ogre::Vector2 Orig, float p, float T, float L) |
| Adds a pressure point to the system. More...
|
|
Wave | getWave (int id) const |
| Returns a wave to the system. More...
|
|
bool | eraseWave (int id) |
| Removes a wave from the system. More...
|
|
bool | modifyWave (int id, Ogre::Vector2 dir, float A, float T, float p=0.f) |
| Modify a wave from the system. More...
|
|
bool | createGPUNormalMapResources (GPUNormalMapManager *g) |
| Create GPUNormalMap resources. More...
|
|
void | update (const Ogre::Real &timeSinceLastFrame) |
| Call it each frame. More...
|
|
void | saveCfg (Ogre::String &Data) |
| Save config. More...
|
|
bool | loadCfg (Ogre::ConfigFile &CfgFile) |
| Load config. More...
|
|
float | getValue (const float &x, const float &y) |
| Get the especified x/y noise value. More...
|
|
Perlin * | getPerlinNoise () const |
| Get current Real noise options. More...
|
|
| Noise (const Ogre::String &Name, const bool &GPUNormalMapSupported) |
| Constructor. More...
|
|
virtual | ~Noise () |
| Destructor. More...
|
|
virtual void | removeGPUNormalMapResources (GPUNormalMapManager *g) |
| Remove GPUNormalMap resources. More...
|
|
const Ogre::String & | getName () const |
| Get noise name. More...
|
|
const bool & | isCreated () const |
| Is created() called? More...
|
|
const bool & | isGPUNormalMapSupported () const |
| Is GPU Normal map generation supported. More...
|
|
const bool & | areGPUNormalMapResourcesCreated () const |
| Are GPU normal map resources created? More...
|
|
This class is a sea elevation module that combines several effects:
Waves, defined by direction, amplitude, period and optionally, phase. Perlin noise, used to randomize the sea surface. Pressure points, used to create puntual waves.
Definition at line 68 of file Real.h.
◆ Real()
Hydrax::Noise::Real::Real |
( |
| ) |
|
Default constructor.
Definition at line 38 of file Real.cpp.
◆ ~Real()
Hydrax::Noise::Real::~Real |
( |
| ) |
|
Destructor.
Definition at line 47 of file Real.cpp.
◆ addPressurePoint()
int Hydrax::Noise::Real::addPressurePoint |
( |
Ogre::Vector2 |
Orig, |
|
|
float |
p, |
|
|
float |
T, |
|
|
float |
L |
|
) |
| |
Adds a pressure point to the system.
- Parameters
-
Orig | Origin of perturbation. |
p | Pressure pulse (N·m).
The maximum half-amplitude of the wave will result from divide this value with g*rho. So, a pressure of 10000 N·m produces 2 m waves. |
T | Maximum time of perturbation (s).
The effect of the perturbation will decay. When T time will be elapsed, any effects will remain. |
L | wave length.
To objects falling, similar values to amplitude can be OK. For ships Kelvin wakes probably length of the ship is a better choice. |
- Returns
- Id of the pressure point.
- Warning
- Pressure point will be autodestroyed when it have not any effect, so it's not available any modify after the creation.
Definition at line 92 of file Real.cpp.
◆ addWave()
int Hydrax::Noise::Real::addWave |
( |
Ogre::Vector2 |
dir, |
|
|
float |
A, |
|
|
float |
T, |
|
|
float |
p = 0.f |
|
) |
| |
Adds a wave to the system.
- Parameters
-
dir | Direction of the wave. |
A | Amplitude of the wave (m). |
T | Period of the wave (s). |
p | Phase of the wave (rad). |
- Returns
- Id of the wave.
Definition at line 86 of file Real.cpp.
◆ create()
void Hydrax::Noise::Real::create |
( |
| ) |
|
|
virtual |
◆ createGPUNormalMapResources()
Create GPUNormalMap resources.
- Parameters
-
- Returns
- true if it needs to be created, false if not
Reimplemented from Hydrax::Noise::Noise.
Definition at line 131 of file Real.cpp.
◆ eraseWave()
bool Hydrax::Noise::Real::eraseWave |
( |
int |
id | ) |
|
Removes a wave from the system.
- Parameters
-
id | Identifier of the wave. |
- Returns
- true if all gone right, or false if errors happen.
Definition at line 103 of file Real.cpp.
◆ getPerlinNoise()
Perlin* Hydrax::Noise::Real::getPerlinNoise |
( |
| ) |
const |
|
inline |
Get current Real noise options.
- Returns
- Current Real noise options
Definition at line 166 of file Real.h.
◆ getValue()
float Hydrax::Noise::Real::getValue |
( |
const float & |
x, |
|
|
const float & |
y |
|
) |
| |
|
virtual |
◆ getWave()
Wave Hydrax::Noise::Real::getWave |
( |
int |
id | ) |
const |
Returns a wave to the system.
- Parameters
-
id | Identifier of the wave. |
- Returns
- Selected wave.
Definition at line 98 of file Real.cpp.
◆ loadCfg()
bool Hydrax::Noise::Real::loadCfg |
( |
Ogre::ConfigFile & |
CfgFile | ) |
|
|
virtual |
◆ modifyWave()
bool Hydrax::Noise::Real::modifyWave |
( |
int |
id, |
|
|
Ogre::Vector2 |
dir, |
|
|
float |
A, |
|
|
float |
T, |
|
|
float |
p = 0.f |
|
) |
| |
Modify a wave from the system.
- Parameters
-
id | Identifier of the wave. |
A | Amplitude of the wave (m). |
T | Period of the wave (s). |
p | Phase of the wave (rad). |
- Returns
- true if all gone right, or false if errors happen.
Definition at line 120 of file Real.cpp.
◆ remove()
void Hydrax::Noise::Real::remove |
( |
| ) |
|
|
virtual |
◆ saveCfg()
void Hydrax::Noise::Real::saveCfg |
( |
Ogre::String & |
Data | ) |
|
|
virtual |
◆ update()
void Hydrax::Noise::Real::update |
( |
const Ogre::Real & |
timeSinceLastFrame | ) |
|
|
virtual |
◆ mGPUNormalMapManager
◆ mPerlinNoise
Perlin* Hydrax::Noise::Real::mPerlinNoise |
|
private |
◆ mPressurePoints
Vector of pressure points.
Definition at line 185 of file Real.h.
◆ mTime
double Hydrax::Noise::Real::mTime |
|
private |
Elapsed time.
Definition at line 173 of file Real.h.
◆ mWaves
std::vector<Wave> Hydrax::Noise::Real::mWaves |
|
private |
Vector of waves.
Definition at line 182 of file Real.h.
The documentation for this class was generated from the following files: