mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Hand the application the renderer's own engine
An application may draw with a renderer's engine directly beside the
contract. ApplicationHooks gains engine, whose kind names the engine;
Cesium's plugin hands {kind: 'cesium', viewer}. An application draws only
with engines whose kind it knows, and what it draws is its own to add,
update and remove.
This commit is contained in:
1 parent
96fac711f4
commit
0e6973e0b2
5 files changed
+21
-1
No files matched your search
@@ -218,6 +218,8 @@ export function createCesiumRendererPlugin({
|
||||
// Whether an entity is one of the viewer's own (Cockpit asks whether
|
||||
// the aircraft it flies still draws).
|
||||
viewerDrawsEntity: (entity) => viewer.entities.contains(entity),
|
||||
// An application drawing with Cesium itself beside the contract.
|
||||
engine: Object.freeze({ kind: 'cesium', viewer }),
|
||||
// QA scripts drive and read the viewer itself.
|
||||
qaHandles: {
|
||||
viewer,
|
||||
|
||||
@@ -156,6 +156,8 @@ test('the plugin wraps the viewer it is given, behind the accessor only', async
|
||||
);
|
||||
assert.equal(hooks.ownCreditDisplay, true, 'Cesium shows its own credits');
|
||||
assert.equal(hooks.qaHandles.viewer, viewer, 'QA scripts read the viewer');
|
||||
assert.equal(hooks.engine.kind, 'cesium', 'the engine says what it is');
|
||||
assert.equal(hooks.engine.viewer, viewer, 'an application may draw with it');
|
||||
assert.equal(hooks.viewerDrawsEntity({ own: true }), true);
|
||||
assert.equal(hooks.viewerDrawsEntity({}), false);
|
||||
assert.equal(typeof hooks.trimStaleCommands, 'function');
|
||||
|
||||
Reference in new issue
Block a user