Set scene time through the Cesium frame port, in the application too

frame.setTime moves from the conformance renderer into the shared Cesium
ports, so the application's renderer has it. It moves the clock and asks for
a frame, which on-demand drawing needs. It no longer stops the clock: the
conformance renderer stops its own at creation, and the application's clock
keeps whatever state its owner gave it.
This commit is contained in:
Sameh Khamis committed 2026-11-06 17:38:29 -08:00
1 parent 338b75b8d8
commit 1a40c5a30a
5 files changed
+32 -16

No files matched your search

+3 -10
View File
@@ -66,7 +66,8 @@ export async function createCesiumSceneRenderer({
contextOptions: { webgl: { preserveDrawingBuffer: true } },
});
const scene = widget.scene;
// A fixed time, so lighting is the same in every capture.
// A fixed time, so lighting is the same in every capture; `setTime`
// moves it and it stays there.
widget.clock.shouldAnimate = false;
widget.clock.currentTime = Cesium.JulianDate.fromIso8601(
'2026-06-21T18:00:00Z',
@@ -95,14 +96,6 @@ export async function createCesiumSceneRenderer({
query: ports.query,
report: ports.report,
});
const frame = {
...ports.frame,
setTime(ms) {
widget.clock.currentTime = Cesium.JulianDate.fromDate(new Date(ms));
widget.clock.shouldAnimate = false;
scene.requestRender();
},
};
// --- Globe -----------------------------------------------------------------
@@ -269,7 +262,7 @@ export async function createCesiumSceneRenderer({
contractVersion: '0',
capabilities,
canvas: scene.canvas,
frame,
frame: ports.frame,
globe,
// A member of a capability left out is absent, not stubbed.
draw: capabilities.has('models')