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

A RotorWash object will generate spray and circular waves on the ocean surface in the direction it is pointing. More...

#include <Impact.h>

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

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.
 

Detailed Description

A RotorWash object will generate spray and circular waves on the ocean surface in the direction it is pointing.

Constructor & Destructor Documentation

◆ Impact()

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.

Parameters
pOceanThe 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.
pImpactorDiameterThe diameter of the disturbance in world units.
pMassThe mass of the impactor in grams
pSprayEffectsWhether you wish this impact to emit spray particles.
pSprayScaleA scaling factor applied to the initial velocity of spray particles.

Member Function Documentation

◆ GetPosition()

Vector3 TRITONAPI Triton::Impact::GetPosition ( ) const
inline

Retrieves the world position of the Impact.

Returns
The world position of the Impact, as last specified by Triton::Impact::Trigger().

◆ GetVelocity()

double TRITONAPI Triton::Impact::GetVelocity ( ) const
inline

Retrieves the velocity of the Impact.

Returns
The velocity of the Impact in world units per second, as last specified by Triton::Impact::Trigger().

◆ Trigger()

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.

Parameters
pPositionThe 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.
pDirectionA normalized direction vector indicating the direction the impact is pointing toward.
pVelocityThe velocity of the object producing the impact, in meters 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 Trigger().

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