Triton
Visual simulation library for ocean rendering.
Public Member Functions | List of all members
Triton::WindFetch Class Reference

A localized or global area of wind of given speed and direction. More...

#include <WindFetch.h>

Inheritance diagram for Triton::WindFetch:
Inheritance graph
[legend]
Collaboration diagram for Triton::WindFetch:
Collaboration graph
[legend]

Public Member Functions

 WindFetch ()
 Default constructor. More...
 
void TRITONAPI SetWind (double speed, double direction)
 Sets the wind speed and direction of this wind fetch. More...
 
void TRITONAPI SetLocalization (const Vector3 &center, const Vector3 &radii)
 Sets a localized area, in the form of an ellipsoid, in which the wind fetch is active. More...
 
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. More...
 
void TRITONAPI ClearLocalization ()
 Clears any localization and makes this wind fetch globally applied. More...
 
void TRITONAPI ClearFetchLength ()
 Clears any explicit fetch length specified by SetFetchLength(). More...
 
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. More...
 

Detailed Description

A localized or global area of wind of given speed and direction.

Constructor & Destructor Documentation

◆ WindFetch()

Triton::WindFetch::WindFetch ( )

Default constructor.

Member Function Documentation

◆ ClearFetchLength()

void TRITONAPI Triton::WindFetch::ClearFetchLength ( )

Clears any explicit fetch length specified by SetFetchLength().

◆ ClearLocalization()

void TRITONAPI Triton::WindFetch::ClearLocalization ( )

Clears any localization and makes this wind fetch globally applied.

See also
SetLocalization()

◆ GetWindAtLocation()

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.

Parameters
positionThe location at which you want to retrieve wind information from this fetch.
windSpeedThe wind speed, in units per second, resulting from this fetch at the given position.
windDirectionThe 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.
fetchLengthThe 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.

◆ SetFetchLength()

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.

See also
ClearFetchLength()
Parameters
fetchThe distance the wind has travelled before reaching the observer. Typical values are on the order of 100km.

◆ SetLocalization()

void TRITONAPI Triton::WindFetch::SetLocalization ( const Vector3 center,
const Vector3 radii 
)

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.

See also
ClearLocalization()
SetFetchLength()
Parameters
centerThe center of the ellipsoid that models the bounds of the wind fetch.
radiiThe radii in X, Y, and Z of the ellipsoid, in world units.

◆ SetWind()

void TRITONAPI Triton::WindFetch::SetWind ( double  speed,
double  direction 
)

Sets the wind speed and direction of this wind fetch.

Parameters
speedThe wind speed in world units per second.
directionThe 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.

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