mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Read the followed target, not trackedEntity, in the follow readers
The tracked card, screen annotations, north-up, share links and Cockpit ask data/followed.js what the camera follows, so they work the same when a layer follows through the camera port. followed.js gains entityFollowTarget (a FollowTarget whose presentation reads the drawn entity's record), resumeFollowing and followedPosition.
This commit is contained in:
1 parent
7eec2f828c
commit
99f9a701d9
16 files changed
+215
-84
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { followedOf } from '../data/followed.js';
|
||||
import * as Cesium from 'cesium';
|
||||
import { getOverlayPaintRect } from '../overlays/worldOverlay.js';
|
||||
import {
|
||||
@@ -8,7 +9,6 @@ import { t } from '../i18n/index.js';
|
||||
import { nextTick } from 'vue';
|
||||
import { useScreenAnnotationsStore } from '../ui/stores/screenAnnotations.js';
|
||||
import { applicationPinia } from '../ui/vueRuntime.js';
|
||||
import { readEntityRecord } from '../data/entityRecords.js';
|
||||
import { heightsFor } from '../queries/heights.js';
|
||||
|
||||
/** A label whose detailed outline could not be resolved. */
|
||||
@@ -421,8 +421,8 @@ export function createScreenAnnotationRenderer(
|
||||
let top = painted?.y;
|
||||
let bottom = painted ? painted.y + painted.h : undefined;
|
||||
|
||||
const ent = viewer.trackedEntity;
|
||||
const displayPosition = readEntityRecord(ent)?.displayPosition;
|
||||
const followed = followedOf(viewer);
|
||||
const displayPosition = followed?.displayPosition;
|
||||
const world =
|
||||
typeof displayPosition === 'function' ? displayPosition() : null;
|
||||
const win = world
|
||||
@@ -435,7 +435,7 @@ export function createScreenAnnotationRenderer(
|
||||
|
||||
// Billboard box — centered on the anchor, magnified by scaleByDistance, from
|
||||
// the size the tracking layer recorded for its sprite.
|
||||
const sprite = readEntityRecord(ent)?.sprite;
|
||||
const sprite = followed?.sprite;
|
||||
if (sprite && win && Number.isFinite(win.x) && Number.isFinite(win.y)) {
|
||||
const baseW = sprite.width ?? 28;
|
||||
const baseH = sprite.height ?? 28;
|
||||
|
||||
Reference in new issue
Block a user