mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
052731202d
commit
3ce3fce46f
2 files changed
+32
-2
No files matched your search
+11
-2
@@ -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 }];
|
||||
|
||||
Reference in new issue
Block a user