mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Wait for drawn street traffic frames through the frame port
Road surface refinement and the development timing marks now listen for drawn frames on the renderer's frame port instead of the scene's own postRender event. Refinement reads the drawn frame's surface readiness directly, since frame-port listeners run before the rendered-frame observer. The view-height estimate's globe and sample-height reads move into the surface module, which stays on the Cesium allow-list.
This commit is contained in:
1 parent
0933ff49ff
commit
f0427fc63e
8 files changed
+251
-19
No files matched your search
@@ -2,6 +2,7 @@ import { requestWithDeadline } from '../../sources/requestDeadline.js';
|
||||
import { resolveRoadMode, ROAD_SOURCE_LABELS } from './roadModes.js';
|
||||
import { phaseTiming } from '../../sources/phaseTiming.js';
|
||||
import { RoadRequestError, roadRequestError } from './source.js';
|
||||
import { loadedSurfaceHeight } from './surface.js';
|
||||
import {
|
||||
isUnavailableCapability,
|
||||
sourceResponseError,
|
||||
@@ -11,7 +12,6 @@ import {
|
||||
TILE_CACHE_MAX_ENTRIES,
|
||||
FAST_FETCH_ALTITUDE,
|
||||
} from './policy.js';
|
||||
import { heightsFor } from '../../queries/heights.js';
|
||||
|
||||
/** Retain complete parsed snapshots under both an LRU entry cap and a byte budget. */
|
||||
export function cacheRoadSnapshot(
|
||||
@@ -270,19 +270,14 @@ export function createIngestion({
|
||||
layerState._viewHeightEstimate = 0;
|
||||
const centerLat = (clamped.south + clamped.north) / 2;
|
||||
const centerLon = (clamped.west + clamped.east) / 2;
|
||||
const scene = layerState._viewer?.scene;
|
||||
const location = { lon: centerLon, lat: centerLat };
|
||||
let estimated = services.ground?.cachedGroundFloor?.(centerLat, centerLon);
|
||||
// A miss is the local mesh still loading.
|
||||
if (!Number.isFinite(estimated) && scene) {
|
||||
estimated = scene.globe?.show
|
||||
? heightsFor(scene).now(location, { against: 'terrain' })
|
||||
: scene.sampleHeightSupported
|
||||
? heightsFor(scene).now(location, {
|
||||
exclude: [layerState._pointCollection],
|
||||
})
|
||||
: undefined;
|
||||
}
|
||||
if (!Number.isFinite(estimated))
|
||||
estimated = loadedSurfaceHeight(
|
||||
layerState._viewer?.scene,
|
||||
{ lon: centerLon, lat: centerLat },
|
||||
[layerState._pointCollection],
|
||||
);
|
||||
if (Number.isFinite(estimated) && Math.abs(estimated) <= 9000)
|
||||
layerState._viewHeightEstimate = estimated;
|
||||
|
||||
|
||||
Reference in new issue
Block a user