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

A wave defined by the direction, amplitude, period, and optionally phase. More...

#include <Noise/Wave/Wave.h>

Public Member Functions

 Wave (Ogre::Vector2 dir, float A, float T, float p=0.f)
 Default constructor. More...
 
 ~Wave ()
 Destructor. More...
 
void 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 getDirection () const
 Returns direction of the wave. More...
 
float getAmplitude () const
 Returns amplitude of the wave. More...
 
float getPeriod () const
 Returns period of the wave. More...
 
float getPhase () const
 Returns phase of the wave. More...
 
float getSpeed () const
 Returns phase speed of the wave. More...
 
float getLongitude () const
 Returns longitude of the wave. More...
 

Private Attributes

double mTime
 Elapsed time. More...
 
Ogre::Vector2 mDir
 Direction (must be normalised) More...
 
float mA
 Amplitude. More...
 
float mT
 Period. More...
 
float mP
 Phase. More...
 
float mC
 Speed (calculated) More...
 
float mL
 Longitude (calculated) More...
 
float mF
 Angular frec. More...
 
float mK
 Dispersion factor. More...
 

Detailed Description

A wave defined by the direction, amplitude, period, and optionally phase.

Definition at line 59 of file Wave.h.

Constructor & Destructor Documentation

◆ Wave()

Wave::Wave ( Ogre::Vector2  dir,
float  A,
float  T,
float  p = 0.f 
)

Default constructor.

Parameters
dirDirection of the wave.
AAmplitude of the wave (m).
TPeriod of the wave (s).
pPhase of the wave (rad).

Definition at line 38 of file Wave.cpp.

◆ ~Wave()

Wave::~Wave ( )

Destructor.

Definition at line 52 of file Wave.cpp.

Member Function Documentation

◆ getAmplitude()

float Hydrax::Noise::Wave::getAmplitude ( ) const
inline

Returns amplitude of the wave.

Returns
Amplitude.

Definition at line 94 of file Wave.h.

◆ getDirection()

Ogre::Vector2 Hydrax::Noise::Wave::getDirection ( ) const
inline

Returns direction of the wave.

Returns
Direction.

Definition at line 90 of file Wave.h.

◆ getLongitude()

float Hydrax::Noise::Wave::getLongitude ( ) const
inline

Returns longitude of the wave.

Returns
Wave longitude.

Definition at line 110 of file Wave.h.

◆ getPeriod()

float Hydrax::Noise::Wave::getPeriod ( ) const
inline

Returns period of the wave.

Returns
Period.

Definition at line 98 of file Wave.h.

◆ getPhase()

float Hydrax::Noise::Wave::getPhase ( ) const
inline

Returns phase of the wave.

Returns
Phase.

Definition at line 102 of file Wave.h.

◆ getSpeed()

float Hydrax::Noise::Wave::getSpeed ( ) const
inline

Returns phase speed of the wave.

Returns
Phase speed.

Definition at line 106 of file Wave.h.

◆ getValue()

float Wave::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]

Definition at line 61 of file Wave.cpp.

◆ update()

void Wave::update ( const Ogre::Real &  timeSinceLastFrame)

Call it each frame.

Parameters
timeSinceLastFrameTime since last frame(delta)

Definition at line 56 of file Wave.cpp.

Field Documentation

◆ mA

float Hydrax::Noise::Wave::mA
private

Amplitude.

Definition at line 122 of file Wave.h.

◆ mC

float Hydrax::Noise::Wave::mC
private

Speed (calculated)

Definition at line 128 of file Wave.h.

◆ mDir

Ogre::Vector2 Hydrax::Noise::Wave::mDir
private

Direction (must be normalised)

Definition at line 120 of file Wave.h.

◆ mF

float Hydrax::Noise::Wave::mF
private

Angular frec.

Definition at line 132 of file Wave.h.

◆ mK

float Hydrax::Noise::Wave::mK
private

Dispersion factor.

Definition at line 134 of file Wave.h.

◆ mL

float Hydrax::Noise::Wave::mL
private

Longitude (calculated)

Definition at line 130 of file Wave.h.

◆ mP

float Hydrax::Noise::Wave::mP
private

Phase.

Definition at line 126 of file Wave.h.

◆ mT

float Hydrax::Noise::Wave::mT
private

Period.

Definition at line 124 of file Wave.h.

◆ mTime

double Hydrax::Noise::Wave::mTime
private

Elapsed time.

Definition at line 117 of file Wave.h.


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