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

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>

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

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.
 

Detailed Description

An static wake pointing in a given direction at a fixed location, for example from a buoy or bridge pile in a current.

Constructor & Destructor Documentation

◆ TidalStreamWake()

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.

Parameters
pOceanThe 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.
pSizeThe length of the wake generated.
pDraftThe distance underwater this object extends.
pWaveMaxThe maximum wake wave amplitude generated by this object.
pOffsetAn offset from the object's position to the front of the wake wave.
pUseDecalsWhether a decal texture should be applied over the wake for higher resolution appearance from above.
pUseDisplacementWhether 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.

Member Function Documentation

◆ Update()

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.

Parameters
pPositionThe position of the object producing the wake, in world coordinates.
pDirectionA normalized direction vector indicating the direction of the current or tidal stream.
pVelocityThe 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.
pTimeThe 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().

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