shut the linter up

This commit is contained in:
Joe Ardent 2023-01-25 15:35:28 -08:00
parent ff64bbeff3
commit 738dd6569a

View file

@ -9,8 +9,8 @@ pub const LIGHT_RANGE: f32 = 90.0;
#[derive(Component)] #[derive(Component)]
struct AnimatedCyberLight { struct AnimatedCyberLight {
axis: Vec3, _axis: Vec3,
rate: f32, _rate: f32,
} }
#[derive(Component, Default)] #[derive(Component, Default)]
@ -18,7 +18,7 @@ pub(crate) struct AnimateCyberLightWireframe {
pub wired: bool, pub wired: bool,
} }
fn spawn_moving_lights( fn _spawn_moving_lights(
mut commands: Commands, mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>, mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>, mut materials: ResMut<Assets<StandardMaterial>>,
@ -27,13 +27,13 @@ fn spawn_moving_lights(
// spawn orbiting bisexual lights // spawn orbiting bisexual lights
for _ in 0..655 { for _ in 0..655 {
// mechanics // mechanics
let axis = crate::random_unit_vec(rng); let _axis = crate::random_unit_vec(rng);
let angle = rng.gen_range(0.0..TAU); let angle = rng.gen_range(0.0..TAU);
let rate: f32 = rng.gen_range(7.0..10.0); let _rate: f32 = rng.gen_range(7.0..10.0);
let rate = rate.to_radians(); let _rate = _rate.to_radians();
let rotation = Quat::from_axis_angle(axis, angle); let rotation = Quat::from_axis_angle(_axis, angle);
let altitude = PLANET_RADIUS + rng.gen_range(8.0..20.0); let altitude = PLANET_RADIUS + rng.gen_range(8.0..20.0);
let perp = axis.any_orthonormal_vector(); let perp = _axis.any_orthonormal_vector();
let translation = perp * altitude; let translation = perp * altitude;
let transform = Transform::from_translation(translation); let transform = Transform::from_translation(translation);
@ -59,7 +59,7 @@ fn spawn_moving_lights(
}; };
commands commands
// first, spawn an entity with a transform we can rotate // first, spawn an entity with a transform we can rotate
.spawn((AnimatedCyberLight { axis, rate },)) .spawn((AnimatedCyberLight { _axis, _rate },))
.insert(sbundle) .insert(sbundle)
.with_children(|parent| { .with_children(|parent| {
parent parent
@ -163,12 +163,12 @@ fn spawn_static_lights(
}); });
} }
fn orbit_lights(time: Res<Time>, mut query: Query<(&mut Transform, &AnimatedCyberLight)>) { fn _orbit_lights(time: Res<Time>, mut query: Query<(&mut Transform, &AnimatedCyberLight)>) {
let dt = time.delta_seconds(); let dt = time.delta_seconds();
for (mut transform, light) in query.iter_mut() { for (mut transform, light) in query.iter_mut() {
let AnimatedCyberLight { axis, rate } = *light; let AnimatedCyberLight { _axis, _rate } = *light;
let theta = rate * dt; let theta = _rate * dt;
transform.rotation *= Quat::from_axis_angle(axis, theta); transform.rotation *= Quat::from_axis_angle(_axis, theta);
} }
} }