1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Synchronise engine sky configuration to Bevy camera & light entities.
//!
//! When a [`SkyConfig`](rustial_engine::SkyConfig) is active on the
//! engine [`MapState`](rustial_engine::MapState), this system adjusts
//! the directional-light transform so the light direction matches the
//! configured sun position.
//!
//! Full procedural atmospheric scattering is handled by the WGPU
//! renderer's own sky shader. For the Bevy renderer the same effect
//! can be achieved by enabling Bevy's built-in `Atmosphere` component
//! on the camera (requires HDR). This system provides the engine-side
//! wiring so the sun direction stays in sync regardless.
use *;
use crateRustialDirectionalLight;
use crateMapStateResource;
/// Synchronise sun direction from engine's `ComputedSky` to the
/// Bevy directional-light transform.
///
/// This system runs in the `SkyAtmosphere` set, after
/// [`sync_lights`](crate::systems::light_sync::sync_lights) so the
/// directional-light entity already exists.