mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Upstream's layers and changes are carried onto the ports, with no Cesium outside src/render and no reach into the viewer: - Shipwrecks draw as one icon set, clicked through the input dispatcher. - News draws through draw sets, the camera port and the input dispatcher; its beacons pulse each frame through the frame port. - The scene occlusion probe moves into src/render/cesium and reaches detection through a new application hook, createOcclusionProbe; its private Cesium reads go through internals.js. - Flight and military trails, the stale and SIGNAL LOST cue, coasting and following the world clock run on the draw and frame ports. GPU icons follow the scene clock while the world clock is followed, and fade when stale. A report that holds is not planned again every tick. - Vessels are keyed by their record id. The stub boot now enables military, shipwrecks and news as well.
70 lines
2.5 KiB
JavaScript
70 lines
2.5 KiB
JavaScript
export function createState({ services }) {
|
|
const state = {};
|
|
|
|
Object.assign(state, {
|
|
viewer: null,
|
|
dataManager: null,
|
|
enabled: false,
|
|
// Set once a refresh observes the subject gone from a still-reporting source.
|
|
// The Contact readout turns this into its CONTACT LOST hold state.
|
|
subjectMissing: false,
|
|
// The dedicated Context chooser exposes a passive shell. Operational source
|
|
// layers activate only after Contacts is explicitly selected.
|
|
passive: true,
|
|
ownedDependencies: new Set(),
|
|
/** Stops following the manager's adoptions (see watchAdoptions). */
|
|
unwatchAdoptions: null,
|
|
subject: null,
|
|
/** The tracked flight's photo with the subject it belongs to, or null. */
|
|
subjectPhoto: null,
|
|
results: null,
|
|
visual: null,
|
|
/** Whether layer views replace the panel's initial markup yet. */
|
|
panelShown: false,
|
|
/** The published panel view, its signature and its subscribers. */
|
|
panelView: null,
|
|
panelSignature: '',
|
|
panelListeners: new Set(),
|
|
/** Result renders, published or not; tests observe repaint storms. */
|
|
panelRenders: 0,
|
|
subjectListener: null,
|
|
contextListener: null,
|
|
clearListener: null,
|
|
subjectClearListener: null,
|
|
runtimeListenersAttached: false,
|
|
preRenderRemover: null,
|
|
/** The published direction overlay, its signature and its subscribers. */
|
|
directionView: null,
|
|
directionSignature: '',
|
|
directionListeners: new Set(),
|
|
/** Each marker's last stable screen angle. */
|
|
directionAngles: [0, 0, 0],
|
|
navigationHistory: [],
|
|
navigationVisited: new Set(),
|
|
navigationIndex: -1,
|
|
suppressedHistoryKey: null,
|
|
pendingSelectionKey: null,
|
|
lastSubjectRefreshMs: 0,
|
|
/** Camera-pose signature observed on the previous rendered frame. */
|
|
lastCameraPoseSig: '',
|
|
/** When the pose signature last changed bins (hysteresis anchor). */
|
|
lastCameraPoseChangeMs: 0,
|
|
/** When the viewer last handled the camera (pointer, wheel, touch, key). */
|
|
lastCameraInputMs: Number.NEGATIVE_INFINITY,
|
|
/** Element the camera-input listeners are attached to. */
|
|
cameraInputTarget: null,
|
|
/** Whether the view currently counts as moving (hysteretic, not per-frame). */
|
|
cameraMoving: false,
|
|
lastEvaluatedPosition: null,
|
|
sourceRevision: '',
|
|
directionFrame: null,
|
|
lastDirectionUpdateMs: 0,
|
|
activationId: 0,
|
|
autoFocusAttempted: false,
|
|
autoFocusRetryPending: false,
|
|
pageTimer: null,
|
|
cohortPages: new Map(),
|
|
});
|
|
return state;
|
|
}
|