FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
environment::SurfaceWakeTexture Struct Reference

#include <SurfaceWakes.h>

Static Public Member Functions

static SurfaceWakeTexture Pack (const SurfaceWakeRegistry &registry)
 Pack the registry's vessels (the first kMaxWakes) at their latest record.
 

Public Attributes

std::vector< float > texels
 rows * kWakeTexels * 4 floats, row-major.
 
int count = 0
 Vessels packed (rows used).
 

Static Public Attributes

static constexpr int kWakeTexels = 64
 
static constexpr int kMaxWakes = 8
 
static constexpr int kPlaningTexel = kWakeTexels - 1
 
static constexpr int kMaxPoints = kWakeTexels - 5
 

Detailed Description

The wakes as the ocean shader reads them (OceanSurface/Pbr/wake.h): one row of kWakeTexels RGBA float texels per vessel, at most kMaxWakes rows.

texel contents
0 origin north, east [m], heading [rad], speed [m/s]
1 length, beam, draught [m], wave scale
2 bounding circle: centre north, east, radius [m]; number of track points n
3 bow offset [m], Kelvin range [m] (0: no waves), foam strength, transom offset [m]
4 .. 4 + n - 1 track points from the stern now backwards, closer near the stern (about 0.5 s apart there, 6 s at the trail's end): north, east, half width [m], foam + 1024 calm (each in 0..1000)

| kPlaningTexel (63) | planing: trim [rad], mean wetted length over chine beam lambda (0: not planing), chine beam [m], deadrise [rad] |

The Kelvin range is the shorter of 25 L and 40 wavelengths 2 pi U^2 / g, measured along the vessel's path: the shader takes the waves in path coordinates (distance behind the bow along the track, offset across it), so the arms bend with a turn.


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