mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 18:52:18 +00:00
Merge origin/main into german/navara
Main's work since the last merge runs on the globe contract where this branch draws through it: - Satellites take main's classes, sensors, ground-track bearings and world time through contract points and rings; launches take the world timeline. The satellite's cockpit subject dims, copies positions and refocuses through the contract. - Flights, military and vessels keep main's photos, retry cool-downs, world-clock motion and the ship bridge. Trail seeding in the shared aircraft tracking reads each layer's clock. - Traffic's flow lines and single build draw as ground sets; transit keeps dated credits and the new cities; CCTV opens the nearest camera, and the Quebec overlay projects and tests the horizon through the contract. Bikeshare's manager cleanup moved into its current lifecycle. - Draw keeps main's mark actions across engine switches. - The world clock in src/time is plain numbers again: Julian dates come from src/geo, the frame loop is injected, and the binding to Cesium's viewer clock lives in src/globe/cesium/worldTime.js. Navara's sky and sun follow the world time; live feeds keep the real time. - The cockpit's orbital view, with its sensor zoom, ground focus and satellite switching, stays Cesium-only for now: Navara hides its entry. Its Cesium calls live in src/globe/cesium/orbital.js. The ship bridge's finest-detail waterline sampling is Cesium-only too; Navara samples loaded geometry and detailed terrain. Both are in KNOWN-ISSUES. - Main's tests that built a Cesium scene by hand run on the fake engine. - The boundary manifest is regenerated, the coupling baseline records the orbital and bridge code, and the main-chunk baseline is raised to the merged size: main itself grew its main chunk by 93,959 bytes (gzip -9) since the previous merge base.
This commit is contained in:
commit
2a761aa5eb
452 files changed
+73437
-1752
No files matched your search
@@ -1,6 +1,7 @@
|
||||
// The Navara globe for the app's experimental engine mode: builds the view
|
||||
// the product way (viewOptions.js) and the GlobeEngine on it. Load it with a
|
||||
// dynamic import() so Navara stays out of the Cesium-mode bundle.
|
||||
import { worldClock, worldTimeFor } from '../../time/worldClock.js';
|
||||
|
||||
import ThreeView, { Color as NavaraColor, MeshDesc } from '@navaramap/three';
|
||||
import * as geo from '../../geo/index.js';
|
||||
@@ -114,8 +115,7 @@ function groundInView(engine) {
|
||||
* hd?: boolean,
|
||||
* }} options `search`, the page's query string, picks the look from
|
||||
* `?look=` (cinematic by default); `hd` draws at the device pixel ratio
|
||||
* with MSAA (Navara HD), else at CSS pixels without it. The sun follows the engine clock (the
|
||||
* page's app clock): the look reads its frame time.
|
||||
* with MSAA (Navara HD), else at CSS pixels without it. The sun follows the world time.
|
||||
* @returns {Promise<{ setRenderLoop: (enabled: boolean) => void, engine: import('../contract.js').GlobeEngine, destroy: () => void }>}
|
||||
*/
|
||||
export async function createNavaraGlobe({ container, search, hd = false }) {
|
||||
@@ -139,9 +139,8 @@ export async function createNavaraGlobe({ container, search, hd = false }) {
|
||||
const plan = navaraScenePlan(resolveNavaraLook(search), {
|
||||
mobile: Boolean(view.isMobileOptimized?.()),
|
||||
});
|
||||
// The sun follows the engine clock (one time source for layers and the
|
||||
// look); the look only runs in preRender, after the engine exists.
|
||||
look = buildNavaraLook(view, plugin, plan, () => engine.clock.frameTime(), {
|
||||
// The sky follows the timeline; live feeds keep the engine's app clock.
|
||||
look = buildNavaraLook(view, plugin, plan, worldTimeFor('sky'), {
|
||||
forEachLuminanceUniform,
|
||||
});
|
||||
// The look's shadowed sun leaked a light per frame (internals.js).
|
||||
@@ -208,6 +207,7 @@ export async function createNavaraGlobe({ container, search, hd = false }) {
|
||||
placed &&
|
||||
plan.globeLighting &&
|
||||
automaticLandscape &&
|
||||
worldClock.isLive() &&
|
||||
(engine.maps.baseKind === 'sentinel2' ||
|
||||
engine.maps.baseKind === 'esri-imagery');
|
||||
if (container.hasAttribute('data-terrain-daylight') !== landscape)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Builds a Navara look (viewOptions.js navaraScenePlan) on an initialised
|
||||
// view and keeps it current while the view renders: the sun follows `now`
|
||||
// (the engine clock's frame time in the app: the app clock, which is the wall
|
||||
// clock the HUD's SUN elevation reads unless QA moves it); the cinematic look
|
||||
// (the world time in the app, shared with the HUD's SUN elevation); the cinematic look
|
||||
// lights the globe
|
||||
// from the atmosphere when seen from space, places its clouds above the terrain while the sun is up, brightens the atmosphere
|
||||
// (createLuminanceScaler, uniforms from internals.js), compiles both
|
||||
@@ -33,8 +32,8 @@ import {
|
||||
* sun's elevation there); it returns true when it changed the scene, so
|
||||
* the caller draws one more frame. It allocates nothing on a frame that
|
||||
* changes nothing.
|
||||
* @param {() => number} [now] the sun's time (ms); the app passes the engine
|
||||
* clock's frame time (index.js), the wall clock by default and in tests
|
||||
* @param {() => number} [now] the sun's time (ms); the app passes the world
|
||||
* time (index.js), the wall clock by default and in tests
|
||||
* @param {{ forEachLuminanceUniform?: (handles: object, visit: (key: string, uniform: { value: object }, scaled: boolean) => void) => void }} [internals]
|
||||
* the takram uniforms behind the atmosphere scale (internals.js); without
|
||||
* it the scale does nothing.
|
||||
|
||||
@@ -2,6 +2,7 @@ import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { buildNavaraLook } from './look.js';
|
||||
import { navaraScenePlan } from './viewOptions.js';
|
||||
import { createWorldClock } from '../../time/worldClock.js';
|
||||
|
||||
function fakeView(dateMs) {
|
||||
const added = [];
|
||||
@@ -37,6 +38,27 @@ const plugin = (calls) => ({
|
||||
},
|
||||
});
|
||||
|
||||
test('the sky follows world time through seek and live without moving live feeds', () => {
|
||||
let wall = Date.UTC(2026, 10, 1, 12);
|
||||
const world = createWorldClock({ now: () => wall, follow: ['sky'] });
|
||||
const view = fakeView(wall);
|
||||
const look = buildNavaraLook(view, plugin([]), navaraScenePlan('cinematic'), world.timeFor('sky'));
|
||||
const place = { lat: 30, lng: -97 };
|
||||
look.frame(900, false, 0, place, world.isLive());
|
||||
const past = wall - 6 * 3600_000;
|
||||
world.seek(past);
|
||||
look.frame(900, false, 0, place, world.isLive());
|
||||
assert.equal(view.atmosphere.date.getTime(), past);
|
||||
assert.equal(world.timeFor('flights')(), wall);
|
||||
wall += 120_000;
|
||||
look.frame(900, false, 0, place, world.isLive());
|
||||
assert.equal(view.atmosphere.date.getTime(), past, 'paused sky holds');
|
||||
assert.equal(world.timeFor('flights')(), wall);
|
||||
world.goLive();
|
||||
look.frame(900, false, 0, place, false);
|
||||
assert.equal(view.atmosphere.date.getTime(), wall);
|
||||
});
|
||||
|
||||
/** A cinematic look past its two warm-up frames (updates cleared). */
|
||||
function warmCinematic(view, internals) {
|
||||
const look = buildNavaraLook(
|
||||
|
||||
Reference in new issue
Block a user