mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Draw the card previews through the renderer, and show vessel photos too
- The route globe, turning model and cockpit view are the renderer's: the Cesium plugin hands them over as its `cardPreviews` application hook (src/render/cesium/cardPreviews.js), and the card's tiles keep only the words, figures and HUD laid over them. Nothing in the UI reaches Cesium, and a renderer without the hook leaves the card its photo and figures. - The turning model is the fleet model the globe draws for the aircraft's type, from the set loaded at startup, so opening a card fetches nothing. The flights layer's record now carries the type code and emitter category that pick it. - The photo comes from the item's own layer: the flights layer's Planespotters photo for the plane it tracks, and the vessels layer's Open Vessel Photos photo for the vessel selected, with its credit. It no longer waits for Contacts to follow the same aircraft. - The satellite models are left out: the card shows a satellite's ground view and graphs its altitude and speed. - The route globe's airport codes are drawn into its own small scene, the compass reads its course in the active language, the callouts no longer speak to screen readers every six seconds, and figures use the app's number format. Esri's tile address and credit live in one place. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
c6bdd38b61
commit
3a0842c103
26 files changed
+1347
-676
No files matched your search
Vendored
+69
@@ -67,6 +67,75 @@ export interface ApplicationHooks {
|
||||
allowReload: boolean;
|
||||
store: RenderFailureStore;
|
||||
}): () => void;
|
||||
/** The Context card's previews of a picked aircraft. */
|
||||
cardPreviews?: CardPreviews;
|
||||
}
|
||||
|
||||
/**
|
||||
* Previews the Context card draws into an element of its own. Each returns
|
||||
* at once; one that cannot be made calls its `onFailed`.
|
||||
*/
|
||||
export interface CardPreviews {
|
||||
/**
|
||||
* A model turning on its own, from its GLB's bytes, starting to face
|
||||
* `heading` (degrees); `viewRange` is the camera's distance in bounding
|
||||
* radii. `onPhase` says when it turns to wire for its scan and back;
|
||||
* `onCycle` when a look and its scan end, with the drawing time they took.
|
||||
*/
|
||||
model(
|
||||
container: HTMLElement,
|
||||
model: {
|
||||
gltf: Uint8Array | ArrayBuffer;
|
||||
basePath?: string;
|
||||
heading?: number;
|
||||
viewRange?: number;
|
||||
},
|
||||
events?: {
|
||||
onPhase?(phase: 'plain' | 'scan'): void;
|
||||
onCycle?(ms: number): void;
|
||||
onFailed?(): void;
|
||||
},
|
||||
): CardPreview<void>;
|
||||
/** A flight's route from `from` to `to` on a small globe, the craft `at`. */
|
||||
route(
|
||||
container: HTMLElement,
|
||||
route: CardRoute,
|
||||
events?: { onFailed?(): void },
|
||||
): CardPreview<CardRoute>;
|
||||
/** The view ahead from an aircraft's position, height and heading. */
|
||||
cockpit(
|
||||
container: HTMLElement,
|
||||
craft: CardCraft,
|
||||
events?: { onFailed?(): void },
|
||||
): CardPreview<CardCraft>;
|
||||
}
|
||||
|
||||
/** A place on a card's route: an airport's code and position, degrees. */
|
||||
export interface CardPlace {
|
||||
code?: string;
|
||||
lat: number;
|
||||
lon: number;
|
||||
}
|
||||
|
||||
export interface CardRoute {
|
||||
from: CardPlace;
|
||||
to: CardPlace;
|
||||
at?: { lat: number; lon: number } | null;
|
||||
}
|
||||
|
||||
/** An aircraft's position (degrees), height (metres) and heading (degrees). */
|
||||
export interface CardCraft {
|
||||
lat: number;
|
||||
lon: number;
|
||||
altitudeM?: number | null;
|
||||
heading?: number | null;
|
||||
}
|
||||
|
||||
/** One preview: hidden, it rests on its last frame. */
|
||||
export interface CardPreview<Values> {
|
||||
setActive(active: boolean): void;
|
||||
update(values: Values): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
/** Where a renderer's failure notice is published for the application to show. */
|
||||
|
||||
Reference in new issue
Block a user