Triton
Visual simulation library for ocean rendering.
|
A localized or global area of wind of given speed and direction. More...
#include <WindFetch.h>
Public Member Functions | |
WindFetch () | |
Default constructor. | |
void TRITONAPI | SetWind (double speed, double direction) |
Sets the wind speed and direction of this wind fetch. | |
void TRITONAPI | SetLocalization (const Vector3 ¢er, const Vector3 &radii) |
Sets a localized area, in the form of an ellipsoid, in which the wind fetch is active. | |
void TRITONAPI | SetFetchLength (double fetch) |
If using the JONSWAP model, swells will increase depending on the "fetch length," or the distance the wind has travelled. | |
void TRITONAPI | ClearLocalization () |
Clears any localization and makes this wind fetch globally applied. | |
void TRITONAPI | ClearFetchLength () |
Clears any explicit fetch length specified by SetFetchLength(). | |
void TRITONAPI | GetWindAtLocation (const Vector3 &position, double &windSpeed, double &windDirection, double &fetchLength) const |
Retrieves the wind direction and speed from this wind fetch at the given location. | |
A localized or global area of wind of given speed and direction.
void TRITONAPI Triton::WindFetch::ClearLocalization | ( | ) |
Clears any localization and makes this wind fetch globally applied.
void TRITONAPI Triton::WindFetch::GetWindAtLocation | ( | const Vector3 & | position, |
double & | windSpeed, | ||
double & | windDirection, | ||
double & | fetchLength | ||
) | const |
Retrieves the wind direction and speed from this wind fetch at the given location.
If the location specified is not included by the bounds of this wind fetch, or the wind fetch is not global, no wind will be returned.
position | The location at which you want to retrieve wind information from this fetch. |
windSpeed | The wind speed, in units per second, resulting from this fetch at the given position. |
windDirection | The direction of the wind, in radians, resulting from this fetch at the given position. Represents the direction the wind is coming from, clockwise from North. |
fetchLength | The distance the wind has travelled before reaching this position. Used only by the JONSWAP model. This will be based on distance from the fetch origin set with SetLocalization(), unless SetFetchLength() has been called which will take precedence. If neither SetLocalization() or SetFetchLength() has been called on this WindFetch, 0 will be returned and the JONSWAP model will switch to the PIERSON_MOSKOWITZ model. |
void TRITONAPI Triton::WindFetch::SetFetchLength | ( | double | fetch | ) |
If using the JONSWAP model, swells will increase depending on the "fetch length," or the distance the wind has travelled.
If you specified a fetch radius using SetLocalization(), this would normally be used to determine the fetch length. However, you may set an explicit fetch length (in world units) using this method, which will override SetLocalization() until ClearFetchLength() is called.
If you are not using the JONSWAP model, this value is ignored.
fetch | The distance the wind has travelled before reaching the observer. Typical values are on the order of 100km. |
Sets a localized area, in the form of an ellipsoid, in which the wind fetch is active.
If this method is not called, the wind fetch is assumed to be global. If using the JONSWAP model, the size of the fetch specified will be used to determine the fetch length. It's important that this is realistic; fetch lengths on the order of 100km will produce the results you probably expect - so the distance from the observer to the center of the ellipsoid defined by this method should be on that order.
The center represents the 'origin' of the wind, and the wind will only affect observers within the ellipsoid defined by the radii given.
center | The center of the ellipsoid that models the bounds of the wind fetch. |
radii | The radii in X, Y, and Z of the ellipsoid, in world units. |
void TRITONAPI Triton::WindFetch::SetWind | ( | double | speed, |
double | direction | ||
) |
Sets the wind speed and direction of this wind fetch.
speed | The wind speed in world units per second. Note, setting this in excess of our stated limits (up to Beaufort Scale 9 or appx 30 m/s, may result in numerical instability. |
direction | The wind direction, in radians clockwise from North. Note this is the direction the wind is coming from - the waves will move in the opposite direction. |