mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Draw rocket launches through the renderer ports, off Cesium
The launches layer's sites, markers, reticles, mission lines, live orbit rings and pad zone are now renderer draw sets. Picks go through the query port, double-click follow through the camera port (shared with other layers in src/data/stockFollow.js), and per-frame work through the frame port. rendering.js, orbitRendering.js and launchPad.js leave the Cesium list. The Cesium draw port gains what these need: pattern line styles, lines in the inertial frame turned each frame by the set's motion clock, radial-rim fills on clamped ellipses with a depth bias, and parking for hidden lines that cannot settle into a static batch, so a hidden line no longer costs a draw each frame. A roster writes each set once, and a followed live payload shares one position sample with its marker each frame.
This commit is contained in:
1 parent
fa762f808e
commit
4a9b1389ba
22 files changed
+1476
-717
No files matched your search
@@ -231,32 +231,49 @@ test('mission hover preserves the cursor of a pointer-owning tool', () => {
|
||||
assert.equal(viewer.scene.canvas.style.cursor, 'crosshair');
|
||||
});
|
||||
|
||||
test('mission picks are read by the rendering part, which owns the entities', async () => {
|
||||
test('mission picks are read by the rendering part, which owns the draw sets', async () => {
|
||||
const { createRendering } = await import('./rendering.js');
|
||||
const mission = { id: 'rocket-launch:abc' };
|
||||
const { bindFakeDraw } = await import('../../testSupport/fakeDrawPort.mjs');
|
||||
const drilled = [];
|
||||
const state = {
|
||||
_viewer: {
|
||||
scene: {
|
||||
drillPick(position, limit) {
|
||||
drilled.push([position, limit]);
|
||||
return [{ id: { id: 'cable:1' } }, { id: mission }];
|
||||
},
|
||||
const viewer = {};
|
||||
let hits = [];
|
||||
const { unbind } = bindFakeDraw(viewer, {
|
||||
query: {
|
||||
drillPick(x, y, options) {
|
||||
drilled.push([x, y, options]);
|
||||
return hits;
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
const state = { _viewer: viewer };
|
||||
const rendering = createRendering({
|
||||
state,
|
||||
services: { satellites: {} },
|
||||
parts: {},
|
||||
});
|
||||
rendering.attach(viewer);
|
||||
const { sites, lines } = rendering.setIds;
|
||||
hits = [
|
||||
{ set: 'cables:1', id: 'rocket-launch:zzz', surface: false },
|
||||
{ set: sites, id: 'rocket-launch:abc', surface: false },
|
||||
];
|
||||
assert.equal(rendering.launchMarkerAt({ x: 3, y: 4 }), true);
|
||||
assert.deepEqual(drilled, [[{ x: 3, y: 4 }, 12]]);
|
||||
assert.deepEqual(drilled, [[3, 4, { limit: 12 }]]);
|
||||
assert.equal(rendering.launchIdFromPicks(hits), 'abc');
|
||||
assert.equal(
|
||||
rendering.launchIdFromPicks([{ id: 'x' }, { id: mission }]),
|
||||
'abc',
|
||||
rendering.launchIdFromPicks([
|
||||
{ set: lines, id: 'rocket-trajectory:def:0', surface: false },
|
||||
]),
|
||||
'def',
|
||||
);
|
||||
assert.equal(rendering.launchIdFromPicks([{ id: 'x' }]), null);
|
||||
assert.equal(
|
||||
rendering.launchIdFromPicks([{ set: sites, id: 'x', surface: false }]),
|
||||
null,
|
||||
);
|
||||
hits = [hits[0]];
|
||||
assert.equal(rendering.launchMarkerAt({ x: 3, y: 4 }), false);
|
||||
state._viewer = null;
|
||||
assert.equal(rendering.launchMarkerAt({ x: 3, y: 4 }), false);
|
||||
rendering.detach();
|
||||
unbind();
|
||||
});
|
||||
Reference in new issue
Block a user