RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Attributes
Hydrax::Noise::PressurePoint Class Reference

A PressurePoint defined by the origen, pressure pulse, Maximum time of perturbation and wave longitude.
Pressure points can be used to add object falling at sea, or, adding sucessive point, to simulate ship Kelvin wakes. More...

#include <Noise/PressurePoint/PressurePoint.h>

Public Member Functions

 PressurePoint (Ogre::Vector2 Orig, float p, float T, float L)
 Default constructor. More...
 
 ~PressurePoint ()
 Destructor. More...
 
bool update (const Ogre::Real &timeSinceLastFrame)
 Call it each frame. More...
 
float getValue (const float &x, const float &y)
 Get the especified x/y noise value. More...
 
Ogre::Vector2 getOrigin () const
 Returns origin of the PressurePoint. More...
 
float GetTyrePressure () const
 Returns pressure pulse. More...
 
float getMaximumTime () const
 Returns maximum time. More...
 
float getTime () const
 Returns time ellapsed. More...
 
float getLength () const
 Returns wave length. More...
 

Private Attributes

double mTime
 Elapsed time. More...
 
Ogre::Vector2 mPos
 Direction (must be normalised) More...
 
float mP
 Pressure. More...
 
float mT
 Period. More...
 
float mL
 Lenght. More...
 
float mA
 Ampliutde. More...
 
float mK
 Dispersion factor. More...
 
float mC
 Speed (calculated) More...
 
float mW
 Angular frec. More...
 
float mK1
 Time decay term. More...
 
float mK2
 Distance decay term. More...
 

Detailed Description

A PressurePoint defined by the origen, pressure pulse, Maximum time of perturbation and wave longitude.
Pressure points can be used to add object falling at sea, or, adding sucessive point, to simulate ship Kelvin wakes.

Definition at line 69 of file PressurePoint.h.

Constructor & Destructor Documentation

◆ PressurePoint()

PressurePoint::PressurePoint ( Ogre::Vector2  Orig,
float  p,
float  T,
float  L 
)

Default constructor.

Parameters
OrigOrigin of perturbation.
pPressure 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.
TMaximum time of perturbation (s).
The effect of the perturbation will decay. When T time will be elapsed, any effects will remain.
Lwave length.
To objects falling, similar values to amplitude can be OK. For ships Kelvin wakes probably length of the ship is a better choice.

Definition at line 47 of file PressurePoint.cpp.

◆ ~PressurePoint()

PressurePoint::~PressurePoint ( )

Destructor.

Definition at line 60 of file PressurePoint.cpp.

Member Function Documentation

◆ getLength()

float Hydrax::Noise::PressurePoint::getLength ( ) const
inline

Returns wave length.

Returns
Wave length.

Definition at line 124 of file PressurePoint.h.

◆ getMaximumTime()

float Hydrax::Noise::PressurePoint::getMaximumTime ( ) const
inline

Returns maximum time.

Returns
Maximum time.

Definition at line 116 of file PressurePoint.h.

◆ getOrigin()

Ogre::Vector2 Hydrax::Noise::PressurePoint::getOrigin ( ) const
inline

Returns origin of the PressurePoint.

Returns
Origin point.

Definition at line 108 of file PressurePoint.h.

◆ getTime()

float Hydrax::Noise::PressurePoint::getTime ( ) const
inline

Returns time ellapsed.

Returns
Time elapsed.

Definition at line 120 of file PressurePoint.h.

◆ GetTyrePressure()

float Hydrax::Noise::PressurePoint::GetTyrePressure ( ) const
inline

Returns pressure pulse.

Returns
Pressure.

Definition at line 112 of file PressurePoint.h.

◆ getValue()

float PressurePoint::getValue ( const float &  x,
const float &  y 
)

Get the especified x/y noise value.

Parameters
xX Coord
yY Coord
Returns
Noise value
Remarks
range [~-0.2, ~0.2]

1st.- Calculate distance.

2nd.- Calculate time decay factors

2nd.- Calculate distance decay factors

3rd.- Calculate height

Definition at line 77 of file PressurePoint.cpp.

◆ update()

bool PressurePoint::update ( const Ogre::Real &  timeSinceLastFrame)

Call it each frame.

Parameters
timeSinceLastFrameTime since last frame(delta)
Returns
false if the point can be deleted because time elapsed is bigger than maximum time.

Definition at line 64 of file PressurePoint.cpp.

Field Documentation

◆ mA

float Hydrax::Noise::PressurePoint::mA
private

Ampliutde.

Definition at line 142 of file PressurePoint.h.

◆ mC

float Hydrax::Noise::PressurePoint::mC
private

Speed (calculated)

Definition at line 146 of file PressurePoint.h.

◆ mK

float Hydrax::Noise::PressurePoint::mK
private

Dispersion factor.

Definition at line 144 of file PressurePoint.h.

◆ mK1

float Hydrax::Noise::PressurePoint::mK1
private

Time decay term.

Definition at line 150 of file PressurePoint.h.

◆ mK2

float Hydrax::Noise::PressurePoint::mK2
private

Distance decay term.

Definition at line 152 of file PressurePoint.h.

◆ mL

float Hydrax::Noise::PressurePoint::mL
private

Lenght.

Definition at line 140 of file PressurePoint.h.

◆ mP

float Hydrax::Noise::PressurePoint::mP
private

Pressure.

Definition at line 136 of file PressurePoint.h.

◆ mPos

Ogre::Vector2 Hydrax::Noise::PressurePoint::mPos
private

Direction (must be normalised)

Definition at line 134 of file PressurePoint.h.

◆ mT

float Hydrax::Noise::PressurePoint::mT
private

Period.

Definition at line 138 of file PressurePoint.h.

◆ mTime

double Hydrax::Noise::PressurePoint::mTime
private

Elapsed time.

Definition at line 131 of file PressurePoint.h.

◆ mW

float Hydrax::Noise::PressurePoint::mW
private

Angular frec.

Definition at line 148 of file PressurePoint.h.


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