mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Build the selected vessel's trail without Cesium
Trail vertices are geo/ellipsoid positions and the minimum move is measured with geo/vector, both giving what the Cesium calls gave. Re-anchoring rows when the geoid loads asks the rendering part for the anchor, now one function prepareRecordVisual shares, so icon positions stay Cesium values. The shared trail renderer takes plain ECEF positions as well, turning them into Cartesian3s for its polyline; the Cartesian3s other layers hand it pass through untouched. tracking leaves the Cesium allow-list.
This commit is contained in:
1 parent
1c840cb66f
commit
e327760074
6 files changed
+224
-26
No files matched your search
@@ -65,16 +65,23 @@ export function createRendering({
|
||||
};
|
||||
visualRecords.set(record, visual);
|
||||
}
|
||||
visual.position = anchorPosition(record);
|
||||
return visual;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where a record's icon is anchored: VESSEL_LIFT_M above the sea surface
|
||||
* (the geoid, once its grid has loaded).
|
||||
* @param {Object} record - Vessel record with a finite lat/lon.
|
||||
* @returns {Cesium.Cartesian3} A Cesium position: icon rows, focus and the
|
||||
* layer's queries take it as it is.
|
||||
*/
|
||||
function anchorPosition(record) {
|
||||
const heightM = components.queries.vesselDatumHeightM(
|
||||
components.tracking.currentGeoidN(record.lat, record.lon),
|
||||
VESSEL_LIFT_M,
|
||||
);
|
||||
visual.position = Cesium.Cartesian3.fromDegrees(
|
||||
record.lon,
|
||||
record.lat,
|
||||
heightM,
|
||||
);
|
||||
return visual;
|
||||
return Cesium.Cartesian3.fromDegrees(record.lon, record.lat, heightM);
|
||||
}
|
||||
|
||||
function resetRecordVisuals() {
|
||||
@@ -594,6 +601,7 @@ export function createRendering({
|
||||
getVisual,
|
||||
iconPosition,
|
||||
prepareRecordVisual,
|
||||
anchorPosition,
|
||||
resetRecordVisuals,
|
||||
renderRowLimit,
|
||||
labelRowLimit,
|
||||
|
||||
Reference in new issue
Block a user