feat(cockpit): ride the selected vessel from its bridge

With no aircraft tracked, Cockpit can ride the selected AIS vessel. Entry
needs only Live AIS Vessels and a selected vessel; C, double-click and the
entry buttons (reading BRIDGE with a ship icon) enter it, while voice stays
aircraft-only.

The eye sits on the AIS position at a representative bridge height for the
vessel's type family, looks along true heading and moves along course over
ground. The last fix is dead-reckoned for up to 180 s between the layer's
refreshes, and on rivers and lakes the waterline is read from the rendered
surface around the ship rather than the geoid.

The bridge HUD shows speed and course over ground, a straight heading
tape, window mullions, the AIS destination as a reported voyage and a
heading-up radar of nearby ships (3 to 24 NM). The arrow keys look around,
Home or 0 looks ahead again. The vessel layer hides the ridden ship's
sprite and card, ignores scene clicks while held, and returns the camera
to the vessel's map view on exit.
This commit is contained in:
Denis Groshev committed 2026-11-07 19:52:30 +01:00
1 parent 52187c91d1
commit 72112ecb45
58 files changed
+5313 -137

No files matched your search

+24 -1
View File
@@ -34,7 +34,13 @@ export const useCockpitStore = defineStore('gev-cockpit', () => {
context.value = next && markRaw(next);
}
/** The presented instruments; null until the first HUD update. */
/**
* The presented instruments; null until the first HUD update. Besides the
* readouts, `look: { offset, yawDeg, readout }` says whether a bridge view
* is turned off the bow, the yaw it is turned to (degrees in -180..180,
* starboard positive; the radar draws its look line there) and the worded
* readout. An aircraft's look always rests (`offset: false`).
*/
const instruments = shallowRef(null);
/** @param {?object} next A fresh presentation of the instruments. */
@@ -66,6 +72,21 @@ export const useCockpitStore = defineStore('gev-cockpit', () => {
signals.value = next && markRaw(next);
}
/**
* The bridge radar: null outside a vessel bridge. Shape:
* `{ rangeNm, rangeLabel, ringsNm: number[], headingDeg,
* ownRelativeCourseDeg|null,
* contacts: [{ id, name, x, y, distanceNm, relativeBearingDeg,
* relativeCourseDeg|null, color, stale }] }` where x/y are heading-up
* screen fractions in [-1, 1] (x right, y up) of the range circle.
*/
const radar = shallowRef(null);
/** @param {?object} next A fresh presentation of the bridge radar. */
function publishRadar(next) {
radar.value = next && markRaw(next);
}
/**
* The utility strip's measured layout: its top and height limits as CSS
* lengths (null leaves the stylesheet's), whether only the expanded control
@@ -101,6 +122,8 @@ export const useCockpitStore = defineStore('gev-cockpit', () => {
publishVision,
signals,
publishSignals,
radar,
publishRadar,
utilityLayout,
publishUtilityLayout,
};