feat(render): a renderer can draw weather: the weather capability adds globe.weather (clouds, fog, haze, rain and snow, 0 to 1, and the wind they drift on); the view shows the conditions observed under the camera, and the Display panel's Weather group sets them by hand

This commit is contained in:
Sameh Khamis committed 2026-11-13 11:02:56 -08:00
1 parent 639e92b4f7
commit 0b1dc325bc
29 files changed
+869 -27

No files matched your search

+11
View File
@@ -14,6 +14,7 @@ import { alongLength } from '../../geo/polyline.js';
import { clusterScreenPoints } from '../../geo/screenCluster.js';
import { createInputRouter } from '../input/router.js';
import { cssColor } from '../color.js';
import { CLEAR_WEATHER, mergeWeather } from '../weather.js';
import { CAPABILITIES, CONTRACT_VERSION } from '../contract/index.js';
import { createStubCamera } from './camera.js';
import { motionPosition } from '../motion/iconMotion.js';
@@ -1659,6 +1660,16 @@ export function createStubRenderer(options = {}) {
};
},
};
if (capabilities.has('weather')) {
let weather = CLEAR_WEATHER;
globe.weather = {
get: () => mergeWeather(weather),
set(patch) {
weather = mergeWeather(weather, patch);
requestRender('weather');
},
};
}
if (capabilities.has('globeVisibility'))
globe.isGlobeVisible = () => globeVisible;
if (capabilities.has('surfaceIdentity'))