mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 09:12:18 +00:00
Follow, drape and read the camera through the ports, not the viewer
- What the camera follows is the camera port's target only: no layer tracks an entity of its own any more, so followed.js stops reading and writing viewer.trackedEntity and the viewer's clock. - Draped imagery's host is the globe port's imagery while the globe is shown (isGlobeVisible, or no shown base tileset where a renderer cannot say), else the shown base tileset; weather uses the same resolver. - The World Packet reads the eye from the camera port's pose, and vessels ask again for the view on the camera port's moveEnd. - The stub's canvas takes event listeners, and in a page is a real canvas filling the container it is given; createStubRendererPlugin makes it a renderer plugin. The viewer access record is now empty.
This commit is contained in:
1 parent
ebbe006924
commit
a72d4c3b1f
11 files changed
+230
-213
No files matched your search
@@ -3,6 +3,8 @@ import assert from 'node:assert/strict';
|
||||
import * as Cesium from 'cesium';
|
||||
|
||||
import { getWorldPacket } from './worldPacket.js';
|
||||
import { bindRenderer } from '../render/rendererOf.js';
|
||||
import { createStubRenderer } from '../render/stub/index.js';
|
||||
import { createGevActionRunner } from '../voice/gevActions.js';
|
||||
|
||||
function withoutVoicePresentation(result) {
|
||||
@@ -63,6 +65,14 @@ function harness() {
|
||||
getCockpitState: () => null,
|
||||
getControlState: () => ({ hud: { visible: 'auto' } }),
|
||||
};
|
||||
// The packet reads the eye from the camera port of the renderer bound to
|
||||
// the scene object.
|
||||
const renderer = createStubRenderer();
|
||||
renderer.camera.setView({
|
||||
destination: { lon: -97.74, lat: 30.26, height: 500 },
|
||||
orientation: { heading: 0, pitch: Cesium.Math.toRadians(-45), roll: 0 },
|
||||
});
|
||||
bindRenderer(viewer, renderer);
|
||||
return { viewer, dataManager, styleManager };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user