![]() |
Rigs of Rods 2023.09
Soft-body Physics Simulation
|
This class is a sea elevation module that combines several effects:
Waves, defined by direction, amplitude, period and optionally, phase.
More...
#include <Noise/Real/Real.h>
Inheritance diagram for Hydrax::Noise::Real:Public Member Functions | |
| Real () | |
| Default constructor. | |
| ~Real () | |
| Destructor. | |
| void | create () |
| Create. | |
| void | remove () |
| Remove. | |
| int | addWave (Ogre::Vector2 dir, float A, float T, float p=0.f) |
| Adds a wave to the system. | |
| int | addPressurePoint (Ogre::Vector2 Orig, float p, float T, float L) |
| Adds a pressure point to the system. | |
| Wave | getWave (int id) const |
| Returns a wave to the system. | |
| bool | eraseWave (int id) |
| Removes a wave from the system. | |
| bool | modifyWave (int id, Ogre::Vector2 dir, float A, float T, float p=0.f) |
| Modify a wave from the system. | |
| bool | createGPUNormalMapResources (GPUNormalMapManager *g) |
| Create GPUNormalMap resources. | |
| void | update (const Ogre::Real &timeSinceLastFrame) |
| Call it each frame. | |
| void | saveCfg (Ogre::String &Data) |
| Save config. | |
| bool | loadCfg (Ogre::ConfigFile &CfgFile) |
| Load config. | |
| float | getValue (const float &x, const float &y) |
| Get the especified x/y noise value. | |
| Perlin * | getPerlinNoise () const |
| Get current Real noise options. | |
Public Member Functions inherited from Hydrax::Noise::Noise | |
| Noise (const Ogre::String &Name, const bool &GPUNormalMapSupported) | |
| Constructor. | |
| virtual | ~Noise () |
| Destructor. | |
| virtual void | removeGPUNormalMapResources (GPUNormalMapManager *g) |
| Remove GPUNormalMap resources. | |
| const Ogre::String & | getName () const |
| Get noise name. | |
| const bool & | isCreated () const |
| Is created() called? | |
| const bool & | isGPUNormalMapSupported () const |
| Is GPU Normal map generation supported. | |
| const bool & | areGPUNormalMapResourcesCreated () const |
| Are GPU normal map resources created? | |
Private Attributes | |
| double | mTime |
| Elapsed time. | |
| Perlin * | mPerlinNoise |
| Perlin noise. | |
| GPUNormalMapManager * | mGPUNormalMapManager |
| GPUNormalMapManager pointer. | |
| std::vector< Wave > | mWaves |
| Vector of waves. | |
| std::vector< PressurePoint > | mPressurePoints |
| Vector of pressure points. | |
Additional Inherited Members | |
Protected Attributes inherited from Hydrax::Noise::Noise | |
| Ogre::String | mName |
| Module name. | |
| bool | mCreated |
| Has create() been already called? | |
| bool | mGPUNormalMapSupported |
| Is GPU normal map generation supported? | |
| bool | mGPUNormalMapResourcesCreated |
| Are GPU normal map resources created? | |
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.
| int Hydrax::Noise::Real::addPressurePoint | ( | Ogre::Vector2 | Orig, |
| float | p, | ||
| float | T, | ||
| float | L | ||
| ) |
Adds a pressure point to the system.
| 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. |
| int Hydrax::Noise::Real::addWave | ( | Ogre::Vector2 | dir, |
| float | A, | ||
| float | T, | ||
| float | p = 0.f |
||
| ) |
|
virtual |
|
virtual |
Create GPUNormalMap resources.
| g | GPUNormalMapManager pointer |
Reimplemented from Hydrax::Noise::Noise.
| bool Hydrax::Noise::Real::eraseWave | ( | int | id | ) |
|
inline |
|
virtual |
Get the especified x/y noise value.
| x | X Coord |
| y | Y Coord |
1st.- Perlin height
2nd.- Waves height
3rd.- Pressure points height
Implements Hydrax::Noise::Noise.
| Wave Hydrax::Noise::Real::getWave | ( | int | id | ) | const |
|
virtual |
| bool Hydrax::Noise::Real::modifyWave | ( | int | id, |
| Ogre::Vector2 | dir, | ||
| float | A, | ||
| float | T, | ||
| float | p = 0.f |
||
| ) |
|
virtual |
|
virtual |
|
virtual |
Call it each frame.
| timeSinceLastFrame | Time since last frame(delta) |
Implements Hydrax::Noise::Noise.
|
private |
GPUNormalMapManager pointer.
|
private |
|
private |
|
private |