mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
639e92b4f7
commit
0b1dc325bc
29 files changed
+869
-27
No files matched your search
@@ -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'))
|
||||
|
||||
@@ -20,7 +20,7 @@ test('the stub passes the conformance suite', async () => {
|
||||
.filter((r) => r.status === 'skip')
|
||||
.map((r) => r.id);
|
||||
// It draws only models into pixels, so the sweep's, a lit shape's, a line outline's and
|
||||
// the blends' (over a drawn shape) and video tiles' pixels go unread; its camera takes no user gestures: the drag and wheel scripts are for a
|
||||
// the blends' (over a drawn shape), video tiles' and the weather's pixels go unread; its camera takes no user gestures: the drag and wheel scripts are for a
|
||||
// camera that does (a controller over it, say).
|
||||
assert.deepEqual(skipped, [
|
||||
'effects.screenModulation.pixels',
|
||||
@@ -29,6 +29,7 @@ test('the stub passes the conformance suite', async () => {
|
||||
'draw.sets.blend',
|
||||
'draw.models.blend',
|
||||
'globe.imagery.video',
|
||||
'globe.weather.drawn',
|
||||
...CAMERA_SCRIPTS.filter(usesInput).map((s) => `camera.trace.${s.name}`),
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user