This commit is contained in:
Back777space
2025-04-06 19:37:47 +02:00
parent 8cce001672
commit 4b5b591549
2 changed files with 20 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
use bevy::{
input::mouse::AccumulatedMouseMotion, prelude::*, render::view::RenderLayers, window::{PrimaryWindow, WindowResized}
input::mouse::AccumulatedMouseMotion, pbr::VolumetricFog, prelude::*, render::view::RenderLayers, window::{PrimaryWindow, WindowResized}
};
use bevy_kira_audio::{Audio, AudioControl};
use bevy_rapier3d::prelude::*;
@@ -127,6 +127,14 @@ pub fn init_player(
fov: 90.0_f32.to_radians(),
..default()
}),
DistanceFog {
color: Color::srgba(0.12, 0.08, 0.08, 0.65),
falloff: FogFalloff::Linear {
start: 3.0,
end: 12.0,
},
..default()
},
));
// camera voor pitslampke
@@ -153,10 +161,10 @@ pub fn init_player(
Flashlight,
SpotLight {
intensity: 0.0,
color: Color::WHITE,
range: 4.0,
outer_angle: 30.0_f32.to_radians(), // wide cone for flashlight
inner_angle: 10.0_f32.to_radians(), // narrower inner cone
color: Color::srgba(0.9, 0.628, 0.392, 1.0),
range: 5.0,
outer_angle: 28.0_f32.to_radians(), // wide cone for flashlight
inner_angle: 12.0_f32.to_radians(), // narrower inner cone
shadows_enabled: false, // (set to true for realism)
radius: 0.35, // low value for hard light
..default()
@@ -390,7 +398,7 @@ pub fn handle_flashlight(
spotlight.intensity = if spotlight.intensity > 0.0 {
0.0
} else {
300_000.0
320_000.0
};
}
}