mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +00:00
The renderer seam: clicks go to the newest tool, recession and display groups through the contract, drawing at parity with Cesium
- Clicks: when two tools want the globe's clicks, the newest takes them and the older is told and turns itself off; a click is decided when it arrives, and ambient selection fires only when no tool holds the pointer. The "map is busy" paths and their strings are removed. - Recession: the limb fade is shared (src/render/recession.js) and reaches icon and model sets through SetSpec.recede; tuning applies on the next frame. - Display panel groups are published through src/ui/displayGroups.js; the Weather group and src/viewWeather.js are removed. - Draw port: a set whose icons only move is moved in place, and models that did not change are not restyled each frame, so moving fleets cost what they did when drawn directly; an untinted, fully opaque model is drawn without a colour. - Conformance: input.lease.lost checks the new lease inside onLost and reports a throwing onLost; draw.sets.recede covers model sets. - QA scripts read the renderer host instead of internals the seam replaced.
This commit is contained in:
1 parent
a0d299523d
commit
0ab31d4fb8
130 files changed
+5438
-1674
No files matched your search
@@ -23,6 +23,7 @@
|
||||
* `cesiumViewerOf` (`viewers.js`), never through a renderer member, so no
|
||||
* engine type crosses the contract.
|
||||
*/
|
||||
import * as Cesium from 'cesium';
|
||||
import { createApplicationViewer } from './applicationViewer.js';
|
||||
import { CONTRACT_VERSION } from '../contract/index.js';
|
||||
import { bindRenderer } from '../rendererOf.js';
|
||||
@@ -80,7 +81,13 @@ export function createCesiumRendererPlugin({
|
||||
id: 'cesium',
|
||||
/**
|
||||
* The credentials are the globe port's, for a base set through it; the
|
||||
* scene still loads the application's own base itself.
|
||||
* scene still loads the application's own base itself. `msaa` makes
|
||||
* the viewer (4 when not given);
|
||||
* `sky` and `time` are set before the first frame; `clock.now` is what
|
||||
* the frame ticks, the camera's `moveEnd` wait, input and flights (the
|
||||
* scene's tweens step on it) read, `clock.date` what a `live` motion
|
||||
* clock reads. Inertia keeps Cesium's own timing: its camera controls
|
||||
* time a release by the system clock.
|
||||
* @param {import('../contract/renderer').CreateOptions} options
|
||||
* @returns {Promise<TransitionalRenderer>}
|
||||
*/
|
||||
@@ -90,6 +97,10 @@ export function createCesiumRendererPlugin({
|
||||
googleApiKey,
|
||||
googleTokens,
|
||||
worldDataToken,
|
||||
msaa,
|
||||
sky,
|
||||
time,
|
||||
clock,
|
||||
}) {
|
||||
signal?.throwIfAborted();
|
||||
// Provider attribution stays visible, including clean-view and recording.
|
||||
@@ -109,7 +120,11 @@ export function createCesiumRendererPlugin({
|
||||
// The application's notice (`renderFailureNotice`) replaces
|
||||
// Cesium's dead-end panel when rendering stops.
|
||||
showRenderLoopErrors: false,
|
||||
msaa,
|
||||
});
|
||||
if (Number.isFinite(time))
|
||||
viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(time));
|
||||
const now = clock ? () => clock.now() : undefined;
|
||||
capabilities = new ReadonlySet(cesiumCapabilities(viewer.scene));
|
||||
ports = createCesiumPorts(viewer, {
|
||||
capabilities,
|
||||
@@ -117,6 +132,7 @@ export function createCesiumRendererPlugin({
|
||||
idleFps: IDLE_FRAME_RATE,
|
||||
credentials: { googleApiKey, googleTokens, worldDataToken },
|
||||
...(cameraController ? { cameraController } : {}),
|
||||
...(clock ? { now, date: () => clock.date() } : {}),
|
||||
});
|
||||
input = createCesiumInput(viewer, {
|
||||
query: ports.query,
|
||||
@@ -124,7 +140,10 @@ export function createCesiumRendererPlugin({
|
||||
...(ports.suspendCamera
|
||||
? { suspendCamera: ports.suspendCamera }
|
||||
: {}),
|
||||
...(clock ? { now } : {}),
|
||||
});
|
||||
// Before the first frame, so nothing draws in the wrong sky.
|
||||
if (sky) ports.globe.sky.set(sky);
|
||||
ports.attachInput?.(input.port);
|
||||
// Free look is limited to low heights from the start, on Cesium's
|
||||
// own controls (the controller keeps its own limits).
|
||||
|
||||
Reference in new issue
Block a user