Triton
Visual simulation library for ocean rendering.
|
An static wake pointing in a given direction at a fixed location, for example from a buoy or bridge pile in a current. More...
#include <TidalStreamWake.h>
Public Member Functions | |
TidalStreamWake (Ocean *pOcean, double pSize, double pDraft, double pWaveMax=1.0, double pOffset=0, bool pUseDecals=true, bool pUseDisplacement=true) | |
Construct a TidalStreamWake with the same Triton::Ocean it will be associated with. | |
void TRITONAPI | Update (const Vector3 &pPosition, const Vector3 &pDirection, double pVelocity, double pTime) |
For any active TidalStreamWake, this should be called every frame to update its position and velocity. | |
An static wake pointing in a given direction at a fixed location, for example from a buoy or bridge pile in a current.
Triton::TidalStreamWake::TidalStreamWake | ( | Ocean * | pOcean, |
double | pSize, | ||
double | pDraft, | ||
double | pWaveMax = 1.0 , |
||
double | pOffset = 0 , |
||
bool | pUseDecals = true , |
||
bool | pUseDisplacement = true |
||
) |
Construct a TidalStreamWake with the same Triton::Ocean it will be associated with.
pOcean | The Triton::Ocean object you will associate this TidalStreamWake with. A common error is to create a TidalStreamWake before the Ocean is created, so make sure this is a valid, non-null pointer. |
pSize | The length of the wake generated. |
pDraft | The distance underwater this object extends. |
pWaveMax | The maximum wake wave amplitude generated by this object. |
pOffset | An offset from the object's position to the front of the wake wave. |
pUseDecals | Whether a decal texture should be applied over the wake for higher resolution appearance from above. |
pUseDisplacement | Whether the wake will displace the ocean surface in 3D or not. For very small tidal stream wakes, anomalies may result due to the limited resolution of the underlying water mesh. |
void TRITONAPI Triton::TidalStreamWake::Update | ( | const Vector3 & | pPosition, |
const Vector3 & | pDirection, | ||
double | pVelocity, | ||
double | pTime | ||
) |
For any active TidalStreamWake, this should be called every frame to update its position and velocity.
No wake will be generated until this is called.
pPosition | The position of the object producing the wake, in world coordinates. |
pDirection | A normalized direction vector indicating the direction of the current or tidal stream. |
pVelocity | The velocity of the current generating the wake, in meters per second. This will influence the height of the wake, up to the maximum amplitude specified in the constructor. |
pTime | The current simulated time sample, in seconds. This may be relative to any reference point in time, as long as that reference point is consistent among the multiple calls to Update(). |