|
Triton
Visual simulation library for ocean rendering.
|
A WakeGenerator represents an object on the water that generates a wake as it moves, such as a ship. More...
#include <WakeGenerator.h>


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. | |
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.
| 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.
| pOcean | The Triton::Ocean object you will associate this WakeGenerator with. |
| pSprayEffects | Whether you wish this wake to emit spray particles originating from this wake generator. |
| pSprayOffset | Use 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. |
| pLength | The length of the object generating the wake. |
| pBeamWidth | The width of the object generating the wake. |
| Vector3 TRITONAPI Triton::WakeGenerator::GetPosition | ( | ) | const [inline] |
Retrieves the world position of the WakeGenerator.
| double TRITONAPI Triton::WakeGenerator::GetVelocity | ( | ) | const [inline] |
Retrieves the velocity of the WakeGenerator.
| 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.
| pPosition | The position of the object generating the wake, such as the stern of a ship, in world coordinates. |
| pDirection | A normalized direction vector indicating the direction this object is moving in. |
| pVelocity | The velocity of the object generating the wake, in world units per second. |
| 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(). |
1.7.3