54 void Record(
double t,
double north,
double east,
double velocityNorth,
double velocityEast,
double heading = std::numeric_limits<double>::quiet_NaN());
63 double Trim()
const {
return m_trim; }
69 void SetSampler(std::function<
void(
double,
const double*)> sampler) { m_sampler = std::move(sampler); }
71 void Refresh(
double T,
const double* X)
const
76 double Lambda()
const {
return m_lambda; }
78 const SurfaceWakeHull& Hull()
const {
return m_hull; }
80 double North()
const {
return m_north; }
81 double East()
const {
return m_east; }
82 double Heading()
const {
return m_heading; }
83 double Speed()
const {
return m_speed; }
84 double Time()
const {
return m_time; }
88 const std::deque<Sample>&
Track()
const {
return m_track; }
92 std::deque<Sample> m_track;
96 double m_heading = 0.0;
98 std::function<void(
double,
const double*)> m_sampler;
100 double m_lambda = 0.0;
101 bool m_started =
false;
108 void Add(std::shared_ptr<SurfaceWakeEmitter> emitter) { m_emitters.push_back(std::move(emitter)); }
109 const std::vector<std::shared_ptr<SurfaceWakeEmitter>>& Emitters()
const {
return m_emitters; }
112 std::vector<std::shared_ptr<SurfaceWakeEmitter>> m_emitters;
136 static constexpr int kWakeTexels = 64;
137 static constexpr int kMaxWakes = 8;
138 static constexpr int kPlaningTexel = kWakeTexels - 1;
139 static constexpr int kMaxPoints = kWakeTexels - 5;
Definition SurfaceWakes.h:35
void SetSampler(std::function< void(double, const double *)> sampler)
Definition SurfaceWakes.h:69
double YawRate() const
Rate of turn [rad/s] over the last few seconds.
const std::deque< Sample > & Track() const
The track, oldest first (the last one is the latest record).
Definition SurfaceWakes.h:88
void Refresh(double T, const double *X) const
Record the vessel at (T, X) with the sampler, if any (a repeated T replaces the last record).
Definition SurfaceWakes.h:71
void SetPlaning(double trim, double lambda)
Definition SurfaceWakes.h:58
void Record(double t, double north, double east, double velocityNorth, double velocityEast, double heading=std::numeric_limits< double >::quiet_NaN())
double North() const
The vessel now: origin (north, east), heading [rad], speed [m/s].
Definition SurfaceWakes.h:80
The vessels with a surface wake, shared by the Environment (which draws them) and the SurfaceWake Sim...
Definition SurfaceWakes.h:106
Definition FlukeAnchor.h:124
constexpr const char * kSurfaceWakeResource
Name of the shared resource (ISimObjectCreator::SetSharedResource) of the registry.
Definition SurfaceWakes.h:116
A recorded point of the track.
Definition SurfaceWakes.h:39
double t
simulation time [s]
Definition SurfaceWakes.h:40
double speed
speed over ground [m/s]
Definition SurfaceWakes.h:43
double north
stern position [m]
Definition SurfaceWakes.h:41
double heading
[rad]
Definition SurfaceWakes.h:44
Definition SurfaceWakes.h:17
double duration
How long the trail lasts [s].
Definition SurfaceWakes.h:25
double bowOffset
Bow ahead of the vessel's origin [m]: the Kelvin pattern starts there.
Definition SurfaceWakes.h:21
double chineBeam
Chine beam b [m] (planing).
Definition SurfaceWakes.h:28
bool planing
A planing hull whose trim and wetted length are recorded (SetPlaning).
Definition SurfaceWakes.h:27
double deadrise
Deadrise at the transom [rad] (planing).
Definition SurfaceWakes.h:29
double beam
Beam B [m].
Definition SurfaceWakes.h:19
double foam
Strength of the foam (0: none).
Definition SurfaceWakes.h:23
double propellerOffset
Propellers (stern) relative to the origin, positive forward [m]: the trail starts there.
Definition SurfaceWakes.h:22
double transomOffset
Transom relative to the origin, positive forward [m] (the planing wake).
Definition SurfaceWakes.h:26
double draught
Draught T [m]: scales the wave height.
Definition SurfaceWakes.h:20
double waveScale
Scale of the wave height (0: no Kelvin waves).
Definition SurfaceWakes.h:24
double length
Waterline length L [m].
Definition SurfaceWakes.h:18
Definition SurfaceWakes.h:135
static SurfaceWakeTexture Pack(const SurfaceWakeRegistry ®istry)
Pack the registry's vessels (the first kMaxWakes) at their latest record.
std::vector< float > texels
rows * kWakeTexels * 4 floats, row-major.
Definition SurfaceWakes.h:142
int count
Vessels packed (rows used).
Definition SurfaceWakes.h:144