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

+142
View File
@@ -0,0 +1,142 @@
/**
* The selected vessel as a Cockpit bridge subject: identity, motion, its
* displayed type and a representative bridge eye height from the AIS type.
* The Cockpit owns camera placement; this module owns what AIS says.
*/
import { normalizeVesselType } from '../../data/vesselTypes.js';
import { displayVesselType } from '../../data/vesselLabels.js';
/** The layer id a vessel subject carries through Cockpit events and state. */
export const VESSEL_COCKPIT_LAYER_ID = 'ais-live-vessels';
/** Knots to metres per second, as the AIS source uses. */
const KNOTS_TO_MPS = 0.514444;
/**
* Bridge eye height above the waterline by normalized AIS type family. AIS
* reports no hull height, so these are representative values: deep-sea
* cargo and tanker bridges, passenger and cruise ship bridges, harbour
* craft, small craft. River and harbour ferries, matched by name in the
* patterns below, sit low. Text types from non-numeric feeds fall through
* to the patterns.
*/
const EYE_HEIGHT_BY_FAMILY = Object.freeze({
CARGO: 30,
TANKER: 30,
PASSENGER: 25,
MILITARY: 18,
'HIGH-SPEED': 8,
DREDGER: 10,
TOWING: 7,
TUG: 7,
PILOT: 6,
SAR: 6,
'PORT TENDER': 6,
'ANTI-POLLUTION': 7,
'LAW ENFORCE': 7,
MEDICAL: 7,
'DIVE OPS': 5,
FISHING: 6,
SAILING: 3,
PLEASURE: 3,
// AIS "Other" (90-99) is mostly small craft such as river boats. Only
// that type takes it (see isAisOther).
OTHER: 4,
});
const EYE_HEIGHT_PATTERNS = Object.freeze([
{ pattern: /tanker|cargo|container|bulk|carrier/i, heightM: 30 },
{ pattern: /passenger|cruise|ro-?ro/i, heightM: 25 },
// River and harbour ferries: a low wheelhouse just above the water.
{ pattern: /ferry/i, heightM: 4 },
{ pattern: /tug|tow|pilot|supply|service/i, heightM: 7 },
{ pattern: /fishing|trawler/i, heightM: 6 },
{ pattern: /sail|pleasure|yacht/i, heightM: 3 },
]);
/**
* Whether a raw type is AIS "Other" proper: codes 90 to 99, or a feed's text
* type. normalizeVesselType also files the reserved, wing-in-ground and
* spare codes (1-29, 38-39, 56-57, 59) under OTHER, but they name no family.
*/
function isAisOther(type) {
const text = String(type ?? '').trim();
if (!/^\d+$/.test(text)) return true;
const code = Number(text);
return code >= 90 && code <= 99;
}
/**
* Representative bridge eye height for an AIS vessel type.
* @param {string|number} type Raw AIS type: a numeric code or feed text.
* @returns {number|null} Metres above the waterline, or null when the type
* names no known family (the Cockpit then uses its default).
*/
export function vesselEyeHeightM(type) {
const family = normalizeVesselType(type).toUpperCase();
if (family === 'OTHER' && !isAisOther(type)) return null;
if (Object.hasOwn(EYE_HEIGHT_BY_FAMILY, family))
return EYE_HEIGHT_BY_FAMILY[family];
const matched = EYE_HEIGHT_PATTERNS.find((entry) =>
entry.pattern.test(family),
);
return matched ? matched.heightM : null;
}
function finiteOrNull(value) {
if (value === null || value === undefined || value === '') return null;
const number = Number(value);
return Number.isFinite(number) ? number : null;
}
/**
* Normalize a selected vessel record into Cockpit subject info.
*
* `track` is where the camera looks and `motionCourse` is where the hull
* moves: a ship faces its true heading while current and wind set it along
* its course over ground. Either falls back to the other when one is missing.
* @param {object|null} record Vessel record from the vessel layer.
* @returns {object|null} Subject info, or null without a usable fix.
*/
export function vesselCockpitInfo(record) {
if (!record?.mmsi) return null;
const latitude = Number(record.lat);
const longitude = Number(record.lon);
if (!Number.isFinite(latitude) || !Number.isFinite(longitude)) return null;
const heading = finiteOrNull(record.heading);
const course = finiteOrNull(record.course);
const speedKt = finiteOrNull(record.speed);
const epochSec = finiteOrNull(record.lastPositionEpoch);
const feedEpochSec = finiteOrNull(record.fixFeedEpoch);
return {
kind: 'vessel',
layerId: VESSEL_COCKPIT_LAYER_ID,
id: String(record.mmsi),
mmsi: String(record.mmsi),
name: String(record.name || record.mmsi),
type: String(record.type || ''),
typeLabel: displayVesselType(record.type),
destination: String(record.destination || '').trim(),
latitude,
longitude,
heading,
course,
speedKt,
velocityMps: speedKt === null ? null : Math.max(0, speedKt) * KNOTS_TO_MPS,
track: heading ?? course,
// What `track` is: the true heading, or course over ground standing in
// for a ship that reports none. The HUD says which.
trackSource:
heading !== null ? 'heading' : course !== null ? 'course' : null,
motionCourse: course ?? heading,
fixEpochMs: epochSec === null ? null : epochSec * 1000,
// When this client first received the fix (its own clock) and the
// newest fix in that refresh (the feed's clock): the fix's age without
// clock skew, still ageing while the feed re-serves it.
receivedAtMs: finiteOrNull(record.fixReceivedAtMs),
feedEpochMs: feedEpochSec === null ? null : feedEpochSec * 1000,
eyeHeightM: vesselEyeHeightM(record.type),
stale: (record.missedRefreshes || 0) > 0,
onGround: false,
};
}
+113
View File
@@ -0,0 +1,113 @@
// src/layers/vessels/cockpitSubject.test.mjs — bridge eye heights by AIS
// type and the selected vessel as Cockpit subject info.
import test from 'node:test';
import assert from 'node:assert/strict';
import {
VESSEL_COCKPIT_LAYER_ID,
vesselCockpitInfo,
vesselEyeHeightM,
} from './cockpitSubject.js';
test('bridge eye height follows the AIS type family', () => {
assert.equal(vesselEyeHeightM('71'), 30, 'cargo');
assert.equal(vesselEyeHeightM('84'), 30, 'tanker');
assert.equal(vesselEyeHeightM('60'), 25, 'passenger');
assert.equal(vesselEyeHeightM('52'), 7, 'tug');
assert.equal(vesselEyeHeightM('30'), 6, 'fishing');
assert.equal(vesselEyeHeightM('37'), 3, 'pleasure');
assert.equal(vesselEyeHeightM('36'), 3, 'sailing');
});
test('text vessel types resolve through the same families', () => {
assert.equal(vesselEyeHeightM('Container Ship'), 30);
assert.equal(vesselEyeHeightM('Cruise ship'), 25);
assert.equal(vesselEyeHeightM('Ferry'), 4);
assert.equal(vesselEyeHeightM(99), 4, 'AIS Other');
assert.equal(vesselEyeHeightM('90'), 4, 'AIS Other');
assert.equal(vesselEyeHeightM('Other'), 4, 'a feed text type Other');
assert.equal(vesselEyeHeightM('Yacht'), 3);
});
test('codes filed under OTHER that are not AIS Other keep the default', () => {
// Reserved (1-19), wing in ground (20-29), reserved (38-39), spare
// (56-57) and local (59) codes name no family.
for (const type of ['1', '19', '20', '29', '38', '39', '56', '57', '59'])
assert.equal(vesselEyeHeightM(type), null, type);
});
test('an unknown or missing type has no eye height of its own', () => {
for (const type of ['', '0', '255', 'Research vessel', null]) {
assert.equal(vesselEyeHeightM(type), null, String(type));
}
});
test('vessel info faces the true heading and moves along course over ground', () => {
const info = vesselCockpitInfo({
mmsi: '211000000',
name: 'NORDIC STAR',
type: '70',
destination: ' KIEL ',
lat: 54.5,
lon: 10.2,
speed: 12,
course: 95,
heading: 90,
lastPositionEpoch: 1_700_000_000,
missedRefreshes: 0,
});
assert.equal(info.kind, 'vessel');
assert.equal(info.layerId, VESSEL_COCKPIT_LAYER_ID);
assert.equal(info.id, '211000000');
assert.equal(info.typeLabel, 'CARGO');
assert.equal(info.track, 90);
assert.equal(info.motionCourse, 95);
assert.equal(info.destination, 'KIEL');
assert.equal(info.eyeHeightM, 30);
assert.equal(info.fixEpochMs, 1_700_000_000_000);
assert.ok(Math.abs(info.velocityMps - 12 * 0.514444) < 1e-9);
assert.equal(info.stale, false);
assert.equal(info.onGround, false);
});
test('a missing heading or course falls back to the other', () => {
const base = { mmsi: '1', lat: 1, lon: 1, speed: 3 };
assert.equal(vesselCockpitInfo({ ...base, course: 40 }).track, 40);
assert.equal(vesselCockpitInfo({ ...base, heading: 50 }).motionCourse, 50);
const neither = vesselCockpitInfo(base);
assert.equal(neither.track, null);
assert.equal(neither.motionCourse, null);
});
test('the subject says whether its track is the heading or the course', () => {
const base = { mmsi: '1', lat: 1, lon: 1, speed: 3 };
assert.equal(
vesselCockpitInfo({ ...base, heading: 50, course: 40 }).trackSource,
'heading',
);
assert.equal(
vesselCockpitInfo({ ...base, course: 40 }).trackSource,
'course',
);
// A heading of 0 is due north, not a missing heading.
assert.equal(
vesselCockpitInfo({ ...base, heading: 0 }).trackSource,
'heading',
);
assert.equal(vesselCockpitInfo(base).trackSource, null);
});
test('a vessel without identity or position is not a subject', () => {
assert.equal(vesselCockpitInfo(null), null);
assert.equal(vesselCockpitInfo({ lat: 1, lon: 1 }), null);
assert.equal(vesselCockpitInfo({ mmsi: '1', lat: 'x', lon: 1 }), null);
});
test('a vessel missing from recent refreshes reads as stale', () => {
const info = vesselCockpitInfo({
mmsi: '1',
lat: 1,
lon: 1,
missedRefreshes: 2,
});
assert.equal(info.stale, true);
});
+102
View File
@@ -1,5 +1,8 @@
import * as Cesium from 'cesium';
import { t, msg } from '../../i18n/index.js';
import { vesselCockpitInfo } from './cockpitSubject.js';
import { vesselTypeCss } from '../../data/vesselLabels.js';
import { greatCircleMeters } from '../../geoDistance.js';
// ingestion.js is a portable export (package.json) and writes English labels
// into state; translate the known ones here, pass anything else through.
@@ -20,6 +23,7 @@ import {
AIS_STATUS_REASON,
REFRESH_MS,
FOCUS_EVIDENCE_DEV,
VESSEL_LIFT_M,
} from './policy.js';
export function createQueries({
@@ -346,6 +350,58 @@ export function createQueries({
return entries.slice(0, cap);
},
/**
* Vessels around a point for the Cockpit bridge radar, nearest first.
* The ship whose bridge the Cockpit occupies is left out. Distances are
* great-circle from the AIS positions, so no rendered visual is needed.
* @param {number} lat Latitude of the centre, degrees.
* @param {number} lon Longitude of the centre, degrees.
* @param {number} rangeM Max distance in metres.
* @param {number} [maxCount=60] Maximum entries to return.
* @returns {Array<{ id: string, name: string, latitude: number,
* longitude: number, course: number|null, heading: number|null,
* type: string, color: string, stale: boolean }>} Empty while the
* layer is off.
*/
getRadarContacts(lat, lon, rangeM, maxCount = 60) {
const records = state.records.all;
if (!state.feed.enabled || !Array.isArray(records) || !records.length)
return [];
if (!Number.isFinite(rangeM) || rangeM <= 0) return [];
const cap =
Number.isFinite(maxCount) && maxCount > 0 ? Math.floor(maxCount) : 60;
const center = { lat, lon };
const subject = state.cockpitSubjectMmsi;
const finite = (value) => {
if (value === null || value === undefined || value === '') return null;
const number = Number(value);
return Number.isFinite(number) ? number : null;
};
const entries = [];
for (const record of records) {
if (subject && String(record.mmsi) === subject) continue;
const distanceM = greatCircleMeters(center, {
lat: record.lat,
lon: record.lon,
});
if (!(distanceM <= rangeM)) continue;
entries.push({ record, distanceM });
}
entries.sort((a, b) => a.distanceM - b.distanceM);
return entries.slice(0, cap).map(({ record }) => ({
id: String(record.mmsi),
name: String(record.name || record.mmsi),
latitude: record.lat,
longitude: record.lon,
course: finite(record.course),
heading: finite(record.heading),
type: String(record.type || ''),
color: vesselTypeCss(record.type),
stale: (record.missedRefreshes || 0) > 0,
}));
},
/**
* Get positions of all currently loaded vessels.
* @param {number} [maxCount=800] Maximum entries to return.
@@ -462,6 +518,52 @@ export function createQueries({
};
},
/**
* Describe the selected vessel for the Cockpit bridge view.
* @returns {object|null} `vesselCockpitInfo` fields plus `seaSurfaceHeightM`
* (the local geoid height the sprite datum uses) and `markHeightM` (the
* height the sprite is drawn at), or null when the layer is off or
* nothing is selected.
*/
getCockpitSubject() {
if (!state.feed.enabled) return null;
const info = vesselCockpitInfo(state.selectedRecord);
if (!info) return null;
const geoidN = components.tracking.currentGeoidN(
info.latitude,
info.longitude,
);
return {
...info,
seaSurfaceHeightM: vesselDatumHeightM(geoidN, 0),
markHeightM: vesselDatumHeightM(geoidN, VESSEL_LIFT_M),
};
},
/**
* Mark the vessel whose bridge the Cockpit camera occupies, or release it.
* Its sprite, card and detection bracket stay hidden while it is held.
* @param {string|number|null} mmsi Subject MMSI, or null to release.
* @returns {boolean} Always true.
*/
setCockpitSubject(mmsi) {
const next = normalizeSelectionMmsi(mmsi);
if (state.cockpitSubjectMmsi === next) return true;
state.cockpitSubjectMmsi = next;
components.rendering.updateVisibility(true);
return true;
},
/**
* Return the camera to the selected vessel's map view, as a click on it does.
* @returns {boolean} True when a selected vessel took the camera.
*/
focusSelectedVessel() {
const record = state.selectedRecord;
if (!record || !state.feed.enabled) return false;
return components.selection.selectAndFocusVessel(record);
},
/**
* Return a subset of vessels for the universal detection overlay.
* Deterministic stride sampling distributes selections evenly across the
+118
View File
@@ -0,0 +1,118 @@
// src/layers/vessels/radarContacts.test.mjs — the vessels the Cockpit bridge
// radar draws: within range, nearest first, without the ship it rides.
import test from 'node:test';
import assert from 'node:assert/strict';
import { createVesselLayer } from './index.js';
import { vesselTypeCss } from '../../data/vesselLabels.js';
const noop = () => {};
function services() {
return {
context: {
clearSelectedEntityContextForLayer: noop,
registerEntityContext: () => null,
},
trails: {
createTrail: () => ({ setPositions: noop, clear: noop, destroy: noop }),
},
labels: {},
picking: { unregisterPickOwner: noop },
overlay: {
setOverlayEntries: noop,
setOverlaySourceVisible: noop,
clearOverlaySource: noop,
},
geoid: {},
sprites: {},
focus: {
focusNowMs: (now) => now,
getFocusTarget: () => null,
focusPassIsNeeded: () => false,
forgetSpriteFocus: noop,
},
worldFocus: {},
render: {
holdContinuousRender: noop,
releaseContinuousRender: noop,
governorRequestRender: noop,
},
};
}
/** A vessel `northNm` nautical miles north of 54.5°N 10.2°E. */
function record(mmsi, northNm, extra = {}) {
return {
mmsi,
name: `SHIP ${mmsi}`,
type: '70',
lat: 54.5 + northNm / 60,
lon: 10.2,
speed: 10,
course: 45,
heading: 40,
missedRefreshes: 0,
...extra,
};
}
function layerWith(records, options = {}) {
const layer = createVesselLayer({
source: { getSnapshot: noop },
services: services(),
});
layer.testing._setVesselStateForTest({
viewer: {},
records,
billboardCollection: { add: (entry) => ({ ...entry }), remove: noop },
...options,
});
return layer;
}
test('radar contacts are within range, nearest first and capped', () => {
const layer = layerWith([
record('3', 5),
record('1', 1),
record('far', 20),
record('2', 3, { course: null, heading: '', missedRefreshes: 2 }),
]);
const contacts = layer.getRadarContacts(54.5, 10.2, 6 * 1852, 60);
assert.deepEqual(
contacts.map((entry) => entry.id),
['1', '2', '3'],
);
assert.deepEqual(contacts[0], {
id: '1',
name: 'SHIP 1',
latitude: 54.5 + 1 / 60,
longitude: 10.2,
course: 45,
heading: 40,
type: '70',
color: vesselTypeCss('70'),
stale: false,
});
assert.equal(contacts[1].course, null);
assert.equal(contacts[1].heading, null);
assert.equal(contacts[1].stale, true);
assert.deepEqual(
layer.getRadarContacts(54.5, 10.2, 6 * 1852, 2).map((entry) => entry.id),
['1', '2'],
);
});
test('the ship whose bridge the Cockpit rides is not its own contact', () => {
const layer = layerWith([record('own', 0), record('other', 2)]);
layer.setCockpitSubject('own');
assert.deepEqual(
layer.getRadarContacts(54.5, 10.2, 6 * 1852).map((entry) => entry.id),
['other'],
);
layer.setCockpitSubject(null);
assert.equal(layer.getRadarContacts(54.5, 10.2, 6 * 1852).length, 2);
});
test('a disabled layer has no radar contacts', () => {
const layer = layerWith([record('1', 1)], { enabled: false });
assert.deepEqual(layer.getRadarContacts(54.5, 10.2, 6 * 1852), []);
});
+31
View File
@@ -26,6 +26,18 @@ export function normalizeVessel(row) {
};
}
/**
* Note when a fix was first received (`fixReceivedAtMs`, this client's
* clock) and the newest fix in that refresh (`fixFeedEpoch`, the feed's
* clock): its age is then read on each clock separately, so neither a
* skewed client clock nor a re-served cached row hides how old it is.
* `receivedAtMs` stays the time the row was last seen, for retention.
*/
function stampFix(record, receivedAtMs, feedLatestEpoch) {
record.fixReceivedAtMs = receivedAtMs;
record.fixFeedEpoch = feedLatestEpoch;
}
function finiteNumber(value) {
if (value === null || value === undefined || value === '') return null;
const number = Number(value);
@@ -46,6 +58,18 @@ export class VesselRecords {
effects,
) {
const receivedAtMs = this.now();
// The newest fix in the batch: the feed's own "now", so a fix's age can
// be read on the feed's clock rather than against this client's (see
// stampFix).
let feedLatestEpoch = null;
for (const row of rows) {
const epoch = finiteNumber(row?.last_position_epoch);
if (
epoch !== null &&
(feedLatestEpoch === null || epoch > feedLatestEpoch)
)
feedLatestEpoch = epoch;
}
for (const record of this.unkeyed) effects.remove(record, false);
this.unkeyed = [];
const seen = new Set();
@@ -53,6 +77,7 @@ export class VesselRecords {
const next = normalizeVessel(row);
if (!next) continue;
next.receivedAtMs = receivedAtMs;
stampFix(next, receivedAtMs, feedLatestEpoch);
if (!next.mmsi) {
effects.add(next);
this.unkeyed.push(next);
@@ -63,6 +88,12 @@ export class VesselRecords {
const record = this.byMmsi.get(next.mmsi);
if (record) {
const before = effects.beforeUpdate(record);
// A feed re-serving a cached row repeats its fix: the fix keeps the
// time it was first received, so it goes on ageing.
if (next.lastPositionEpoch !== record.lastPositionEpoch) {
record.fixReceivedAtMs = next.fixReceivedAtMs;
record.fixFeedEpoch = next.fixFeedEpoch;
}
record.reference = next.reference;
record.receivedAtMs = next.receivedAtMs;
record.lat = next.lat;
+30
View File
@@ -111,3 +111,33 @@ test('unkeyed records rebuild on each refresh and numeric coercion keeps unknown
assert.equal(probe.store.all.length, 1);
assert.equal(normalizeVessel(row('bad', { lon: Infinity })), null);
});
test("each fix keeps when it was first received and its refresh's newest fix", () => {
const probe = setup();
probe.reconcile([
row('111', { last_position_epoch: 1_800_000_000 }),
row('222', { last_position_epoch: 1_800_000_030 }),
row('333'),
]);
for (const mmsi of ['111', '222', '333']) {
const record = probe.store.byMmsi.get(mmsi);
assert.equal(record.fixFeedEpoch, 1_800_000_030, mmsi);
assert.equal(record.fixReceivedAtMs, 1000, mmsi);
}
// A new fix is stamped afresh.
probe.advance(60_000);
probe.reconcile([row('111', { last_position_epoch: 1_800_000_050 })]);
const record = probe.store.byMmsi.get('111');
assert.equal(record.fixFeedEpoch, 1_800_000_050);
assert.equal(record.fixReceivedAtMs, 61_000);
// The same fix re-served by later polls keeps its first receipt, while
// the row itself counts as seen for retention.
probe.advance(30_000);
probe.reconcile([
row('111', { last_position_epoch: 1_800_000_050 }),
row('222', { last_position_epoch: 1_800_000_090 }),
]);
assert.equal(record.fixReceivedAtMs, 61_000);
assert.equal(record.fixFeedEpoch, 1_800_000_050);
assert.equal(record.receivedAtMs, 91_000);
});
+9 -3
View File
@@ -286,7 +286,9 @@ export function createRendering({
const visual = getVisual(record);
const visible = isVisible(visual.surfacePosition, occluder);
if (visual.billboard) {
visual.billboard.show = visible;
// The bridge camera sits on this sprite; showing it would fill the view.
visual.billboard.show =
visible && record.mmsi !== state.cockpitSubjectMmsi;
if (visible && doRotations && scene) {
const rot = screenProjectedRotation(
scene,
@@ -422,7 +424,11 @@ export function createRendering({
const viewer = state.viewer;
const scene = viewer?.scene;
const selected = state.selectedRecord;
const entries = selected
// From the bridge, the selected vessel is the viewer; its card would be
// pinned to the camera position.
const selectedCarded =
selected && selected.mmsi !== state.cockpitSubjectMmsi;
const entries = selectedCarded
? [components.cards.buildSelectedVesselCard(selected)]
: [];
const maxLabels = labelRowLimit();
@@ -458,7 +464,7 @@ export function createRendering({
// Greedy min-separation pass over the priority-ranked cell winners: the
// selected card's anchor seeds the accepted set so ambient cards keep clear.
const accepted = [];
if (selected) {
if (selectedCarded) {
const screen = Cesium.SceneTransforms.worldToWindowCoordinates(
scene,
getVisual(selected).billboard?.position || getVisual(selected).position,
+3
View File
@@ -37,6 +37,9 @@ export function createSelection({
// A tool owns the pointer (src/data/inputOwnership.js): yield the click.
if (!isPointerFree()) return;
if (!state.feed.enabled) return;
// The bridge view owns the selection: a click on open water must not
// deselect the vessel the camera is riding.
if (state.cockpitSubjectMmsi) return;
const picked = pickContact
? pickContact(viewer.scene, click.position)
: viewer.scene.pick(click.position);
+2
View File
@@ -72,6 +72,8 @@ export function createVesselState({ source, services }) {
activeFocusCount: 0,
activeLabelCount: 0,
selectedRecord: null,
/** @type {string|null} MMSI whose bridge the Cockpit camera occupies; its sprite and card stay hidden. */
cockpitSubjectMmsi: null,
/** @type {{setPositions: Function, clear: Function, destroy: Function}|null} Selected-vessel fading trail */
trail: null,
/** @type {Cesium.Cartesian3[]} Chronological trail vertices (oldest first) */