/** * WeatherBlackboard — Singleton shared state for @weather hub trait. * * The @weather trait owns this blackboard and writes to it each frame. * Consumer traits (@volumetric_clouds, @cloth, @fluid, @physics, @erosion, * @god_rays, @particle_system) read from it. This creates environmental * coherence without trait-to-trait coupling. * * Pattern: P.GAPS.10 (Hub Trait Architecture) * * @module environment */ export type PrecipitationType = 'none' | 'rain' | 'snow' | 'hail'; export interface WeatherBlackboardState { /** Wind direction and magnitude as a 3D vector */ wind_vector: [number, number, number]; /** Precipitation intensity 0-1 */ precipitation: number; /** Type of precipitation */ precipitation_type: PrecipitationType; /** Ambient temperature in Celsius */ temperature: number; /** Relative humidity 0-1 */ humidity: number; /** Normalized sun direction vector (from surface toward sun) */ sun_position: [number, number, number]; /** Sun light intensity 0-1 (0 at night) */ sun_intensity: number; /** Cloud coverage density 0-1 */ cloud_density: number; /** Cloud layer altitude in meters */ cloud_altitude: number; /** Fog density 0-1 */ fog_density: number; /** Time of day in hours 0-24 (fractional) */ time_of_day: number; /** True when sun_intensity < 0.1 */ is_night: boolean; /** Accumulated surface moisture from rain 0-1 (decays when not raining) */ surface_wetness: number; /** Wind speed (magnitude of wind_vector) */ wind_speed: number; /** Visibility range in meters (affected by fog + precipitation) */ visibility_range: number; /** Frame counter — incremented each @weather update */ frame: number; } /** * Global weather blackboard. * * WRITE: Only the @weather hub trait should write to this. * READ: Any consumer trait can read from this each frame. * * The blackboard is a plain object — reads are zero-cost. * The @weather trait must run FIRST in the trait update loop * so consumers see the latest state. */ export declare const weatherBlackboard: WeatherBlackboardState; /** * Update the blackboard with new values. Recomputes derived fields. * Called by WeatherHubTrait.onUpdate() each frame. */ export declare function updateWeatherBlackboard(partial: Partial>): void; /** * Reset blackboard to default state. Used in testing. */ export declare function resetWeatherBlackboard(): void; /** * Compute sun position from time of day and latitude. * * Returns normalized direction vector pointing from surface toward sun. * At midnight (0/24), sun is directly below horizon. * At noon (12), sun is at maximum elevation. * * @param timeOfDay - Hours 0-24 * @param latitude - Degrees, default 45 (mid-latitude) * @returns [x, y, z] normalized sun direction */ export declare function computeSunPosition(timeOfDay: number, latitude?: number): [number, number, number]; /** * Compute sun intensity from elevation angle. * Smooth ramp: 0 at horizon, 1 at max elevation, with atmospheric scattering falloff. */ export declare function computeSunIntensity(sunY: number): number; //# sourceMappingURL=WeatherBlackboard.d.ts.map