Revert hiding vessel detection callouts under ambient cards

The vessels layer hid the detection callout for every vessel whose card
it published to the world overlay. The overlay paints only part of the
published cards (shared budget, collisions, UI chrome), so vessels whose
card was dropped lost all their text: with 60 vessels and Detection on,
21 showed only an arrow. Back to main's behaviour: the callout always
draws. Hiding it only under a painted card is HAL-628.

The translated speed unit in the callout stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-16 17:37:58 +04:00
1 parent 3adce33cc6
commit a2463ca2d2
7 files changed
+433 -250

No files matched your search

-23
View File
@@ -6,7 +6,6 @@ import {
VESSEL_OVERLAY_SOURCE_ID,
applyVesselOverlayPolicy,
VESSEL_CARD_FADE_DISTANCE_M,
VESSEL_CARD_FADE_START_RATIO,
} from '../../data/vesselLabels.js';
import {
cameraPoseSignature,
@@ -367,7 +366,6 @@ export function createRendering({
if (!scene || !records.length || maxLabels <= 0) {
state.activeLabelCount = entries.length;
state.cardedRecords = new Set();
publishVesselOverlayEntries(entries);
return;
}
@@ -405,9 +403,6 @@ export function createRendering({
if (screen) accepted.push({ x: screen.x, y: screen.y });
}
const ranked = [...cells.values()].sort((a, b) => b.score - a.score);
// Vessels with an ambient card: the card already shows name, speed and
// course, so the detection overlay draws no label of its own under it.
const carded = new Set();
for (const candidate of ranked) {
if (entries.length >= maxLabels) break;
if (
@@ -420,10 +415,8 @@ export function createRendering({
continue;
accepted.push({ x: candidate.x, y: candidate.y });
entries.push(components.cards.buildVesselCard(candidate.record));
if (cardFullyShown(scene, candidate.record)) carded.add(candidate.record);
}
state.activeLabelCount = entries.length;
state.cardedRecords = carded;
publishVesselOverlayEntries(entries);
}
@@ -476,22 +469,6 @@ export function createRendering({
);
}
/**
* Whether the host paints this ambient card at full strength: inside the
* start of its distance fade (applyVesselOverlayPolicy). Farther out the
* card fades away and the detection label stays the vessel's only text.
*/
function cardFullyShown(scene, record) {
const camera = scene.camera?.positionWC;
const visual = getVisual(record);
const position = visual.billboard?.position || visual.position;
if (!camera || !position) return true;
return (
Cesium.Cartesian3.distance(camera, position) <
VESSEL_CARD_FADE_DISTANCE_M * VESSEL_CARD_FADE_START_RATIO
);
}
function labelPriority(record, selected) {
if (record === selected) return 100000;
let score = 0;