Triton
Visual simulation library for ocean rendering.
Public Member Functions

Triton::WakeGenerator Class Reference

A WakeGenerator represents an object on the water that generates a wake as it moves, such as a ship. More...

#include <WakeGenerator.h>

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

List of all members.

Public Member Functions

 WakeGenerator (Ocean *pOcean, bool pSprayEffects=false, double pSprayOffset=0.0, double pLength=100.0, double pBeamWidth=20.0)
 Construct a WakeGenerator 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 WakeGenerator, this should be called every frame to update its position and velocity.
Vector3 TRITONAPI GetPosition () const
 Retrieves the world position of the WakeGenerator.
double TRITONAPI GetVelocity () const
 Retrieves the velocity of the WakeGenerator.

Detailed Description

A WakeGenerator represents an object on the water that generates a wake as it moves, such as a ship.

Simply call Triton::WakeGenerator::Update() to move the object and generate a realistic wake behind it. Any WakeGenerator moving at constant velocity will generate a wake of 19.46 degrees behind it, but acceleration, deceleration, and curved paths are all handled properly as well.


Constructor & Destructor Documentation

Triton::WakeGenerator::WakeGenerator ( Ocean pOcean,
bool  pSprayEffects = false,
double  pSprayOffset = 0.0,
double  pLength = 100.0,
double  pBeamWidth = 20.0 
) [inline]

Construct a WakeGenerator with the same Triton::Ocean it will be associated with.

Parameters:
pOceanThe Triton::Ocean object you will associate this WakeGenerator with.
pSprayEffectsWhether you wish this wake to emit spray particles originating from this wake generator.
pSprayOffsetUse this to have spray particles emitted from a point different from where the wakes are generated from. This distance will be added to the current wake generator's position along the direction of travel. For example, if you want wakes to originate from the stern of a ship but have spray emitted from the bow, you would pass in the length of the ship for pSprayOffset, and update the WakeGenerator with the position of the stern each frame. Unused if pSprayEffects is false.
pLengthThe length of the object generating the wake.
pBeamWidthThe width of the object generating the wake.

Member Function Documentation

Vector3 TRITONAPI Triton::WakeGenerator::GetPosition ( ) const [inline]

Retrieves the world position of the WakeGenerator.

Returns:
The world position of the WakeGenerator, as last specified by Triton::WakeGenerator::Update().
double TRITONAPI Triton::WakeGenerator::GetVelocity ( ) const [inline]

Retrieves the velocity of the WakeGenerator.

Returns:
The velocity of the WakeGenerator in world units per second, as last specified by Triton::WakeGenerator::Update().
void TRITONAPI Triton::WakeGenerator::Update ( const Vector3 pPosition,
const Vector3 pDirection,
double  pVelocity,
double  pTime 
)

For any active WakeGenerator, 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 generating the wake, such as the stern of a ship, in world coordinates.
pDirectionA normalized direction vector indicating the direction this object is moving in.
pVelocityThe velocity of the object generating the wake, in world units per second.
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:
 All Classes Files Functions Variables Friends