feat(environment): add adaptive atmospheric fog
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-27 00:54:17 +02:00
parent ab3943eef3
commit 25e0f7e062
10 changed files with 148 additions and 28 deletions
@@ -1,5 +1,6 @@
import { create } from "zustand";
import { CLOUD_DEFAULTS, type CloudState } from "@/data/world/cloudConfig";
import { FOG_CONFIG, type FogState } from "@/data/world/fogConfig";
import { WIND_DEFAULTS, type WindState } from "@/data/world/windConfig";
import {
GRAPHICS_DEFAULTS,
@@ -8,12 +9,14 @@ import {
interface WorldSettingsState {
clouds: CloudState;
fog: FogState;
wind: WindState;
graphics: GraphicsState;
}
interface WorldSettingsActions {
setClouds: (clouds: Partial<CloudState>) => void;
setFog: (fog: Partial<FogState>) => void;
setWind: (wind: Partial<WindState>) => void;
setWindSpeed: (speed: number) => void;
setWindDirection: (direction: number) => void;
@@ -31,6 +34,12 @@ type WorldSettingsStore = WorldSettingsState & WorldSettingsActions;
const DEFAULT_STATE: WorldSettingsState = {
clouds: { ...CLOUD_DEFAULTS },
fog: {
density: FOG_CONFIG.density,
far: FOG_CONFIG.far,
mode: FOG_CONFIG.mode,
near: FOG_CONFIG.near,
},
wind: { ...WIND_DEFAULTS },
graphics: { ...GRAPHICS_DEFAULTS },
};
@@ -43,6 +52,11 @@ export const useWorldSettingsStore = create<WorldSettingsStore>()((set) => ({
clouds: { ...state.clouds, ...cloudsUpdate },
})),
setFog: (fogUpdate) =>
set((state) => ({
fog: { ...state.fog, ...fogUpdate },
})),
setWind: (windUpdate) =>
set((state) => ({
wind: { ...state.wind, ...windUpdate },