feat(globe): mover sets report ready(); Navara scales by distance as Cesium

Task 10b foundation.
- MoverSet.ready(): whether what the set draws has loaded (Navara: the
  model set's glTF, a URL atlas; Cesium: every instance's Model, the cropped
  atlas; parts without it draw at once). The aircraft renderer keeps the 2D
  glyph until a model set is ready, as the Cesium path waits on Model.ready.
  Contract suite: a drawn model set is ready() (both engines); unit test of
  the neutral store.
- Navara sprites and points interpolate scaleByDistance as Cesium's
  NearFarScalar (over the squared camera distance, eased by ^0.2) instead
  of linearly in distance, so aircraft glyphs have Cesium's size at every
  range; the CPU pick radius follows (distanceScale, tested equal to
  focusDeemphasis' port of czm_nearFarScalar). The contract text says so.
This commit is contained in:
German Khokhlov committed 2026-10-17 01:16:59 +04:00
1 parent d81ebf1268
commit 4dfcba8989
10 files changed
+103 -14

No files matched your search

+7 -1
View File
@@ -309,7 +309,10 @@ export function createMoverStore(options) {
* destroy. commit() hands the engine the changed range and cleans the store;
* a destroyed set refuses every call but destroy().
*/
export function createMoverSet(store, { id, commit, destroy }) {
export function createMoverSet(
store,
{ id, commit, destroy, ready = () => true },
) {
let destroyed = false;
const alive = () => {
if (destroyed) throw new Error('Mover set was destroyed');
@@ -332,6 +335,8 @@ export function createMoverSet(store, { id, commit, destroy }) {
store.clean();
},
positionsView: () => store.positionsView(),
// Whether what it draws has loaded (a model's glTF, an atlas image).
ready: () => !destroyed && ready() === true,
destroy() {
if (destroyed) return;
destroyed = true;
@@ -367,6 +372,7 @@ export function createMoverRegistry(build) {
sets.delete(options.id);
part.destroy();
},
ready: () => (part.ready ? part.ready() : true),
});
sets.set(options.id, entry);
return entry.set;