mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Give a viewer of its own a frame port, and use it for the active fires layer
findFrame and frameOf find the bound renderer's frame port or, for a caller's viewer with no renderer bound, one the Cesium adapter's factory builds over it, as findQuery and findDraw do. Unlike the renderer's own, it leaves the viewer's loop as its owner set it up: it listens to the scene's phases, asks for frames, holds by asking again after each one drawn, and maps suspend, the target rate and scene time onto the viewer. Its preUpdate says whether the tick draws by the same test the renderer's frame port makes, now shared by both. The active fires layer's cards and LOD watcher take their query and frame ports from findQuery and findFrame, in place of the layer's own copy of projection, occlusion and preRender over the viewer's scene.
This commit is contained in:
1 parent
784561a6ae
commit
4ed51930c2
12 files changed
+604
-132
No files matched your search
@@ -13,8 +13,10 @@
|
||||
* unless it is Cesium-free: then it is listed in `DRAW_FROM_CALLER`, and
|
||||
* a caller handing it a viewer with no renderer bound loads the package's
|
||||
* `./render/cesium/unbound` export once. An entry that reaches a caller of
|
||||
* `findQuery` or `queryOf` loads `render/cesium/query.js` (the camera
|
||||
* factory loads it too), or is such a Cesium-free entry.
|
||||
* `findQuery` or `queryOf` loads `render/cesium/query.js`, and one that
|
||||
* reaches a caller of `findFrame` or `frameOf` loads
|
||||
* `render/cesium/frame.js` (the camera factory loads both), or is such a
|
||||
* Cesium-free entry.
|
||||
*
|
||||
* The graph is every static import, re-export and literal dynamic import of
|
||||
* the entry's module and those it reaches, read by the parsers the Cesium
|
||||
@@ -38,6 +40,7 @@ const EFFECTS_FACTORY = 'src/render/cesium/effects.js';
|
||||
const GLOBE_FACTORY = 'src/render/cesium/globe.js';
|
||||
const DRAW_FACTORY = 'src/render/cesium/draw.js';
|
||||
const QUERY_FACTORY = 'src/render/cesium/query.js';
|
||||
const FRAME_FACTORY = 'src/render/cesium/frame.js';
|
||||
const UNBOUND = 'src/render/cesium/unbound.js';
|
||||
|
||||
/**
|
||||
@@ -246,15 +249,25 @@ test('every public entry that reaches a findGlobe caller loads the unbound globe
|
||||
});
|
||||
|
||||
test('every public entry that reaches a findQuery or queryOf caller loads the unbound query factory, or its caller can', () => {
|
||||
for (const lookup of ['findQuery', 'queryOf'])
|
||||
checkLookupFactory(lookup, QUERY_FACTORY, {
|
||||
reached: false,
|
||||
fromCaller: true,
|
||||
});
|
||||
checkLookupFactory('findQuery', QUERY_FACTORY, { fromCaller: true });
|
||||
checkLookupFactory('queryOf', QUERY_FACTORY, {
|
||||
reached: false,
|
||||
fromCaller: true,
|
||||
});
|
||||
});
|
||||
|
||||
test('the unbound camera factory loads the unbound query factory', () => {
|
||||
assert.ok(reachable(FACTORY, { eager: true }).has(QUERY_FACTORY));
|
||||
test('every public entry that reaches a findFrame or frameOf caller loads the unbound frame factory, or its caller can', () => {
|
||||
checkLookupFactory('findFrame', FRAME_FACTORY, { fromCaller: true });
|
||||
checkLookupFactory('frameOf', FRAME_FACTORY, {
|
||||
reached: false,
|
||||
fromCaller: true,
|
||||
});
|
||||
});
|
||||
|
||||
test('the unbound camera factory loads the unbound query and frame factories', () => {
|
||||
const loaded = reachable(FACTORY, { eager: true });
|
||||
assert.ok(loaded.has(QUERY_FACTORY));
|
||||
assert.ok(loaded.has(FRAME_FACTORY));
|
||||
});
|
||||
|
||||
test('the unbound export brings every unbound factory', () => {
|
||||
@@ -264,6 +277,7 @@ test('the unbound export brings every unbound factory', () => {
|
||||
EFFECTS_FACTORY,
|
||||
DRAW_FACTORY,
|
||||
QUERY_FACTORY,
|
||||
FRAME_FACTORY,
|
||||
'src/render/cesium/credits.js',
|
||||
])
|
||||
assert.ok(loaded.has(factory), factory);
|
||||
|
||||
Reference in new issue
Block a user