fix(cockpit): the bridge reads its floor where the ship is now

The ground clamp read the floor at the ship's last AIS fix while the camera
rode that fix dead-reckoned up to 180 s ahead, so a quay or bridge deck at
the old position could lift the eye. Vessels now read the floor at the
dead-reckoned target, as the water read already does; aircraft are
unchanged.
This commit is contained in:
Sameh Khamis committed 2026-11-08 14:09:17 -08:00
1 parent 052731202d
commit 3ce3fce46f
2 files changed
+32 -2

No files matched your search

+11 -2
View File
@@ -401,9 +401,18 @@ function placeCamera(target, info, nowMs, dtSec, profile, look = null) {
Cesium.Ellipsoid.WGS84,
this.scratchTargetCartographic,
);
// A bridge's target is its fix dead-reckoned up to minutes ahead: read
// the floor where the ship is now, as its water is.
const floorAt =
info.kind === 'vessel'
? {
latitude: Cesium.Math.toDegrees(targetCartographic.latitude),
longitude: Cesium.Math.toDegrees(targetCartographic.longitude),
}
: info;
let cockpitFloorM = this.services.cachedGroundFloor(
info.latitude,
info.longitude,
floorAt.latitude,
floorAt.longitude,
);
if (info.onGround === true) {
const groundPoint = [{ lat: info.latitude, lon: info.longitude }];