mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
The military fleet also renders behind real time and projects a fresh contact's first fix back to that delayed time, but its billboard was created at the raw fix. A new contact therefore appeared ahead of where the next fleet tick put it and jumped back. The snapshot renderer now receives the layer's motion and creates the billboard at the dead-reckoned delayed position.
59 lines
2.0 KiB
JavaScript
59 lines
2.0 KiB
JavaScript
import { createMilitarySnapshotRenderer } from './snapshotRenderer.js';
|
|
import { createFlightState } from './state.js';
|
|
import { createRendering } from './rendering.js';
|
|
import { createMotion } from './motion.js';
|
|
import { createTracking } from './tracking.js';
|
|
import { createController } from './controller.js';
|
|
import { createIngestion } from './ingestion.js';
|
|
import { createLifecycle } from './lifecycle.js';
|
|
import { createTesting } from './testing.js';
|
|
import { createQueries } from './queries.js';
|
|
/** Compose one military-flight layer with application-owned scene services. */
|
|
export function createMilitaryFlightLayer({
|
|
source,
|
|
services,
|
|
resolveAsset = (url) => url,
|
|
} = {}) {
|
|
const flightState = createFlightState({ source, services });
|
|
const parts = {};
|
|
const layer = {};
|
|
const context = { flightState, services, parts, layer, resolveAsset };
|
|
parts.rendering = createRendering(context);
|
|
parts.motion = createMotion(context);
|
|
parts.tracking = createTracking(context);
|
|
parts.controller = createController(context);
|
|
parts.lifecycle = createLifecycle(context);
|
|
parts.testing = createTesting(context);
|
|
parts.queries = createQueries(context);
|
|
const applySnapshot = createMilitarySnapshotRenderer({
|
|
flightState,
|
|
records: flightState.records,
|
|
groundFloor: services.groundFloor,
|
|
meshFloor: services.meshFloor,
|
|
militaryRegistry: services.militaryRegistry,
|
|
rendering: parts.rendering,
|
|
tracking: parts.tracking,
|
|
motion: parts.motion,
|
|
queries: parts.queries,
|
|
});
|
|
parts.ingestion = createIngestion({
|
|
feed: flightState.feed,
|
|
applySnapshot,
|
|
setSourceLabel: (source) => {
|
|
layer.source = source;
|
|
},
|
|
applyPendingTrackingRestore: () =>
|
|
parts.tracking._applyPendingTrackingRestore(),
|
|
});
|
|
|
|
Object.assign(
|
|
layer,
|
|
parts.queries.methods,
|
|
parts.lifecycle.methods,
|
|
parts.ingestion.methods,
|
|
);
|
|
Object.defineProperty(layer, 'testing', { value: parts.testing });
|
|
return layer;
|
|
}
|
|
export { TRACKED_MODEL_MAX_PX } from './policy.js';
|