mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
fmt + clippy
This commit is contained in:
parent
3542ddcd0c
commit
e0205019ef
4 changed files with 24 additions and 28 deletions
|
@ -147,32 +147,30 @@ fn setup(
|
|||
});
|
||||
// directional light
|
||||
const HALF_SIZE: f32 = 10.0;
|
||||
commands
|
||||
.spawn_bundle(DirectionalLightBundle {
|
||||
directional_light: DirectionalLight {
|
||||
illuminance: 10000.0,
|
||||
shadow_bias_min: 0.00001,
|
||||
shadow_bias_max: 0.0001,
|
||||
shadow_projection: OrthographicProjection {
|
||||
left: -HALF_SIZE,
|
||||
right: HALF_SIZE,
|
||||
bottom: -HALF_SIZE,
|
||||
top: HALF_SIZE,
|
||||
near: -10.0 * HALF_SIZE,
|
||||
far: 10.0 * HALF_SIZE,
|
||||
..Default::default()
|
||||
},
|
||||
commands.spawn_bundle(DirectionalLightBundle {
|
||||
directional_light: DirectionalLight {
|
||||
illuminance: 10000.0,
|
||||
shadow_bias_min: 0.00001,
|
||||
shadow_bias_max: 0.0001,
|
||||
shadow_projection: OrthographicProjection {
|
||||
left: -HALF_SIZE,
|
||||
right: HALF_SIZE,
|
||||
bottom: -HALF_SIZE,
|
||||
top: HALF_SIZE,
|
||||
near: -10.0 * HALF_SIZE,
|
||||
far: 10.0 * HALF_SIZE,
|
||||
..Default::default()
|
||||
},
|
||||
transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::PI / 2.0)),
|
||||
..Default::default()
|
||||
});
|
||||
},
|
||||
transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::PI / 2.0)),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
// camera
|
||||
commands
|
||||
.spawn_bundle(PerspectiveCameraBundle {
|
||||
transform: Transform::from_xyz(0.0, box_offset, 4.0)
|
||||
.looking_at(Vec3::new(0.0, box_offset, 0.0), Vec3::Y),
|
||||
..Default::default()
|
||||
});
|
||||
commands.spawn_bundle(PerspectiveCameraBundle {
|
||||
transform: Transform::from_xyz(0.0, box_offset, 4.0)
|
||||
.looking_at(Vec3::new(0.0, box_offset, 0.0), Vec3::Y),
|
||||
..Default::default()
|
||||
});
|
||||
}
|
||||
|
|
|
@ -329,6 +329,7 @@ pub struct LightMeta {
|
|||
pub shadow_view_bind_group: Option<BindGroup>,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn prepare_lights(
|
||||
mut commands: Commands,
|
||||
mut texture_cache: ResMut<TextureCache>,
|
||||
|
|
|
@ -183,10 +183,7 @@ impl<'a> TrackedRenderPass<'a> {
|
|||
}
|
||||
|
||||
pub fn draw(&mut self, vertices: Range<u32>, instances: Range<u32>) {
|
||||
debug!(
|
||||
"draw: {:?} {:?}",
|
||||
vertices, instances
|
||||
);
|
||||
debug!("draw: {:?} {:?}", vertices, instances);
|
||||
self.pass.draw(vertices, instances);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ impl<'a> From<&'a Shader> for ShaderModuleDescriptor<'a> {
|
|||
label: None,
|
||||
source: match shader {
|
||||
Shader::Wgsl(source) => ShaderSource::Wgsl(source.clone()),
|
||||
Shader::Glsl(source) => {
|
||||
Shader::Glsl(_source) => {
|
||||
let reflection = shader.reflect().unwrap();
|
||||
let wgsl = reflection.get_wgsl().unwrap();
|
||||
ShaderSource::Wgsl(wgsl.into())
|
||||
|
|
Loading…
Reference in a new issue