Display panel: a Sky group for the atmosphere, day and night, sun, moon, stars and Milky Way

createViewSky sets globe.sky from the panel's switches and Milky Way
slider and keeps the choice for the next visit; what the user has not set
stays as the renderer draws it. Distance fog stays with the styles that
switch it.
This commit is contained in:
Sameh Khamis committed 2026-11-13 21:13:35 -08:00
1 parent 5cd28731fa
commit af3383a5a9
19 files changed
+331 -14

No files matched your search

+13
View File
@@ -39,6 +39,17 @@ export const useDisplayStore = defineStore('gev-display', () => {
weather.value = next && markRaw(next);
}
/**
* The Sky group, `{switches, milkyWay}` (switches by name, the Milky Way
* in percent); null where the renderer has no sky to set.
*/
const sky = shallowRef(null);
/** @param {?object} next A fresh presentation of the Sky group. */
function publishSky(next) {
sky.value = next && markRaw(next);
}
/** The Draw controls; null until the draw tool first renders. */
const draw = shallowRef(null);
@@ -121,6 +132,8 @@ export const useDisplayStore = defineStore('gev-display', () => {
publishModels3d,
weather,
publishWeather,
sky,
publishSky,
draw,
publishDraw,
geoImport,
+21 -1
View File
@@ -17,7 +17,7 @@ import { StyleParameterRows } from '../../styleParameters.js';
// and each publishes them; until they do, the panel shows its initial markup.
// Draw and Import live in UTILITIES (LayerPanelsView).
const display = useDisplayStore();
const { view, models3d, parameters, cockpitPortal, weather } = storeToRefs(display);
const { view, models3d, parameters, cockpitPortal, weather, sky } = storeToRefs(display);
// A control's change goes to its owner (DisplayBindings).
const act = (name, ...args) => display.act(name, ...args);
const pct = (value) => `${value}%`;
@@ -41,6 +41,13 @@ const weatherRows = computed(() => [
{ key: 'rain', label: t('Rain') },
{ key: 'snow', label: t('Snow') },
]);
const skyRows = computed(() => [
{ key: 'atmosphere', label: t('Atmosphere'), icon: 'public' },
{ key: 'lighting', label: t('Day and night'), icon: 'adjust' },
{ key: 'sun', label: t('Sun'), icon: 'light_mode' },
{ key: 'moon', label: t('Moon'), icon: 'dark_mode' },
{ key: 'stars', label: t('Stars'), icon: 'flare' },
]);
const models3dOn = computed(() => models3d.value?.pressed ?? true);
const modelsMode = computed(() => models3d.value?.mode ?? 'proximity');
const modelsOptions = computed(() => [
@@ -181,6 +188,19 @@ const allocationOptions = computed(() => [
<span class="pp-label">{{ t('Celestial') }}</span>
</UiButton>
</div>
<!-- Sky: only where the renderer has a sky to set. -->
<div v-if="sky" class="pp-toggle-group" id="sky-group">
<label v-for="row in skyRows" :key="row.key" class="pp-toggle-btn pp-scope-toggle" :id="`sky-${row.key}-row`">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">{{ row.icon }}</span>
<span class="pp-label">{{ row.label }}</span>
<input type="checkbox" :id="`sky-${row.key}-toggle`" @change="act('setSkySwitch', row.key, $event.target.checked)" :checked="sky.switches[row.key]" />
</label>
<div class="pp-slider-row visible" id="sky-milkyway-row">
<span class="pp-slider-mini-label">{{ t('Milky Way') }}</span>
<UiSlider class="pp-slider" id="sky-milkyway-slider" @update:model-value="act('setSkyMilkyWay', $event)" min="0" max="100" :model-value="sky.milkyWay" :aria-label="t('Milky Way')" />
<span class="pp-slider-value">{{ pct(sky.milkyWay) }}</span>
</div>
</div>
<!-- Weather: only where the renderer draws it. -->
<div v-if="weather" class="pp-toggle-group" id="weather-group">
<label class="pp-toggle-btn pp-scope-toggle" :title="t('Live weather: the conditions under the camera')">