Triton
Visual simulation library for ocean rendering.
Simulating impacts on the water

You may also simulate the effects of impacts or explosions on the water, using the Triton::Impact class.

The size of the waves and spray resulting from the impact are a function of the energy of the impact, which is half of the impactor's mass times the square of its velocity.

For example, you might simulate a bullet of 20 grams hitting the water at 500 m/s with the following code:

Triton::Impact *impact = new Triton::Impact(ocean, 0.01, 20.0, true);
DWORD millis = timeGetTime();
impact->Trigger(Triton::Vector3(0, 100, 0), Triton::Vector3(0, -1, 0), 500.0, (double)millis * 0.001);
A RotorWash object will generate spray and circular waves on the ocean surface in the direction it is...
Definition: Impact.h:33
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.
A 3D double-precision Vector class and its operations.
Definition: Vector3.h:36

This will produce a small splash, with small ripples radiating from the impact. The 0.01 value in the Impact constructor specifies an object diameter of 1 cm, which will limit the radius of the splash effect.

Or, a torpedo hitting the water has a mass of about 260 kg and a velocity of 100 m/s:

Triton::Impact *impact = new Triton::Impact(ocean, 2.0, 260000.0, true);
DWORD millis = timeGetTime();
impact->Trigger(Triton::Vector3(0, 100, 0), Triton::Vector3(0, -1, 0), 100.0, (double)millis * 0.001);

This will produce a larger effect. See the documentation for Triton::Impact::Impact() and Triton::Impact::Trigger() for more details.