RigsofRods
Soft-body Physics Simulation
|
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... | |
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.
PressurePoint::PressurePoint | ( | Ogre::Vector2 | Orig, |
float | p, | ||
float | T, | ||
float | L | ||
) |
Default constructor.
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. |
Definition at line 47 of file PressurePoint.cpp.
PressurePoint::~PressurePoint | ( | ) |
Destructor.
Definition at line 60 of file PressurePoint.cpp.
|
inline |
|
inline |
|
inline |
Returns origin of the PressurePoint.
Definition at line 108 of file PressurePoint.h.
|
inline |
|
inline |
float PressurePoint::getValue | ( | const float & | x, |
const float & | y | ||
) |
Get the especified x/y noise value.
x | X Coord |
y | Y Coord |
1st.- Calculate distance.
2nd.- Calculate time decay factors
2nd.- Calculate distance decay factors
3rd.- Calculate height
Definition at line 77 of file PressurePoint.cpp.
bool PressurePoint::update | ( | const Ogre::Real & | timeSinceLastFrame | ) |
Call it each frame.
timeSinceLastFrame | Time since last frame(delta) |
Definition at line 64 of file PressurePoint.cpp.
|
private |
Ampliutde.
Definition at line 142 of file PressurePoint.h.
|
private |
Speed (calculated)
Definition at line 146 of file PressurePoint.h.
|
private |
Dispersion factor.
Definition at line 144 of file PressurePoint.h.
|
private |
Time decay term.
Definition at line 150 of file PressurePoint.h.
|
private |
Distance decay term.
Definition at line 152 of file PressurePoint.h.
|
private |
Lenght.
Definition at line 140 of file PressurePoint.h.
|
private |
Pressure.
Definition at line 136 of file PressurePoint.h.
|
private |
Direction (must be normalised)
Definition at line 134 of file PressurePoint.h.
|
private |
Period.
Definition at line 138 of file PressurePoint.h.
|
private |
Elapsed time.
Definition at line 131 of file PressurePoint.h.
|
private |
Angular frec.
Definition at line 148 of file PressurePoint.h.