mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Application extras come from the renderer plugin; framing, occlusion and panel drawing are contract ports
A renderer plugin may supply applicationHooks(renderer) for what only its renderer has (map engine, own credits, stale commands, QA handles). What every renderer should do moves onto the contract: controls.keepEarthFramed (behind the keepEarthFramed capability), query.occlusionTest (behind occlusionTest), and panel drawing, which keepPanelRendering now does through resize and frame.renderNow through the contract. renderNow throws when the frame fails to draw. The Cesium port installs its zoom-out guard through keepEarthFramed (a setView no longer cancels its turn) and answers occlusionTest with the scene's probe; the stub answers it with a horizon test.
This commit is contained in:
1 parent
a755f63638
commit
619c19ea67
40 files changed
+737
-323
No files matched your search
Vendored
+33
@@ -25,6 +25,39 @@ export interface RendererPlugin {
|
||||
/** Stable id, recorded with each session (`'cesium'`, ...). */
|
||||
id: string;
|
||||
create(options: CreateOptions): Promise<Renderer>;
|
||||
/**
|
||||
* What the plugin hands the application beside the contract for a
|
||||
* renderer it made, asked once, right after `create` resolves. Omitted:
|
||||
* none.
|
||||
*/
|
||||
applicationHooks?(renderer: Renderer): ApplicationHooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* What only some renderers have and the application uses where given, does
|
||||
* application uses each where given and does without where not. None is a
|
||||
* do is in the ports.
|
||||
*/
|
||||
export interface ApplicationHooks {
|
||||
/**
|
||||
* The renderer's own map engine, which the map stacks switch through in
|
||||
* place of the globe port (`src/maps/engine.js`).
|
||||
*/
|
||||
mapEngine?: unknown;
|
||||
/**
|
||||
* True when the renderer shows its credits in a display of its own;
|
||||
* otherwise the application shows what the credits port lists.
|
||||
*/
|
||||
ownCreditDisplay?: boolean;
|
||||
/**
|
||||
* Drop the draw commands the renderer keeps for a while after it stops
|
||||
* drawing them; run after a layer turns off.
|
||||
*/
|
||||
trimStaleCommands?(): void;
|
||||
/** Whether an entity is one the renderer draws itself. */
|
||||
viewerDrawsEntity?(entity: unknown): boolean;
|
||||
/** Values QA scripts read from the page's debug handle. */
|
||||
qaHandles?: Readonly<Record<string, unknown>>;
|
||||
}
|
||||
|
||||
export interface CreateOptions {
|
||||
|
||||
Reference in new issue
Block a user