Triton
Visual simulation library for ocean rendering.
|
A RotorWash object will generate spray and circular waves on the ocean surface in the direction it is pointing. More...
#include <Impact.h>
Public Member Functions | |
Impact (Ocean *pOcean, double pImpactorDiameter, double pMass, bool pSprayEffects=false, double pSprayScale=2.0) | |
Construct a Impact with the Triton::Ocean it will be associated with. | |
void TRITONAPI | Trigger (const Vector3 &pPosition, const Vector3 &pDirection, double pVelocity, double pTime) |
Starts the effect of an impact at a given position, direction, and velocity. | |
Vector3 TRITONAPI | GetPosition () const |
Retrieves the world position of the Impact. | |
double TRITONAPI | GetVelocity () const |
Retrieves the velocity of the Impact. | |
A RotorWash object will generate spray and circular waves on the ocean surface in the direction it is pointing.
Triton::Impact::Impact | ( | Ocean * | pOcean, |
double | pImpactorDiameter, | ||
double | pMass, | ||
bool | pSprayEffects = false , |
||
double | pSprayScale = 2.0 |
||
) |
Construct a Impact with the Triton::Ocean it will be associated with.
pOcean | The Triton::Ocean object you will associate this Impact with. A common error is to create an Impact before the ocean has been initialized, so make sure this is a valid, non-NULL ocean pointer. |
pImpactorDiameter | The diameter of the disturbance in world units. |
pMass | The mass of the impactor in grams |
pSprayEffects | Whether you wish this impact to emit spray particles. |
pSprayScale | A scaling factor applied to the initial velocity of spray particles. |
|
inline |
Retrieves the world position of the Impact.
|
inline |
Retrieves the velocity of the Impact.
void TRITONAPI Triton::Impact::Trigger | ( | const Vector3 & | pPosition, |
const Vector3 & | pDirection, | ||
double | pVelocity, | ||
double | pTime | ||
) |
Starts the effect of an impact at a given position, direction, and velocity.
No impact will be generated until this is called.
pPosition | The position of the impact, in world coordinates. This should be above sea level; a ray cast using the pDirection parameter will be used to find the exact point on the water surface for the effect. |
pDirection | A normalized direction vector indicating the direction the impact is pointing toward. |
pVelocity | The velocity of the object producing the impact, in meters 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 Trigger(). |